From 667e68626ce9a2b159b7aa79d4642d98c4d5b700 Mon Sep 17 00:00:00 2001 From: MeexReay Date: Fri, 21 Mar 2025 21:53:13 +0300 Subject: [PATCH] enter insert fix --- app/kfc/kfc.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/kfc/kfc.js b/app/kfc/kfc.js index 2541af3..222ec3c 100644 --- a/app/kfc/kfc.js +++ b/app/kfc/kfc.js @@ -117,7 +117,12 @@ async function main(args) { } } else if (mode == "insert") { content = editLine(content, pos[1], line => line.slice(0, pos[0]) + event.char + line.slice(pos[0])) - pos[0] += 1 + if (event.char == "\n") { + pos[1] += 1 + pos[0] = 0 + } else { + pos[0] += 1 + } } }