Skip to content

Commit 2a07d7c

Browse files
authored
Merge branch 'master' into refactor-explorer-actions
2 parents 0f2b74b + 64e2192 commit 2a07d7c

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
uses: actions/checkout@v5
2828

2929
- name: install lua ${{ matrix.lua_version }}
30-
uses: leafo/gh-actions-lua@v11
30+
uses: leafo/gh-actions-lua@v12
3131
with:
3232
luaVersion: ${{ matrix.lua_version }}
3333

3434
- name: install luarocks
35-
uses: leafo/gh-actions-luarocks@v5
35+
uses: leafo/gh-actions-luarocks@v6
3636

3737
- name: install luacheck ${{ matrix.luacheck_version }}
3838
run: luarocks install luacheck ${{ matrix.luacheck_version }}

doc/nvim-tree-lua.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,6 +2339,7 @@ events.Event *nvim-tree-api.events.Event*
23392339

23402340
live_filter.start() *nvim-tree-api.live_filter.start()*
23412341
Enter |nvim-tree.live_filter| mode.
2342+
Opens an input window with |filetype| `"NvimTreeFilter"`
23422343

23432344
live_filter.clear() *nvim-tree-api.live_filter.clear()*
23442345
Exit |nvim-tree.live_filter| mode.

lua/nvim-tree/actions/node/open-file.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,15 @@ local function open_file_in_tab(filename)
198198
if M.relative_path then
199199
filename = utils.path_relative(filename, vim.fn.getcwd())
200200
end
201-
vim.cmd("tabe " .. vim.fn.fnameescape(filename))
201+
vim.cmd.tabnew()
202+
vim.bo.bufhidden = "wipe"
203+
-- Following vim.fn.tabnew the # buffer may be set to the tree buffer. There is no way to clear the # buffer via vim.fn.setreg as it requires a valid buffer. Clear # by setting it to a new temporary scratch buffer.
204+
if utils.is_nvim_tree_buf(vim.fn.bufnr("#")) then
205+
local tmpbuf = vim.api.nvim_create_buf(false, true)
206+
vim.fn.setreg("#", tmpbuf)
207+
vim.api.nvim_buf_delete(tmpbuf, { force = true })
208+
end
209+
vim.cmd.edit(vim.fn.fnameescape(filename))
202210
end
203211

204212
local function drop(filename)

lua/nvim-tree/explorer/live-filter.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,10 @@ local function create_overlay(self)
188188

189189
if vim.fn.has("nvim-0.10") == 1 then
190190
vim.api.nvim_set_option_value("modifiable", true, { buf = overlay_bufnr })
191+
vim.api.nvim_set_option_value("filetype", "NvimTreeFilter", { buf = overlay_bufnr })
191192
else
192193
vim.api.nvim_buf_set_option(overlay_bufnr, "modifiable", true) ---@diagnostic disable-line: deprecated
194+
vim.api.nvim_buf_set_option(overlay_bufnr, "filetype", "NvimTreeFilter") ---@diagnostic disable-line: deprecated
193195
end
194196

195197
vim.api.nvim_buf_set_lines(overlay_bufnr, 0, -1, false, { self.filter })

0 commit comments

Comments
 (0)