diff src/testdir/test_winfixbuf.vim @ 34479:2cf84e8dc58b v9.1.0149

patch 9.1.0149: null pointer member access when accessing 'winfixbuf' property Commit: https://github.com/vim/vim/commit/5131f224da93f2e042a4b22545ef62b1b2ab8460 Author: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Mon Mar 4 19:09:26 2024 +0100 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: #14140 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 04 Mar 2024 19:15:04 +0100
parents dd8f5311cee5
children 157cf882799f
line wrap: on
line diff
--- a/src/testdir/test_winfixbuf.vim
+++ b/src/testdir/test_winfixbuf.vim
@@ -1576,6 +1576,7 @@ endfunc
 
 " Fail vim.command 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