aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-23 15:57:07 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-23 15:57:07 +0000
commitf5a6304850fd7344f72355416cfbfd69b76482c4 (patch)
tree358ae1680be93f61d57b4aa4f8283acbba23e36b /terminal.c
parentgrid: swap rows doesn't mark rows as dirty (diff)
term: make sure to update 'current row' when restoring saved cursor
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index 84bfcc31..871e6dcb 100644
--- a/terminal.c
+++ b/terminal.c
@@ -268,6 +268,14 @@ term_reverse_index(struct terminal *term)
}
void
+term_restore_cursor(struct terminal *term)
+{
+ int row = min(term->saved_cursor.row, term->rows - 1);
+ int col = min(term->saved_cursor.col, term->cols - 1);
+ term_cursor_to(term, row, col);
+}
+
+void
term_focus_in(struct terminal *term)
{
if (!term->focus_events)