terminal: Update terminal->end whenever we write a character
We used to only update it on newline, which breaks when somebody moves the cursor below terminal->end and writes stuff. Instead update it whenever we write a character to the terminal. https://bugs.freedesktop.org/show_bug.cgi?id=71935
This commit is contained in:
+7
-7
@@ -1855,13 +1855,6 @@ handle_special_char(struct terminal *terminal, char c)
|
|||||||
case '\v':
|
case '\v':
|
||||||
case '\f':
|
case '\f':
|
||||||
terminal->row++;
|
terminal->row++;
|
||||||
if (terminal->row + terminal->start > terminal->end)
|
|
||||||
terminal->end = terminal->row + terminal->start;
|
|
||||||
if (terminal->end == terminal->buffer_height)
|
|
||||||
terminal->log_size = terminal->buffer_height;
|
|
||||||
else if (terminal->log_size < terminal->buffer_height)
|
|
||||||
terminal->log_size = terminal->end;
|
|
||||||
|
|
||||||
if (terminal->row > terminal->margin_bottom) {
|
if (terminal->row > terminal->margin_bottom) {
|
||||||
terminal->row = terminal->margin_bottom;
|
terminal->row = terminal->margin_bottom;
|
||||||
terminal_scroll(terminal, +1);
|
terminal_scroll(terminal, +1);
|
||||||
@@ -1965,6 +1958,13 @@ handle_char(struct terminal *terminal, union utf8_char utf8)
|
|||||||
row[terminal->column] = utf8;
|
row[terminal->column] = utf8;
|
||||||
attr_row[terminal->column++] = terminal->curr_attr;
|
attr_row[terminal->column++] = terminal->curr_attr;
|
||||||
|
|
||||||
|
if (terminal->row + terminal->start + 1 > terminal->end)
|
||||||
|
terminal->end = terminal->row + terminal->start + 1;
|
||||||
|
if (terminal->end == terminal->buffer_height)
|
||||||
|
terminal->log_size = terminal->buffer_height;
|
||||||
|
else if (terminal->log_size < terminal->buffer_height)
|
||||||
|
terminal->log_size = terminal->end;
|
||||||
|
|
||||||
/* cursor jump for wide character. */
|
/* cursor jump for wide character. */
|
||||||
if (is_wide(utf8))
|
if (is_wide(utf8))
|
||||||
row[terminal->column++].ch = 0x200B; /* space glyph */
|
row[terminal->column++].ch = 0x200B; /* space glyph */
|
||||||
|
|||||||
Reference in New Issue
Block a user