From 4bcf829eae6239aee8c34e39d76e3f1c2cbc782d Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 15 Apr 2023 21:11:01 +0200 Subject: [PATCH] fix: refresh after starting worker --- lua/neo-tree/sources/symbolmap/commands.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/neo-tree/sources/symbolmap/commands.lua b/lua/neo-tree/sources/symbolmap/commands.lua index 52b4552..3d342a3 100644 --- a/lua/neo-tree/sources/symbolmap/commands.lua +++ b/lua/neo-tree/sources/symbolmap/commands.lua @@ -1,4 +1,5 @@ local cc = require("neo-tree.sources.common.commands") +local manager = require("neo-tree.sources.manager") local vim = vim local M = {} @@ -69,13 +70,13 @@ local function find_last_buffer() return buf end end - return nil + return 0 end M.add = function(state) vim.ui.input({ prompt = "query" }, function(input) local buf = find_last_buffer() - local _ = vim.lsp.buf_request(buf, 'workspace/symbol', { query = input }, function(err, data, _, _) + vim.lsp.buf_request(buf, 'workspace/symbol', { query = input }, function(err, data, _, _) local root = { id = "root", name = "no workspace symbols loaded", @@ -87,7 +88,7 @@ M.add = function(state) root = parse_tree(map, 'root', 'workspace symbols') end state.symboltree = { root } - require("neo-tree.sources.manager").refresh("symbolmap") + manager.refresh("symbolmap") end) state.symboltree = { { id = "root", @@ -95,6 +96,7 @@ M.add = function(state) type = "directory", children = {} } } + manager.refresh("symbolmap") end) end