From d6741e4ba57fd31cd2a9b706732beee022c46eb7 Mon Sep 17 00:00:00 2001 From: Daniele Parisi Date: Tue, 13 Dec 2022 08:27:17 +0100 Subject: [PATCH] switch word editing progs to classic emacs behavior --- noise/lineImpl.nim | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/noise/lineImpl.nim b/noise/lineImpl.nim index 08fcda3..47d5e55 100644 --- a/noise/lineImpl.nim +++ b/noise/lineImpl.nim @@ -362,12 +362,8 @@ when promptCompletion: when promptWordEditing: import unicode proc findWord(self: var Line) = - if isAlphaNum(self.data[self.pos]): - # cursor under a word, move to left - while self.pos > 0 and isAlphaNum(self.data[self.pos - 1]): - dec self.pos - else: - # cursor under something else, move to next word + if not isAlphaNum(self.data[self.pos]): + # cursor not under word, move to next word while self.pos < self.dataLen and not isAlphaNum(self.data[self.pos]): inc self.pos