mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
csi: ignore invalid scrolling regions
There must be at least one scrolling row. I.e. the bottom margin must be larger than the top margin. Note that trying to set an invalid region really will be *ignored*. I.e. we *don't* reset the scrolling region. This conforms to xterm's behavior.
This commit is contained in:
parent
5a0bb292ee
commit
4594899114
1 changed files with 10 additions and 7 deletions
17
csi.c
17
csi.c
|
|
@ -617,15 +617,18 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
int start = vt_param_get(term, 0, 1);
|
||||
int end = min(vt_param_get(term, 1, term->rows), term->rows);
|
||||
|
||||
/* 1-based */
|
||||
term->scroll_region.start = start - 1;
|
||||
term->scroll_region.end = end;
|
||||
if (end > start) {
|
||||
|
||||
term_cursor_to(term, start - 1, 0);
|
||||
/* 1-based */
|
||||
term->scroll_region.start = start - 1;
|
||||
term->scroll_region.end = end;
|
||||
|
||||
LOG_DBG("scroll region: %d-%d",
|
||||
term->scroll_region.start,
|
||||
term->scroll_region.end);
|
||||
term_cursor_to(term, start - 1, 0);
|
||||
|
||||
LOG_DBG("scroll region: %d-%d",
|
||||
term->scroll_region.start,
|
||||
term->scroll_region.end);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue