Skip to content

Commit a040af8

Browse files
committed
kitty: Remove LF properly
This is an addendum to 278b0c8. Unfortunately cutting the while loop short is not enough, because stl is still referenced in its entirety (e.g. with string suffix constructions) many times inside the loop. Instead of carefully adjusting each index, we just remove the LF at the start now.
1 parent 259d0da commit a040af8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

doc/tpipeline-kitty.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ from kitty.utils import color_as_int
4949
timer_id = None
5050

5151
def parse_stl(screen: Screen, draw_data: DrawData, stl: str, draw: bool):
52+
stl = stl[:-1] # remove LF
5253
pos = 0
5354
length = 0
54-
while pos < len(stl) - 1:
55+
while pos < len(stl):
5556
next = stl.find("#[", pos)
5657
if next == -1:
5758
length += len(stl[pos:])

0 commit comments

Comments
 (0)