aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2023-06-22 20:01:51 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-06-24 05:31:08 +0000
commitc15e75357a3823f264c798e87cf4d7fa802e4c92 (patch)
tree724e517070fd0573a99710f6d33ad148dc3dd4e6 /selection.c
parentsixel: resize(): handle no size change (diff)
sixel: ensure enough rows have been scrolled in, to fit the image
When emitting a sixel, we need to: a) scroll terminal content to ensure the new image fits b) position the text cursor Recent changes in the cursor positioning logic meant we reduced the number of linefeeds, to ensure 1) sixels could be printed to the bottom row without scrolling the terminal contents, and 2) the cursor was positioned on the last sixel row. Except, we’re not actually positioning the cursor on the last sixel row. We’re positioning it on the text row that maps to the *upper* pixel of the last sixel. In most cases, this _is_ the last row of the sixel. But for certain combinations of font and image sizes, it may be higher up. This patch fixes a regression, where the terminal contents weren’t scrolled up enough for certain images, causing a crash when trying to dirty a not-yet scrolled in row. The fix is this: * Always scroll by the number of rows occupied by the image, minus one. This ensures the image "fits". * Adjust the cursor position, if necessary.
Diffstat (limited to 'selection.c')
0 files changed, 0 insertions, 0 deletions