Skip to content

Commit f28009d

Browse files
author
Ben Tilley
committed
fix(vimenv): repair off by one error in lines_following_cursor
The greater than OR equal meant that the generator wasn't reading the last line of the file.
1 parent bb97436 commit f28009d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/vimenv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def lines_following_cursor(self):
102102
cursor_row = vim.current.window.cursor[0] - 1
103103
current_row = cursor_row
104104
while True:
105-
if current_row >= len(vim.current.buffer) - 1:
105+
if current_row > len(vim.current.buffer) - 1:
106106
raise StopIteration('Buffer is out of lines.')
107107
yield current_row, buffer[current_row]
108108
current_row += 1

0 commit comments

Comments
 (0)