diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-28 17:52:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-28 17:52:06 +0800 |
commit | 67596c42eb379d6d9fec78bd8c7c347cfdfbda8c (patch) | |
tree | fad7ba0cfabb0989a466c091df4ad35309fdeece | |
parent | 2dea0ea82001d7c3f1256dfcec25cc10c17d45e5 (diff) | |
download | rneovim-67596c42eb379d6d9fec78bd8c7c347cfdfbda8c.tar.gz rneovim-67596c42eb379d6d9fec78bd8c7c347cfdfbda8c.tar.bz2 rneovim-67596c42eb379d6d9fec78bd8c7c347cfdfbda8c.zip |
vim-patch:9.1.0216: Error on exit with EXITFREE and 'winfixbuf' (#28070)
Problem: Error on exit with EXITFREE and 'winfixbuf'.
Solution: Handle DT_FREE before checking for 'winfixbuf'.
(zeertzjq)
closes: vim/vim#14314
https://github.com/vim/vim/commit/620e85265ce04654053c64f8058914ecafe4eb38
-rw-r--r-- | src/nvim/tag.c | 18 | ||||
-rw-r--r-- | test/old/testdir/test_winfixbuf.vim | 12 |
2 files changed, 21 insertions, 9 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 0265d2d822..7e94a8b124 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -290,10 +290,6 @@ void set_buflocal_tfu_callback(buf_T *buf) /// @param verbose print "tag not found" message void do_tag(char *tag, int type, int count, int forceit, bool verbose) { - if (postponed_split == 0 && !check_can_set_curbuf_forceit(forceit)) { - return; - } - taggy_T *tagstack = curwin->w_tagstack; int tagstackidx = curwin->w_tagstackidx; int tagstacklen = curwin->w_tagstacklen; @@ -320,11 +316,6 @@ void do_tag(char *tag, int type, int count, int forceit, bool verbose) static char **matches = NULL; static int flags; - if (tfu_in_use) { - emsg(_(e_cannot_modify_tag_stack_within_tagfunc)); - return; - } - #ifdef EXITFREE if (type == DT_FREE) { // remove the list of matches @@ -334,6 +325,15 @@ void do_tag(char *tag, int type, int count, int forceit, bool verbose) } #endif + if (tfu_in_use) { + emsg(_(e_cannot_modify_tag_stack_within_tagfunc)); + return; + } + + if (postponed_split == 0 && !check_can_set_curbuf_forceit(forceit)) { + return; + } + if (type == DT_HELP) { type = DT_TAG; no_regexp = true; diff --git a/test/old/testdir/test_winfixbuf.vim b/test/old/testdir/test_winfixbuf.vim index 3fcc5fa5eb..663e7c829a 100644 --- a/test/old/testdir/test_winfixbuf.vim +++ b/test/old/testdir/test_winfixbuf.vim @@ -1,6 +1,7 @@ " Test 'winfixbuf' source check.vim +source shared.vim " Find the number of open windows in the current tab func s:get_windows_count() @@ -3427,4 +3428,15 @@ func Test_bufdo_cnext_splitwin_fails() set winminheight&vim winheight&vim endfunc +" Test that exiting with 'winfixbuf' and EXITFREE doesn't cause an error. +func Test_exitfree_no_error() + let lines =<< trim END + set winfixbuf + qall! + END + call writefile(lines, 'Xwfb_exitfree', 'D') + call assert_notmatch('E1513:', + \ system(GetVimCommandClean() .. ' -X -S Xwfb_exitfree')) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |