refactor(#2826): remove view debug/cc, enable new codepaths for get_winid and get_bufnr (#3169)

* refactor(#2826): fuller error messages

* refactor(#2826): winnr->winid in view/globals, remove redundant get_winid and get_bufnr calls

* refactor(#2826): winnr->winid consistently

* refactor(#2826): consistent use of buffer registry, tidy, add todos

* refactor(#2826): remove unnecessary view members float, hide_root_folder; use explorer opts

* refactor(#2826): remove unused view members centralize_selection and preserve_window_proportions

* refactor(#2826): remove unused view member height

* refactor(#2826): temporarily reuse BUFNR_PER_TAB in view constructor

* refactor(#2826): get_winid returns new after consistency check

* refactor(#2826): globals.TABPAGES -> WINID_PER_TAB

* refactor(#2826): consistent naming of tabid

* refactor(#2826): more consistency checking

* refactor(#2826): more consistency checking

* refactor(#2826): move global CURSORS to view member

* Revert "refactor(#2826): move global CURSORS to view member"

This reverts commit d84dfad1c3.

* refactor(#2826): move global CURSORS to view member

* refactor(#2826): consistency check returns new

* refactor(#2826): remove consistency checks, enabling new path for view get_winid and get_bufnr

* refactor(#2826): restore CURSORS global
This commit is contained in:
Alexander Courtis
2025-07-28 12:44:17 +10:00
committed by GitHub
parent 10db6943cb
commit a9156c0139
16 changed files with 155 additions and 420 deletions

View File

@@ -15,7 +15,7 @@ function M.set_target_win()
local id = vim.api.nvim_get_current_win()
if explorer and id == explorer.view:get_winnr(nil, "lib.set_target_win") then
if explorer and id == explorer.view:get_winid() then
M.target_winid = 0
return
end
@@ -102,14 +102,14 @@ function M.open(opts)
M.set_target_win()
if not core.get_explorer() or opts.path then
if opts.path then
core.init(opts.path, "lib.open - opts.path")
core.init(opts.path)
else
local cwd, err = vim.loop.cwd()
if not cwd then
notify.error(string.format("current working directory unavailable: %s", err))
return
end
core.init(cwd, "lib.open - cwd")
core.init(cwd)
end
end
@@ -136,7 +136,7 @@ function M.open(opts)
end
if explorer then
explorer.view:restore_tab_state()
explorer.view:restore_state()
end
end