Skip to content

Commit

Permalink
Merge pull request #216 from marqmitk/master
Browse files Browse the repository at this point in the history
[Add] Added a function to *toggle* the file search
  • Loading branch information
EpsilonKu authored Mar 27, 2024
2 parents 31f62d7 + df592d4 commit 5bd9aed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/spectre/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ M.open_file_search = function(opts)
M.open(opts)
end

M.toggle_file_search = function(opts)
opts = opts or {}
if state.is_open then
M.close()
else
M.open_file_search(opts)
end
end

M.close = function()
if state.bufnr ~= nil then
local wins = vim.fn.win_findbuf(state.bufnr)
Expand Down

0 comments on commit 5bd9aed

Please sign in to comment.