aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorColin Kennedy <colinvfx@gmail.com>2024-03-04 21:25:15 -0800
committerzeertzjq <zeertzjq@outlook.com>2024-03-11 11:38:15 +0800
commite8bc23db62c37e91d0c277b4bddf652db6a9d5f1 (patch)
tree0b7909c3f67c1b480402919a3923dadfe5f712dd /test
parent141182d6c6c06ad56413b81a518ba9b777a0cbe0 (diff)
downloadrneovim-e8bc23db62c37e91d0c277b4bddf652db6a9d5f1.tar.gz
rneovim-e8bc23db62c37e91d0c277b4bddf652db6a9d5f1.tar.bz2
rneovim-e8bc23db62c37e91d0c277b4bddf652db6a9d5f1.zip
vim-patch:9.1.0149: null pointer member access when accessing 'winfixbuf' property
Problem: qf_goto_win_with_qfl_file may check if prevwin has 'winfixbuf' set without checking if it's valid first. Solution: Reverse the condition. Add a test, a modeline, and a missing CheckFeature. (Searn Dewar) closes: vim/vim#14140 https://github.com/vim/vim/commit/5131f224da93f2e042a4b22545ef62b1b2ab8460 Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_winfixbuf.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/old/testdir/test_winfixbuf.vim b/test/old/testdir/test_winfixbuf.vim
index 2948be7859..5412fecd07 100644
--- a/test/old/testdir/test_winfixbuf.vim
+++ b/test/old/testdir/test_winfixbuf.vim
@@ -1576,6 +1576,7 @@ endfunc
" Fail vim.cmd if we try to change buffers while 'winfixbuf' is set
func Test_lua_command()
+ " CheckFeature lua
call s:reset_all_buffers()
enew
@@ -3129,3 +3130,21 @@ func Test_wprevious()
call delete("middle")
call delete("last")
endfunc
+
+func Test_quickfix_switchbuf_invalid_prevwin()
+ call s:reset_all_buffers()
+
+ let [l:first, _] = s:make_simple_quickfix()
+ call assert_notequal(l:first, bufnr())
+ call assert_equal(1, winnr('$'))
+
+ set switchbuf=uselast
+ split
+ copen
+ execute winnr('#') 'quit'
+
+ call assert_fails('cfirst', 'E1513:')
+ set switchbuf&
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab