From 1f4f76cb598dd3624c8c263fee0642d298f43e65 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+tobealive@users.noreply.github.com> Date: Wed, 28 Dec 2022 23:13:26 +0100 Subject: [PATCH] feat: use distinct filter prompt titles --- lua/neo-tree/sources/filesystem/lib/filter.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/neo-tree/sources/filesystem/lib/filter.lua b/lua/neo-tree/sources/filesystem/lib/filter.lua index 6fcafafb..a78b7fad 100644 --- a/lua/neo-tree/sources/filesystem/lib/filter.lua +++ b/lua/neo-tree/sources/filesystem/lib/filter.lua @@ -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 = { @@ -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 = {