Skip to content

#1099 search obeys active ignore filters #1107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions lua/nvim-tree/actions/search-node.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local api = vim.api
local uv = vim.loop
local utils = require "nvim-tree.utils"
local core = require "nvim-tree.core"
local filters = require "nvim-tree.explorer.filters"
local find_file = require("nvim-tree.actions.find-file").fn

local M = {}
Expand All @@ -27,15 +28,17 @@ local function search(dir, input_path)
break
end

if string.find(path, "/" .. input_path .. "$") then
return path
end

if stat.type == "directory" then
path = search(path, input_path)
if path then
if not filters.should_ignore(path) then
if string.find(path, "/" .. input_path .. "$") then
return path
end

if stat.type == "directory" then
path = search(path, input_path)
if path then
return path
end
end
end

name, _ = uv.fs_scandir_next(handle)
Expand Down