mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
selection: handle viewport wrap around correctly
When the viewport wraps around, the selection points may be "incorrect".
This commit is contained in:
parent
550667a9ea
commit
08588cd0fc
5 changed files with 64 additions and 49 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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue