mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-08 10:06:22 -05:00
grid: reflow: fix cursor reflow when LCF is set
When the cursor is at the end of the line, with a pending wrap (LCF set), the lcf flag should be cleared *and* the cursor moved one cell to the right. Before this patch, we cleared LCF, but didn't move the cursor. Closes #1954
This commit is contained in:
parent
888a6770da
commit
d7a4f9e99e
2 changed files with 17 additions and 3 deletions
|
|
@ -110,10 +110,13 @@
|
|||
* Combining characters (including emojis consisting of multiple
|
||||
codepoints) not being handled correctly when _insert mode_ is
|
||||
enabled ([#1947][1947]).
|
||||
* Reflow of the cursor (active + saved) when at the end of the line
|
||||
with a pending wrap (LCF set) ([#1954][1954]).
|
||||
|
||||
[1918]: https://codeberg.org/dnkl/foot/issues/1918
|
||||
[1929]: https://codeberg.org/dnkl/foot/issues/1929
|
||||
[1947]: https://codeberg.org/dnkl/foot/issues/1947
|
||||
[1954]: https://codeberg.org/dnkl/foot/issues/1954
|
||||
|
||||
|
||||
### Security
|
||||
|
|
|
|||
17
grid.c
17
grid.c
|
|
@ -1211,15 +1211,26 @@ grid_resize_and_reflow(
|
|||
saved_cursor.row = min(saved_cursor.row, new_screen_rows - 1);
|
||||
saved_cursor.col = min(saved_cursor.col, new_cols - 1);
|
||||
|
||||
if (grid->cursor.lcf) {
|
||||
if (cursor.col + 1 < new_cols) {
|
||||
cursor.col++;
|
||||
grid->cursor.lcf = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (grid->saved_cursor.lcf) {
|
||||
if (saved_cursor.col + 1 < new_cols) {
|
||||
saved_cursor.col++;
|
||||
grid->saved_cursor.lcf = false;
|
||||
}
|
||||
}
|
||||
|
||||
grid->cur_row = new_grid[(grid->offset + cursor.row) & (new_rows - 1)];
|
||||
xassert(grid->cur_row != NULL);
|
||||
|
||||
grid->cursor.point = cursor;
|
||||
grid->saved_cursor.point = saved_cursor;
|
||||
|
||||
grid->cursor.lcf = false;
|
||||
grid->saved_cursor.lcf = false;
|
||||
|
||||
/* Free sixels we failed to "map" to the new grid */
|
||||
tll_foreach(untranslated_sixels, it)
|
||||
sixel_destroy(&it->item);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue