mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
term: scrolling: clamp number of rows to number of rows in scrolling region
This commit is contained in:
parent
57e04a1320
commit
a4f5938123
2 changed files with 6 additions and 13 deletions
|
|
@ -23,6 +23,8 @@
|
||||||
* Copy to clipboard/primary selection to insert a line break if either
|
* Copy to clipboard/primary selection to insert a line break if either
|
||||||
the last cell on the previous line or the first cell on the next
|
the last cell on the previous line or the first cell on the next
|
||||||
line is empty.
|
line is empty.
|
||||||
|
* Number of lines to scroll is now always clamped to the number of
|
||||||
|
lines in the scrolling region..
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
### Removed
|
### Removed
|
||||||
|
|
@ -35,7 +37,6 @@
|
||||||
released.
|
released.
|
||||||
* Selected cells did not appear selected if modified.
|
* Selected cells did not appear selected if modified.
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
16
terminal.c
16
terminal.c
|
|
@ -1728,12 +1728,8 @@ term_scroll_partial(struct terminal *term, struct scroll_region region, int rows
|
||||||
LOG_DBG("scroll: rows=%d, region.start=%d, region.end=%d",
|
LOG_DBG("scroll: rows=%d, region.start=%d, region.end=%d",
|
||||||
rows, region.start, region.end);
|
rows, region.start, region.end);
|
||||||
|
|
||||||
#if 0
|
/* Clamp scroll amount */
|
||||||
if (rows > region.end - region.start) {
|
rows = min(rows, region.end - region.start);
|
||||||
/* For now, clamp */
|
|
||||||
rows = region.end - region.start;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const int begin_scrolled_in = max(region.end - rows, region.start);
|
const int begin_scrolled_in = max(region.end - rows, region.start);
|
||||||
const int end_scrolled_in = region.end;
|
const int end_scrolled_in = region.end;
|
||||||
|
|
@ -1778,12 +1774,8 @@ term_scroll_reverse_partial(struct terminal *term,
|
||||||
LOG_DBG("scroll reverse: rows=%d, region.start=%d, region.end=%d",
|
LOG_DBG("scroll reverse: rows=%d, region.start=%d, region.end=%d",
|
||||||
rows, region.start, region.end);
|
rows, region.start, region.end);
|
||||||
|
|
||||||
#if 0
|
/* Clamp scroll amount */
|
||||||
if (rows > region.end - region.start) {
|
rows = min(rows, region.end - region.start);
|
||||||
/* For now, clamp */
|
|
||||||
rows = region.end - region.start;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Row numbers of "new" lines scrolled in */
|
/* Row numbers of "new" lines scrolled in */
|
||||||
const int start_scrolled_in = region.start;
|
const int start_scrolled_in = region.start;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue