Fix highlighting right at the edge of a non-scrolled line
This commit is contained in:
@@ -805,7 +805,7 @@ class File:
|
||||
else:
|
||||
h_s_x = region.x - l_x
|
||||
|
||||
if region.end >= l_x_max:
|
||||
if region.end >= l_x_max and l_x_max < len(self.buf[l_y]):
|
||||
if file_hl.include_edge:
|
||||
h_e_x = curses.COLS
|
||||
else:
|
||||
|
||||
@@ -113,3 +113,12 @@ def test_syntax_highlighting_one_off_left_of_screen(run, tmpdir):
|
||||
h.press('End')
|
||||
h.await_text_missing('?')
|
||||
h.assert_screen_attr_equals(1, [(236, 40, 0)] * 20)
|
||||
|
||||
|
||||
def test_syntax_highlighting_to_edge_of_screen(run, tmpdir):
|
||||
f = tmpdir.join('f.demo')
|
||||
f.write(f'# {"x" * 18}')
|
||||
|
||||
with run(str(f), term='screen-256color', width=20) as h, and_exit(h):
|
||||
h.await_text('# xxx')
|
||||
h.assert_screen_attr_equals(1, [(243, 40, 0)] * 20)
|
||||
|
||||
Reference in New Issue
Block a user