File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ local Class = require("nvim-tree.classic")
2020--- @field private padding integer
2121-- TODO multi-instance remove or replace with single member
2222--- @field private bufnr_by_tabid table<integer , integer>
23- -- TODO multi-instance change to single member
24- --- @field private cursors_by_tabid table<integer , integer[]> as per vim.api.nvim_win_get_cursor
2523local View = Class :extend ()
2624
2725--- @class View
@@ -40,7 +38,6 @@ function View:new(args)
4038 self .side = (self .explorer .opts .view .side == " right" ) and " right" or " left"
4139 self .live_filter = { prev_focused_node = nil , }
4240 self .bufnr_by_tabid = {}
43- self .cursors_by_tabid = {}
4441
4542 self .winopts = {
4643 relativenumber = self .explorer .opts .view .relativenumber ,
244241--- @param tabid integer
245242function View :save_state (tabid )
246243 tabid = tabid or vim .api .nvim_get_current_tabpage ()
247- self . cursors_by_tabid [tabid ] = vim .api .nvim_win_get_cursor (self :get_winid (tabid ) or 0 )
244+ globals . CURSORS [tabid ] = vim .api .nvim_win_get_cursor (self :get_winid (tabid ) or 0 )
248245end
249246
250247--- @private
528525
529526--- restore any state from last close
530527function View :restore_state ()
531- self :set_cursor (self . cursors_by_tabid [vim .api .nvim_get_current_tabpage ()])
528+ self :set_cursor (globals . CURSORS [vim .api .nvim_get_current_tabpage ()])
532529end
533530
534531--- winid containing the buffer
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ local M = {
44 -- from View
55 WINID_BY_TABID = {},
66 BUFNR_BY_TABID = {},
7+ CURSORS = {},
78}
89
910return M
You can’t perform that action at this time.
0 commit comments