From ee57bb5a8e652d5821a5fdad9606a50c72ad23b8 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:00:04 -0500 Subject: [PATCH] fix(tui): reset active attr ID when OSC 8 sequence is terminated (#29960) When the cursor is moved we terminate any active OSC 8 sequences to prevent the sequence from inadvertently spanning regions it is not meant to span. However, if we do not also reset the TUI's active attr id (print_attr_id) then the TUI does not "know" that it's current attribute set has changed. When cursor_goto is called to wrap a line, the TUI does not recompute the attributes so the OSC 8 sequence is not restarted again. When we terminate an OSC 8 sequence before moving the cursor, also reset the active attr id so that the attributes are recomputed for URLs. (cherry picked from commit f32557ca679cbb1d7de52ab54dc35585af9ab9d0) --- src/nvim/tui/tui.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index b6fc4a496d..7a02bfca57 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -876,6 +876,7 @@ static void cursor_goto(TUIData *tui, int row, int col) if (tui->url >= 0) { out(tui, S_LEN("\x1b]8;;\x1b\\")); tui->url = -1; + tui->print_attr_id = -1; } if (0 == row && 0 == col) {