From 41f761130e4fcbe415e206a92e3161248aa11152 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 29 Jul 2021 11:31:59 +0200 Subject: backport: fix(decorations): crash when :bdelete (extmark_free_all) after clear_namespace fixes #15212 --- src/nvim/extmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c index 2906a2196b..62ccf89484 100644 --- a/src/nvim/extmark.c +++ b/src/nvim/extmark.c @@ -268,7 +268,7 @@ bool extmark_clear(buf_T *buf, uint64_t ns_id, } ExtmarkNs *my_ns = all_ns ? buf_ns_ref(buf, item.ns_id, false) : ns; map_del(uint64_t, uint64_t)(my_ns->map, item.mark_id); - map_del(uint64_t, ExtmarkItem)(buf->b_extmark_index, mark.id); + map_del(uint64_t, ExtmarkItem)(buf->b_extmark_index, start_id); marktree_del_itr(buf->b_marktree, itr, false); } else { marktree_itr_next(buf->b_marktree, itr); -- cgit From 5c42376c15e23641b6e674345e26987a9fa7bac4 Mon Sep 17 00:00:00 2001 From: Sirisak Lueangsaksri Date: Tue, 3 Aug 2021 22:06:52 +0700 Subject: backport: fix(sign): reset auto sign column with minimum in float win minimal style --- src/nvim/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/window.c b/src/nvim/window.c index d051e8e467..5512eb39bd 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -676,7 +676,7 @@ void win_set_minimal_style(win_T *wp) } // signcolumn: use 'auto' - if (wp->w_p_scl[0] != 'a') { + if (wp->w_p_scl[0] != 'a' || STRLEN(wp->w_p_scl) == 8) { xfree(wp->w_p_scl); wp->w_p_scl = (char_u *)xstrdup("auto"); } -- cgit From d0e9a11e395a8b4004bdd92e4c7b0365e3800842 Mon Sep 17 00:00:00 2001 From: Sirisak Lueangsaksri Date: Sun, 8 Aug 2021 02:12:37 +0700 Subject: backport: refactor(sign): include longer sign column option --- src/nvim/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/window.c b/src/nvim/window.c index 5512eb39bd..4c965d3bd8 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -676,7 +676,7 @@ void win_set_minimal_style(win_T *wp) } // signcolumn: use 'auto' - if (wp->w_p_scl[0] != 'a' || STRLEN(wp->w_p_scl) == 8) { + if (wp->w_p_scl[0] != 'a' || STRLEN(wp->w_p_scl) >= 8) { xfree(wp->w_p_scl); wp->w_p_scl = (char_u *)xstrdup("auto"); } -- cgit From be58ba250ee253892ae5c80e89d9a372e89460dc Mon Sep 17 00:00:00 2001 From: gmntroll <37435952+gmntroll@users.noreply.github.com> Date: Mon, 16 Aug 2021 12:43:21 +0500 Subject: backport: fix(autocmd.c): fix conditions in block_autocmds, unblock_autocmds #15372 Logic got swapped in 7574918dc7b823c4a22eeb4949acfb9381446eab. We didn't notice it since v:termresponse isn't really used yet. #6279 --- src/nvim/autocmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim') diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 145f6f5601..bec9808183 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -1724,7 +1724,7 @@ BYPASS_AU: void block_autocmds(void) { // Remember the value of v:termresponse. - if (is_autocmd_blocked()) { + if (!is_autocmd_blocked()) { old_termresponse = get_vim_var_str(VV_TERMRESPONSE); } autocmd_blocked++; @@ -1737,7 +1737,7 @@ void unblock_autocmds(void) // When v:termresponse was set while autocommands were blocked, trigger // the autocommands now. Esp. useful when executing a shell command // during startup (nvim -d). - if (is_autocmd_blocked() + if (!is_autocmd_blocked() && get_vim_var_str(VV_TERMRESPONSE) != old_termresponse) { apply_autocmds(EVENT_TERMRESPONSE, NULL, NULL, false, curbuf); } -- cgit From 6bda2f56eb01b9a9ee3c0d25cb607d03dd64b91a Mon Sep 17 00:00:00 2001 From: notomo Date: Mon, 23 Aug 2021 07:27:20 +0900 Subject: backport: fix(window.c): win_close from other tabpage #15454 Fix #15313 --- src/nvim/window.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/window.c b/src/nvim/window.c index 4c965d3bd8..472a52e113 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -2702,7 +2702,11 @@ static win_T *win_free_mem( // When deleting the current window of another tab page select a new // current window. if (tp != NULL && win == tp->tp_curwin) { - tp->tp_curwin = wp; + if (win_valid(tp->tp_prevwin) && tp->tp_prevwin != win) { + tp->tp_curwin = tp->tp_prevwin; + } else { + tp->tp_curwin = tp->tp_firstwin; + } } return wp; -- cgit From 2132c063af3adf1d612359e0ed42c7cbd8b4290c Mon Sep 17 00:00:00 2001 From: andrew-pa Date: Thu, 10 Jun 2021 20:07:52 -0700 Subject: backport: fix(windowing): positioning of relative floats Fix relative floating windows so that they open in the correct position relative to each other. Also make sure that their positions are correct immediately after creation without a redraw. --- src/nvim/window.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/window.c b/src/nvim/window.c index 472a52e113..a64dee24a0 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -737,6 +737,37 @@ void win_config_float(win_T *wp, FloatConfig fconfig) redraw_later(wp, NOT_VALID); } + // compute initial position + if (wp->w_float_config.relative == kFloatRelativeWindow) { + int row = wp->w_float_config.row; + int col = wp->w_float_config.col; + Error dummy = ERROR_INIT; + win_T *parent = find_window_by_handle(wp->w_float_config.window, &dummy); + if (parent) { + row += parent->w_winrow; + col += parent->w_wincol; + ScreenGrid *grid = &parent->w_grid; + int row_off = 0, col_off = 0; + screen_adjust_grid(&grid, &row_off, &col_off); + row += row_off; + col += col_off; + } + api_clear_error(&dummy); + if (wp->w_float_config.bufpos.lnum >= 0) { + pos_T pos = { wp->w_float_config.bufpos.lnum + 1, + wp->w_float_config.bufpos.col, 0 }; + int trow, tcol, tcolc, tcole; + textpos2screenpos(wp, &pos, &trow, &tcol, &tcolc, &tcole, true); + row += trow - 1; + col += tcol - 1; + } + wp->w_winrow = row; + wp->w_wincol = col; + } else { + wp->w_winrow = fconfig.row; + wp->w_wincol = fconfig.col; + } + // changing border style while keeping border only requires redrawing border if (fconfig.border) { wp->w_redr_border = true; @@ -770,7 +801,6 @@ int win_fdccol_count(win_T *wp) } } - void ui_ext_win_position(win_T *wp) { if (!wp->w_floating) { @@ -817,6 +847,8 @@ void ui_ext_win_position(win_T *wp) int comp_row = (int)row - (south ? wp->w_height : 0); int comp_col = (int)col - (east ? wp->w_width : 0); + comp_row += grid->comp_row; + comp_col += grid->comp_col; comp_row = MAX(MIN(comp_row, Rows-wp->w_height_outer-1), 0); comp_col = MAX(MIN(comp_col, Columns-wp->w_width_outer), 0); wp->w_winrow = comp_row; -- cgit