diff options
Diffstat (limited to 'src/nvim/terminal.c')
-rw-r--r-- | src/nvim/terminal.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 0b0e321d8c..62a2d1b6e6 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -169,7 +169,7 @@ static VTermScreenCallbacks vterm_screen_callbacks = { .sb_popline = term_sb_pop, }; -static PMap(ptr_t) invalidated_terminals = MAP_INIT; +static Set(ptr_t) invalidated_terminals = SET_INIT; void terminal_init(void) { @@ -183,10 +183,10 @@ void terminal_teardown(void) time_watcher_stop(&refresh_timer); multiqueue_free(refresh_timer.events); time_watcher_close(&refresh_timer, NULL); - pmap_destroy(ptr_t)(&invalidated_terminals); + set_destroy(ptr_t, &invalidated_terminals); // terminal_destroy might be called after terminal_teardown is invoked // make sure it is in an empty, valid state - pmap_init(ptr_t, &invalidated_terminals); + invalidated_terminals = (Set(ptr_t)) SET_INIT; } static void term_output_callback(const char *s, size_t len, void *user_data) @@ -652,12 +652,12 @@ void terminal_destroy(Terminal **termpp) } if (!term->refcount) { - if (pmap_has(ptr_t)(&invalidated_terminals, term)) { + if (set_has(ptr_t, &invalidated_terminals, term)) { // flush any pending changes to the buffer block_autocmds(); refresh_terminal(term); unblock_autocmds(); - pmap_del(ptr_t)(&invalidated_terminals, term); + set_del(ptr_t, &invalidated_terminals, term); } for (size_t i = 0; i < term->sb_current; i++) { xfree(term->sb_buffer[i]); @@ -1027,7 +1027,7 @@ static int term_sb_push(int cols, const VTermScreenCell *cells, void *data) } memcpy(sbrow->cells, cells, sizeof(cells[0]) * c); - pmap_put(ptr_t)(&invalidated_terminals, term, NULL); + set_put(ptr_t, &invalidated_terminals, term); return 1; } @@ -1068,7 +1068,7 @@ static int term_sb_pop(int cols, VTermScreenCell *cells, void *data) } xfree(sbrow); - pmap_put(ptr_t)(&invalidated_terminals, term, NULL); + set_put(ptr_t, &invalidated_terminals, term); return 1; } @@ -1524,7 +1524,7 @@ static void invalidate_terminal(Terminal *term, int start_row, int end_row) term->invalid_end = MAX(term->invalid_end, end_row); } - pmap_put(ptr_t)(&invalidated_terminals, term, NULL); + set_put(ptr_t, &invalidated_terminals, term); if (!refresh_pending) { time_watcher_start(&refresh_timer, refresh_timer_cb, REFRESH_DELAY, 0); refresh_pending = true; @@ -1567,10 +1567,10 @@ static void refresh_timer_cb(TimeWatcher *watcher, void *data) void *stub; (void)(stub); // don't process autocommands while updating terminal buffers block_autocmds(); - map_foreach(&invalidated_terminals, term, stub, { + set_foreach(&invalidated_terminals, term, { refresh_terminal(term); }); - pmap_clear(ptr_t)(&invalidated_terminals); + set_clear(ptr_t, &invalidated_terminals); unblock_autocmds(); } |