From 16f712fbaa521a84b498db71e701114d3559d852 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 9 Sep 2018 13:51:15 +0530 Subject: [PATCH] Revert the wide-character backspace patch Fixes #875 --- docs/changelog.rst | 3 +++ kitty/screen.c | 10 +--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 64427462e..dcd7ba0ac 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -26,6 +26,9 @@ Changelog - Have the :option:`kitty --title` flag apply to all windows created using :option:`kitty --session` (:iss:`921`) +- Revert change for backspacing of wide characters in the previous release, + as it breaks backspacing in some wide-character aware programs (:iss:`875`) + 0.12.1 [2018-09-08] ------------------------------ diff --git a/kitty/screen.c b/kitty/screen.c index 872eed784..0000f5e36 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -708,15 +708,7 @@ screen_is_cursor_visible(Screen *self) { void screen_backspace(Screen *self) { - unsigned int amount = 1; - if (self->cursor->x < self->columns && self->cursor->x > 1) { - // check if previous character is a wide character - linebuf_init_line(self->linebuf, self->cursor->y); - unsigned int xpos = self->cursor->x - 2; - GPUCell *gpu_cell = self->linebuf->line->gpu_cells + xpos; - if ((gpu_cell->attrs & WIDTH_MASK) == 2) amount = 2; - } - screen_cursor_back(self, amount, -1); + screen_cursor_back(self, 1, -1); } void