url-mode: tag cells after snapshot:ing the grid

Before this patch, hyperlinked cells were tagged with the “URL”
attribute (thus instructing the renderer to draw an
underline) *before* the grid was snapshot.

When exiting URL mode, the cells were once again updated, this time
removing the URL attribute.

But what if an escape sequence had modified the grid _while we were in
URL mode_? Depending on the sequence, it could move cells around in
such a way, that when exiting URL mode, the affected cells weren’t
updated correctly. I.e. we left some cells with the URL attribute
still set.

The fix is simple: tag cells in the snapshot:ed grid only (which isn’t
affected by any escape sequence received while in URL mode). Not in
the *actual* grid (which _is_ affected).
This commit is contained in:
Daniel Eklöf 2022-11-30 10:51:45 +01:00
parent 1b24cf4fcb
commit 76d494484f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 18 additions and 15 deletions

View file

@ -103,6 +103,7 @@
* Scaling factor not being correctly applied when converting pt-or-px
config values (e.g. letter offsets, line height etc).
* Selection being stuck visually when `IL` and `DL`.`
* URL underlines sometimes still being visible after exiting URL mode.
[1173]: https://codeberg.org/dnkl/foot/issues/1173
[1190]: https://codeberg.org/dnkl/foot/issues/1190