aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-04-26 17:32:08 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-04-26 17:32:08 +0000
commitc82c6116ede2706a9d5b28d43e8271ec13be2794 (patch)
treed8eb946aa28e973011e0744f51977d26e26712d8 /server.c
parentchangelog: typo: space on the wrong side of the parenthesis (diff)
search: regression: crash when moving viewport
5c4ddebc3c57724bd89b959a33f5ad0bd97f482b refactored search_update_selection(), specifically, the logic that moves the viewport. It did so by converting the absolute row number (of the match) to scrollback relative coordinates. This way we could ensure the viewport wasn’t moved “too much” (e.g. beyond the scrollback start). However, grid_row_abs_to_sb() and grid_row_sb_to_abs() doesn’t take a partially filled scrollback into account. This means the row (numbers) it returns may refer to *uninitialized* rows. Since: * The match row itself is valid (we *know* it has text on it) * We *subtract* from it, when setting the new viewport (to center the match on the screen). it’s only the *upper* part of the new viewport that may be uninitialized. I.e. we may have adjusted it too much. So, what we need to do is move the viewport forward until its *first* row is initialized. Then we know the rest will be too.
Diffstat (limited to 'server.c')
0 files changed, 0 insertions, 0 deletions