improve navigation

This commit is contained in:
chrys 2017-09-27 00:03:14 +02:00
parent d745042839
commit fe2070c300
2 changed files with 5 additions and 6 deletions

View File

@ -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():

View File

@ -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:
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