From fe2070c300f1173590e89f2600193578d64da257 Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 27 Sep 2017 00:03:14 +0200 Subject: [PATCH] improve navigation --- .../55000-present_line_if_cursor_change_vertical.py | 3 +-- src/fenrir/commands/onCursorChange/60000-word_echo.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/fenrir/commands/onCursorChange/55000-present_line_if_cursor_change_vertical.py b/src/fenrir/commands/onCursorChange/55000-present_line_if_cursor_change_vertical.py index 55d27505..fb0bd721 100644 --- a/src/fenrir/commands/onCursorChange/55000-present_line_if_cursor_change_vertical.py +++ b/src/fenrir/commands/onCursorChange/55000-present_line_if_cursor_change_vertical.py @@ -25,8 +25,7 @@ class command(): return # this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack if self.env['runtime']['screenManager'].isDelta(): - if len(self.env['screen']['newDelta']) > 4: - return + return # is a vertical change? if not self.env['runtime']['cursorManager'].isCursorVerticalMove(): diff --git a/src/fenrir/commands/onCursorChange/60000-word_echo.py b/src/fenrir/commands/onCursorChange/60000-word_echo.py index 4f303c69..6d713010 100644 --- a/src/fenrir/commands/onCursorChange/60000-word_echo.py +++ b/src/fenrir/commands/onCursorChange/60000-word_echo.py @@ -45,10 +45,10 @@ class command(): # navigate by word (i.e. CTRL + Arrow left/right) if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1: # at the start of a word - if newContent[self.env['screen']['newCursor']['x']].isspace(): - return - if self.env['screen']['newCursor']['x'] != x: - return + if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \ + (self.env['screen']['newCursor']['x'] != x): + return + # navigate by char (left/ right) else: # at the end of a word