From 9816979169b575fb604a1747b3bdf03ab7c0aa3e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 12 Nov 2020 11:44:09 +0530 Subject: [PATCH] Don't restrict the DCH control code to only the current scroll region Matches behavior of other terminal emulators. Fixes #3090 --- docs/changelog.rst | 2 ++ kitty/screen.c | 2 +- kitty_tests/screen.py | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index c31a0b931..3a2d3fff4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -44,6 +44,8 @@ To update |kitty|, :doc:`follow the instructions `. - 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] ------------------- diff --git a/kitty/screen.c b/kitty/screen.c index 11f01fc12..39643232b 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -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; diff --git a/kitty_tests/screen.py b/kitty_tests/screen.py index f0327b610..5d913394a 100644 --- a/kitty_tests/screen.py +++ b/kitty_tests/screen.py @@ -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)