mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-11-16 21:20:08 +00:00
Fix #10609
This commit is contained in:
parent
dedb3701fc
commit
007e61a59e
3 changed files with 19 additions and 6 deletions
|
|
@ -219,6 +219,9 @@ Detailed list of changes
|
|||
with momentum, and a finger held still before it moves selects text
|
||||
(:iss:`5432`, :pull:`10551`)
|
||||
|
||||
- Fix a space immediately after a tab stop being dropped when the screen
|
||||
contents are copied or sent to the scrollback pager (:iss:`10609`)
|
||||
|
||||
- Fix closing an unfocused window that comes before the focused window in the
|
||||
layout sometimes moving focus to a different window
|
||||
|
||||
|
|
|
|||
|
|
@ -2368,7 +2368,8 @@ screen_tab(Screen *self) {
|
|||
else {
|
||||
self->lc->count = 2;
|
||||
self->lc->chars[0] = '\t';
|
||||
self->lc->chars[1] = diff;
|
||||
// number of blank cells after the tab cell that the tab covers
|
||||
self->lc->chars[1] = diff - 1;
|
||||
idx = tc_get_or_insert_chars(self->text_cache, self->lc);
|
||||
if (diff < arraysz(self->tab_cache.idx_plus_1)) self->tab_cache.idx_plus_1[diff] = idx + 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,6 +197,15 @@ class TestScreen(BaseTest):
|
|||
s.draw('a\tb')
|
||||
self.ae((s.cursor.x, s.cursor.y), (40, 0))
|
||||
self.ae(s.line(0).as_ansi(), 'a\tb')
|
||||
# spaces immediately after a tab stop must not be swallowed (issue #10609)
|
||||
s = self.create_screen(cols=20)
|
||||
s.draw('x\t y')
|
||||
s.carriage_return(), s.linefeed()
|
||||
s.draw('x\t\t z')
|
||||
self.ae(s.line(0).as_ansi(), 'x\t y')
|
||||
self.ae(str(s.line(0)), 'x\t y')
|
||||
self.ae(s.line(1).as_ansi(), 'x\t\t z')
|
||||
self.ae(str(s.line(1)), 'x\t\t z')
|
||||
|
||||
def test_draw_char(self):
|
||||
# Test in line-wrap, non-insert mode
|
||||
|
|
@ -549,13 +558,13 @@ class TestScreen(BaseTest):
|
|||
self.ae(str(s.linebuf), '88\n88\n89\n99\n99')
|
||||
s = self.create_screen()
|
||||
s.draw('a' * s.columns)
|
||||
s.linefeed(), s.carriage_return()
|
||||
s.carriage_return(), s.linefeed()
|
||||
s.draw('bb')
|
||||
s.resize(s.lines, s.columns - 2)
|
||||
self.ae(str(s.linebuf), 'aaa\naa\nbb\n\n')
|
||||
s.cursor.y = s.cursor.x = 0
|
||||
s.draw('x' * len(str(s.line(0))))
|
||||
s.linefeed(), s.carriage_return()
|
||||
s.carriage_return(), s.linefeed()
|
||||
s.draw('x' * len(str(s.line(1))))
|
||||
s.resize(s.lines, s.columns + 4)
|
||||
self.ae(str(s.linebuf), 'xxx\nxx\nbb\n\n')
|
||||
|
|
@ -1453,12 +1462,12 @@ class TestScreen(BaseTest):
|
|||
|
||||
s = self.create_screen()
|
||||
set_link('1'), s.draw('12'), set_link(), s.draw('X'), set_link('1'), s.draw('3')
|
||||
s.linefeed(), s.carriage_return()
|
||||
s.carriage_return(), s.linefeed()
|
||||
s.draw('abc')
|
||||
s.linefeed(), s.carriage_return()
|
||||
s.carriage_return(), s.linefeed()
|
||||
set_link(), s.draw('Z ')
|
||||
set_link('1'), s.draw('xyz')
|
||||
s.linefeed(), s.carriage_return()
|
||||
s.carriage_return(), s.linefeed()
|
||||
set_link('2'), s.draw('Z Z')
|
||||
self.assertIsNone(s.current_url_text())
|
||||
self.assertIsNone(s.hyperlink_at(0, 4))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue