mirror of
https://github.com/neovim/neovim.git
synced 2026-08-28 10:01:49 +00:00
fix(eval): 0 should mean current tabpage in gettabvar() (#36891)
This matches the gettabvar() behavior change in Vim 8.1.1218.
(cherry picked from commit df9e4a037a)
This commit is contained in:
committed by
github-actions[bot]
parent
9acbf5102f
commit
7e99466a89
@@ -4374,6 +4374,10 @@ tabpage_T *find_tabpage(int n)
|
|||||||
tabpage_T *tp;
|
tabpage_T *tp;
|
||||||
int i = 1;
|
int i = 1;
|
||||||
|
|
||||||
|
if (n == 0) {
|
||||||
|
return curtab;
|
||||||
|
}
|
||||||
|
|
||||||
for (tp = first_tabpage; tp != NULL && i != n; tp = tp->tp_next) {
|
for (tp = first_tabpage; tp != NULL && i != n; tp = tp->tp_next) {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,6 +137,11 @@ describe('tabpage', function()
|
|||||||
eq(1, fn.nvim_tabpage_get_number(0))
|
eq(1, fn.nvim_tabpage_get_number(0))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('0 means current tabpage for gettabvar()', function()
|
||||||
|
command('let t:tabvar = 42')
|
||||||
|
eq(42, fn.gettabvar(0, 'tabvar'))
|
||||||
|
end)
|
||||||
|
|
||||||
it(':tabs does not overflow IObuff with long path with comma #20850', function()
|
it(':tabs does not overflow IObuff with long path with comma #20850', function()
|
||||||
api.nvim_buf_set_name(0, ('x'):rep(1024) .. ',' .. ('x'):rep(1024))
|
api.nvim_buf_set_name(0, ('x'):rep(1024) .. ',' .. ('x'):rep(1024))
|
||||||
command('tabs')
|
command('tabs')
|
||||||
|
|||||||
Reference in New Issue
Block a user