diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-05-19 16:49:42 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-05-19 16:49:42 +0000 |
| commit | 08588cd0fc25128a8ec013d65ca15d8e66d28e99 (patch) | |
| tree | 9d112ef453d34dfd717b19f6ce09b06e1c54ad6c /commands.c | |
| parent | term: scrolling: calling function must clamp scroll amount (diff) | |
selection: handle viewport wrap around correctly
When the viewport wraps around, the selection points may be
"incorrect".
Diffstat (limited to 'commands.c')
| -rw-r--r-- | commands.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -3,9 +3,10 @@ #define LOG_MODULE "commands" #define LOG_ENABLE_DBG 0 #include "log.h" -#include "terminal.h" -#include "render.h" #include "grid.h" +#include "render.h" +#include "selection.h" +#include "terminal.h" #include "util.h" void @@ -73,6 +74,7 @@ cmd_scrollback_up(struct terminal *term, int rows) else diff = (term->grid->num_rows - new_view) + term->grid->view; + selection_view_up(term, new_view); term->grid->view = new_view; if (diff >= 0 && diff < term->rows) { @@ -146,6 +148,7 @@ cmd_scrollback_down(struct terminal *term, int rows) else diff = (term->grid->num_rows - term->grid->view) + new_view; + selection_view_down(term, new_view); term->grid->view = new_view; if (diff >= 0 && diff < term->rows) { |
