Don't restrict the DCH control code to only the current scroll region

Matches behavior of other terminal emulators.  Fixes #3090
This commit is contained in:
Kovid Goyal 2020-11-12 11:44:09 +05:30
parent a74679dd95
commit 9816979169
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 10 additions and 1 deletions

View File

@ -44,6 +44,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Fix last character of URL not being detected if it is the only character on a
new line (:iss:`3088`)
- Don't restrict the DCH control code to only the current scroll region (:iss:`3090`)
0.19.1 [2020-10-06]
-------------------

View File

@ -1351,7 +1351,7 @@ screen_repeat_character(Screen *self, unsigned int count) {
void
screen_delete_characters(Screen *self, unsigned int count) {
// Delete characters, later characters are moved left
unsigned int top = self->margin_top, bottom = self->margin_bottom;
const unsigned int top = 0, bottom = self->lines - 1;
if (count == 0) count = 1;
if (top <= self->cursor->y && self->cursor->y <= bottom) {
unsigned int x = self->cursor->x;

View File

@ -142,6 +142,13 @@ class TestScreen(BaseTest):
self.ae(str(s.line(0)), 'ade')
self.assertTrue(s.line(0).cursor_from(4).bold)
self.assertFalse(s.line(0).cursor_from(2).bold)
s = self.create_screen()
s.set_margins(1, 2)
s.cursor.y = 3
s.draw('abcde')
s.cursor.x = 0
s.delete_characters(2)
self.ae('cde', str(s.line(s.cursor.y)))
init()
s.erase_characters(2)