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,7 +25,6 @@ class command():
return return
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack # 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 self.env['runtime']['screenManager'].isDelta():
if len(self.env['screen']['newDelta']) > 4:
return return
# is a vertical change? # is a vertical change?

View File

@ -45,10 +45,10 @@ class command():
# navigate by word (i.e. CTRL + Arrow left/right) # navigate by word (i.e. CTRL + Arrow left/right)
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1: if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
# at the start of a word # at the start of a word
if newContent[self.env['screen']['newCursor']['x']].isspace(): if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
return (self.env['screen']['newCursor']['x'] != x):
if self.env['screen']['newCursor']['x'] != x:
return return
# navigate by char (left/ right) # navigate by char (left/ right)
else: else:
# at the end of a word # at the end of a word