diff options
author | Jędrzej Boczar <yendreij@gmail.com> | 2023-09-19 14:15:53 +0200 |
---|---|---|
committer | Jędrzej Boczar <yendreij@gmail.com> | 2023-09-19 14:35:03 +0200 |
commit | 592bc831ce4b70294a1348fe29396d8cd524b3ed (patch) | |
tree | e2339ddc8d83a19c8508fe97d59cb36292dad564 | |
parent | c5abf487f19e45fe96a001b28b9e7981f43eed7d (diff) | |
download | rneovim-592bc831ce4b70294a1348fe29396d8cd524b3ed.tar.gz rneovim-592bc831ce4b70294a1348fe29396d8cd524b3ed.tar.bz2 rneovim-592bc831ce4b70294a1348fe29396d8cd524b3ed.zip |
fix: avoid ui_grid_cursor_goto when drawing window separators
-rw-r--r-- | src/nvim/drawscreen.c | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index e3e9fc8170..681a5e2a02 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -1358,21 +1358,35 @@ static void draw_sep_connectors_win(win_T *wp) win_at_left = frp->fr_parent == NULL; // Draw the appropriate separator connector in every corner where drawing them is necessary - if (!(win_at_top || win_at_left)) { - grid_putchar(&default_grid, get_corner_sep_connector(wp, WC_TOP_LEFT), - wp->w_winrow - 1, wp->w_wincol - 1, hl); - } - if (!(win_at_top || win_at_right)) { - grid_putchar(&default_grid, get_corner_sep_connector(wp, WC_TOP_RIGHT), - wp->w_winrow - 1, W_ENDCOL(wp), hl); - } - if (!(win_at_bottom || win_at_left)) { - grid_putchar(&default_grid, get_corner_sep_connector(wp, WC_BOTTOM_LEFT), - W_ENDROW(wp), wp->w_wincol - 1, hl); + // Make sure not to send cursor position updates to ui. + bool top_left = !(win_at_top || win_at_left); + bool top_right = !(win_at_top || win_at_right); + bool bot_left = !(win_at_bottom || win_at_left); + bool bot_right = !(win_at_bottom || win_at_right); + + if (top_left || top_right) { + grid_puts_line_start(&default_grid, wp->w_winrow - 1); + if (top_left) { + grid_putchar(&default_grid, get_corner_sep_connector(wp, WC_TOP_LEFT), + wp->w_winrow - 1, wp->w_wincol - 1, hl); + } + if (top_right) { + grid_putchar(&default_grid, get_corner_sep_connector(wp, WC_TOP_RIGHT), + wp->w_winrow - 1, W_ENDCOL(wp), hl); + } + grid_puts_line_flush(false); } - if (!(win_at_bottom || win_at_right)) { - grid_putchar(&default_grid, get_corner_sep_connector(wp, WC_BOTTOM_RIGHT), - W_ENDROW(wp), W_ENDCOL(wp), hl); + if (bot_left || bot_right) { + grid_puts_line_start(&default_grid, W_ENDROW(wp)); + if (bot_left) { + grid_putchar(&default_grid, get_corner_sep_connector(wp, WC_BOTTOM_LEFT), + W_ENDROW(wp), wp->w_wincol - 1, hl); + } + if (bot_right) { + grid_putchar(&default_grid, get_corner_sep_connector(wp, WC_BOTTOM_RIGHT), + W_ENDROW(wp), W_ENDCOL(wp), hl); + } + grid_puts_line_flush(false); } } |