From b934969b858d8874e480cc9ee7f4ccf5657f6f2a Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 13 Feb 2021 13:44:07 +0100 Subject: term: add ‘id’ parameter to term_osc8_open() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current OSC-8 URL’s ID is now tracked along with the URI itself, and its starting point. --- terminal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index c6afbef1..218882f0 100644 --- a/terminal.c +++ b/terminal.c @@ -3016,7 +3016,7 @@ term_ime_set_cursor_rect(struct terminal *term, int x, int y, int width, } void -term_osc8_open(struct terminal *term, const char *uri) +term_osc8_open(struct terminal *term, uint64_t id, const char *uri) { if (unlikely(term->vt.osc8.begin.row < 0)) { /* It’s valid to switch from one URI to another without @@ -3028,6 +3028,7 @@ term_osc8_open(struct terminal *term, const char *uri) .col = term->grid->cursor.point.col, .row = grid_row_absolute(term->grid, term->grid->cursor.point.row), }; + term->vt.osc8.id = id; term->vt.osc8.uri = xstrdup(uri); } @@ -3066,6 +3067,7 @@ term_osc8_close(struct terminal *term) done: free(term->vt.osc8.uri); + term->vt.osc8.id = 0; term->vt.osc8.uri = NULL; term->vt.osc8.begin = (struct coord){-1, -1}; } -- cgit v1.3