comparison 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
comparison
equal deleted inserted replaced
34478:e22e9936cc9d 34479:2cf84e8dc58b
1574 call delete("Xother") 1574 call delete("Xother")
1575 endfunc 1575 endfunc
1576 1576
1577 " Fail vim.command if we try to change buffers while 'winfixbuf' is set 1577 " Fail vim.command if we try to change buffers while 'winfixbuf' is set
1578 func Test_lua_command() 1578 func Test_lua_command()
1579 CheckFeature lua
1579 call s:reset_all_buffers() 1580 call s:reset_all_buffers()
1580 1581
1581 enew 1582 enew
1582 file first 1583 file first
1583 let l:previous = bufnr() 1584 let l:previous = bufnr()
3127 3128
3128 call delete("first") 3129 call delete("first")
3129 call delete("middle") 3130 call delete("middle")
3130 call delete("last") 3131 call delete("last")
3131 endfunc 3132 endfunc
3133
3134 func Test_quickfix_switchbuf_invalid_prevwin()
3135 call s:reset_all_buffers()
3136
3137 let [l:first, _] = s:make_simple_quickfix()
3138 call assert_notequal(l:first, bufnr())
3139 call assert_equal(1, winnr('$'))
3140
3141 set switchbuf=uselast
3142 split
3143 copen
3144 execute winnr('#') 'quit'
3145
3146 call assert_fails('cfirst', 'E1513:')
3147 set switchbuf&
3148 endfunc
3149
3150 " vim: shiftwidth=2 sts=2 expandtab