From 033ffc986bfa304a8fbe2e13a851a5321479e485 Mon Sep 17 00:00:00 2001 From: bhagwan Date: Sat, 30 Apr 2022 12:24:52 -0700 Subject: [PATCH] lsp_live_workspace_symbols: fix query resume --- lua/fzf-lua/core.lua | 1 + lua/fzf-lua/providers/lsp.lua | 12 ++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lua/fzf-lua/core.lua b/lua/fzf-lua/core.lua index 5209bba..0021357 100644 --- a/lua/fzf-lua/core.lua +++ b/lua/fzf-lua/core.lua @@ -29,6 +29,7 @@ M.fzf_resume = function(opts) if opts.__FNCREF__ then -- HACK for 'live_grep' and 'lsp_live_workspace_symbols' opts.cmd = nil + opts.query = nil opts.search = nil opts.continue_last_search = true opts.__FNCREF__(opts) diff --git a/lua/fzf-lua/providers/lsp.lua b/lua/fzf-lua/providers/lsp.lua index 037990e..18c36e4 100644 --- a/lua/fzf-lua/providers/lsp.lua +++ b/lua/fzf-lua/providers/lsp.lua @@ -752,13 +752,6 @@ M.live_workspace_symbols = function(opts) opts.query = last_search.query end - if opts.query and #opts.query>0 then - -- save the search query so the use can - -- call the same search again - last_search = {} - last_search.query = opts.search - end - -- sent to the LSP server opts.lsp_params = {query = opts.query or ''} @@ -768,9 +761,8 @@ M.live_workspace_symbols = function(opts) opts.winid = vim.api.nvim_get_current_win() opts._reload_action = function(query) - if query and not (opts.save_last_search == false) then - last_search = {} - last_search.query = query + if query and not (opts.save_last_query == false) then + last_search = { query = query } config.__resume_data.last_query = query end opts.sync = true