+18
-1
lines changedFilter options
+18
-1
lines changed Original file line number Diff line number Diff line change
@@ -6839,7 +6839,7 @@ void tabpage_close_other(tabpage_T *tp, int forceit)
6839
6839
6840
6840
// Autocommands may delete the tab page under our fingers and we may
6841
6841
// fail to close a window with a modified buffer.
6842
-
if (!valid_tabpage(tp) || tp->tp_firstwin == wp) {
6842
+
if (!valid_tabpage(tp) || tp->tp_lastwin == wp) {
6843
6843
break;
6844
6844
}
6845
6845
}
Original file line number Diff line number Diff line change
@@ -3,8 +3,10 @@ local helpers = require('test.functional.helpers')(after_each)
3
3
local clear = helpers.clear
4
4
local command = helpers.command
5
5
local eq = helpers.eq
6
+
local neq = helpers.neq
6
7
local feed = helpers.feed
7
8
local eval = helpers.eval
9
+
local exec = helpers.exec
8
10
9
11
describe('tabpage', function()
10
12
before_each(clear)
@@ -34,5 +36,20 @@ describe('tabpage', function()
34
36
35
37
eq(3, eval('tabpagenr()'))
36
38
end)
39
+
40
+
it('does not crash or loop 999 times if BufWipeout autocommand switches window #17868', function()
41
+
exec([[
42
+
tabedit
43
+
let s:window_id = win_getid()
44
+
botright new
45
+
setlocal bufhidden=wipe
46
+
let g:win_closed = 0
47
+
autocmd WinClosed * let g:win_closed += 1
48
+
autocmd BufWipeout <buffer> call win_gotoid(s:window_id)
49
+
tabprevious
50
+
+tabclose
51
+
]])
52
+
neq(999, eval('g:win_closed'))
53
+
end)
37
54
end)
38
55
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4