diff options
author | Alvaro <alvaro@chainalysis.com> | 2024-05-18 02:08:25 +0200 |
---|---|---|
committer | Alvaro <alvaro@chainalysis.com> | 2024-05-18 02:08:25 +0200 |
commit | 8a44866207c1411f65ee08440114f721f01f1a72 (patch) | |
tree | 4412066e57ca2b01189cf2ce732b6f8bacf75477 /lua | |
parent | 51c731363bc1c8a30d9b5a315841609fbd15b664 (diff) | |
download | minitab.nvim-8a44866207c1411f65ee08440114f721f01f1a72.tar.xz minitab.nvim-8a44866207c1411f65ee08440114f721f01f1a72.zip |
refactor window count
Diffstat (limited to 'lua')
-rw-r--r-- | lua/luatab/init.lua | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lua/luatab/init.lua b/lua/luatab/init.lua index e4967f4..0d4a86d 100644 --- a/lua/luatab/init.lua +++ b/lua/luatab/init.lua @@ -34,11 +34,7 @@ M.modified = function(bufnr) end M.windowCount = function(index) - local nwins = 0 - local success, wins = pcall(vim.api.nvim_tabpage_list_wins, index) - if success then - for _ in pairs(wins) do nwins = nwins + 1 end - end + local nwins = vim.fn.tabpagewinnr(index, '$') return nwins > 1 and '(' .. nwins .. ') ' or '' end |