Fix a corner case with correction when moving between highlights

(there are still a few but this one would wipe all other highlights,
making it a bit painful)
This commit is contained in:
mathieui 2020-05-17 20:42:21 +02:00
parent aec4c279f2
commit 6057d0dc9b

View file

@ -243,7 +243,7 @@ class TextWin(Win):
try:
pos = self.built_lines.index(hl)
except ValueError:
self.highlights = self.highlights[self.hl_pos + 1:]
del self.highlights[self.hl_pos]
if not self.highlights:
self.hl_pos = float('nan')
self.pos = 0
@ -277,7 +277,7 @@ class TextWin(Win):
try:
pos = self.built_lines.index(hl)
except ValueError:
self.highlights = self.highlights[self.hl_pos + 1:]
del self.highlights[self.hl_pos]
if not self.highlights:
self.hl_pos = float('nan')
self.pos = 0