Skip to content

Commit efe6902

Browse files
committed
fix: prevent closing for auto toggle check
Problem: Auto toggle check for netrw closes explorer window, resulting in the window already being closed when we want to close the full screen window to re-open it on the side. Solution: prevent closing for auto toggle check. Fix #101
1 parent 4332d38 commit efe6902

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lua/nnn.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ local function handle_files(iter, mode)
123123
-- Close and re-open explorer when it was fullscreen
124124
if mode == "explorer" and state[mode][tab].fs then
125125
a.nvim_win_close(state[mode][tab].win, {force = true})
126-
M.toggle("explorer", false, false)
127-
c("vert resize +1 | vert resize -1 | wincmd p")
126+
M.toggle("explorer")
127+
c('wincmd p')
128128
end
129129

130130
if action then
@@ -354,7 +354,7 @@ function M.toggle(mode, fargs, auto)
354354
local tab = a.nvim_get_current_tabpage()
355355
local win = state[mode][tab] and state[mode][tab].win
356356

357-
if win and a.nvim_win_is_valid(win) then
357+
if not auto and win and a.nvim_win_is_valid(win) then
358358
close(mode, tab)
359359
return
360360
end

0 commit comments

Comments
 (0)