diff --git a/src/fenrir/commands/onCursorChange/60000-word_echo.py b/src/fenrir/commands/onCursorChange/60000-word_echo.py index bbf0eac0..9af50208 100644 --- a/src/fenrir/commands/onCursorChange/60000-word_echo.py +++ b/src/fenrir/commands/onCursorChange/60000-word_echo.py @@ -19,9 +19,6 @@ class command(): return 'No Description found' def run(self): - # first place could not be the end of a word - if self.env['screen']['newCursor']['x'] == 0: - return # is it enabled? if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'): return @@ -36,11 +33,21 @@ class command(): newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] x, y, currWord, endOfScreen, lineBreak = \ word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent) + # currently writing if self.env['runtime']['screenManager'].isDelta(): return + + # navigate prev word + if self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x'] > 1: + # at the end of a word + if newContent[self.env['screen']['newCursor']['x']].isspace(): + return + if self.env['screen']['newCursor']['x'] != x: + return + # next word else: - # at the end of a word + # at the end of a word if not newContent[self.env['screen']['newCursor']['x']].isspace(): return if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \