mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-10 04:27:45 -05:00
term: osc8: tag *all* cells in a multi-column character as an URI
When we print a character to the grid, we must also update its OSC-8 state if an OSC-8 URI is currently active. For double-width characters, this was only being done for the first cell. This causes the labels in URL mode to be off, as the link was effectively chopped up into multiple pieces. Closes #2179
This commit is contained in:
parent
1dfa86c93a
commit
80951ab7a6
2 changed files with 12 additions and 3 deletions
|
|
@ -72,6 +72,13 @@
|
|||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
|
||||
* URL labels misplaces when URL contains double-width characters
|
||||
([#2179][2179]).
|
||||
|
||||
[2179]: https://codeberg.org/dnkl/foot/issues/2179
|
||||
|
||||
|
||||
### Security
|
||||
### Contributors
|
||||
|
||||
|
|
|
|||
|
|
@ -4005,9 +4005,11 @@ term_print(struct terminal *term, char32_t wc, int width, bool insert_mode_disab
|
|||
cell->wc = term->vt.last_printed = wc;
|
||||
cell->attrs = term->vt.attrs;
|
||||
|
||||
if (term->vt.osc8.uri != NULL) {
|
||||
grid_row_uri_range_put(
|
||||
row, col, term->vt.osc8.uri, term->vt.osc8.id);
|
||||
if (unlikely(term->vt.osc8.uri != NULL)) {
|
||||
for (int i = 0; i < width && (col + i) < term->cols; i++) {
|
||||
grid_row_uri_range_put(
|
||||
row, col + i, term->vt.osc8.uri, term->vt.osc8.id);
|
||||
}
|
||||
|
||||
switch (term->conf->url.osc8_underline) {
|
||||
case OSC8_UNDERLINE_ALWAYS:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue