fix(hover/rename): Remove manual unloading of packages

lua 🙏🙏🙏🙏
This commit is contained in:
simrat39
2021-04-22 20:06:48 -07:00
parent 88d7ce38ba
commit 4451c904d0
2 changed files with 10 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
local vim = vim
local state = require('symbols-outline').state
local main = require('symbols-outline')
local M = {}
@@ -16,10 +16,10 @@ local function get_rename_params(node, winnr)
end
function M.rename()
local current_line = vim.api.nvim_win_get_cursor(state.outline_win)[1]
local node = state.flattened_outline_items[current_line]
local current_line = vim.api.nvim_win_get_cursor(main.state.outline_win)[1]
local node = main.state.flattened_outline_items[current_line]
local params = get_rename_params(node, state.code_win)
local params = get_rename_params(node, main.state.code_win)
local new_name = vim.fn.input("New Name: ", node.name)
if not new_name or new_name == "" or new_name == node.name then return end
@@ -32,9 +32,6 @@ function M.rename()
vim.lsp.util.apply_workspace_edit(result)
end
end)
-- kind of a hack but we want the state to always be the latest, so unload
-- this module for the next time it is called its gonna be F R E S H
package.loaded["symbols-outline.rename"] = nil
end
return M