We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 471afc1 commit 5af3cfaCopy full SHA for 5af3cfa
lua/nvim-tree/actions/open-file.lua
@@ -204,7 +204,7 @@ function M.fn(mode, filename)
204
end
205
206
local cmd
207
- if do_split then
+ if do_split or #api.nvim_list_wins() == 1 then
208
cmd = string.format("%ssplit ", vertical and "vertical " or "")
209
else
210
cmd = "edit "
@@ -213,9 +213,10 @@ function M.fn(mode, filename)
213
cmd = cmd .. vim.fn.fnameescape(filename)
214
api.nvim_set_current_win(target_winid)
215
pcall(vim.cmd, cmd)
216
- if M.resize_window then
217
- view.resize()
218
- end
+ end
+
+ if M.resize_window then
219
+ view.resize()
220
221
222
if mode == "preview" then
0 commit comments