neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit df9e4a037ad6d63e636f09990f0a469429c6dc55
parent bc0635a9fc9c15a2423d4eb35f627d127d00fa46
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Wed, 10 Dec 2025 08:53:57 +0800

fix(eval): 0 should mean current tabpage in gettabvar() (#36891)

This matches the gettabvar() behavior change in Vim 8.1.1218.
Diffstat:
Msrc/nvim/window.c | 4++++
Mtest/functional/editor/tabpage_spec.lua | 5+++++
2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/nvim/window.c b/src/nvim/window.c @@ -4442,6 +4442,10 @@ tabpage_T *find_tabpage(int n) tabpage_T *tp; int i = 1; + if (n == 0) { + return curtab; + } + for (tp = first_tabpage; tp != NULL && i != n; tp = tp->tp_next) { i++; } diff --git a/test/functional/editor/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua @@ -137,6 +137,11 @@ describe('tabpage', function() eq(1, fn.nvim_tabpage_get_number(0)) 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() api.nvim_buf_set_name(0, ('x'):rep(1024) .. ',' .. ('x'):rep(1024)) command('tabs')