Skip to content

feat: use distinct filter prompt titles #671

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
Dec 28, 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
12 changes: 10 additions & 2 deletions lua/neo-tree/sources/filesystem/lib/filter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,20 @@ M.show_filter = function(state, search_as_you_type, fuzzy_finder_mode)
local winid = vim.api.nvim_get_current_win()
local height = vim.api.nvim_win_get_height(winid)
local scroll_padding = 3
local popup_msg = "Search:"
if search_as_you_type then
if fuzzy_finder_mode == "directory" then
popup_msg = "Filter Directories:"
else
popup_msg = "Filter:"
end
end
if state.current_position == "float" then
scroll_padding = 0
local width = vim.fn.winwidth(winid)
local row = height - 2
vim.api.nvim_win_set_height(winid, row)
popup_options = popups.popup_options("Enter Filter Pattern:", width, {
popup_options = popups.popup_options(popup_msg, width, {
relative = "win",
winid = winid,
position = {
Expand All @@ -36,7 +44,7 @@ M.show_filter = function(state, search_as_you_type, fuzzy_finder_mode)
else
local width = vim.fn.winwidth(0) - 2
local row = height - 3
popup_options = popups.popup_options("Enter Filter Pattern:", width, {
popup_options = popups.popup_options(popup_msg, width, {
relative = "win",
winid = winid,
position = {
Expand Down