From cde5c6be5c141a418889e48b8998e01b9ed304df Mon Sep 17 00:00:00 2001 From: ray-x Date: Wed, 1 Sep 2021 15:25:11 +1000 Subject: [PATCH] strange code action casued cursor drifting. disable codeaction in insert mode --- README.md | 6 +++++- lua/navigator.lua | 12 ++++++++++-- lua/navigator/lspclient/clients.lua | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3e985b5..976cdba 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ implementation. - FZY search with Lua-JIT -- LSP multiple symbol highlight and jump between references +- LSP multiple symbol highlight/marker and hop between document references - Better navigation for diagnostic errors, Navigate through all files/buffers that contain errors/warnings @@ -86,6 +86,8 @@ in the same line). Using treesitter for file preview highlighter etc - LRU cache for treesitter nodes +- Lazy loader friendly + # Why a new plugin I'd like to go beyond what the system is providing. @@ -324,6 +326,8 @@ require'navigator'.setup({ | i/n | number 1~9 | move to ith row/item in the list| | i/n | \ | previous item in list| | i/n | \ | next item in list| +| n | \j | move cursor to preview (windows move to bottom view point)| +| n | \k | move cursor to list (windows move to up view point)| | i/n | \ | open preview file in nvim/Apply action| | n | \ | open preview file in nvim/Apply action| | i/n | \ | previous page in listview| diff --git a/lua/navigator.lua b/lua/navigator.lua index b21e144..7b05564 100644 --- a/lua/navigator.lua +++ b/lua/navigator.lua @@ -88,7 +88,14 @@ local extend_config = function(opts) -- end if type(_NgConfigValues[key]) == "table" then for k, v in pairs(value) do - _NgConfigValues[key][k] = v + -- level 3 + if type(_NgConfigValues[key][k]) == "table" then + for k2, v2 in pairs(v) do + _NgConfigValues[key][k][k2] = v2 + end + else + _NgConfigValues[key][k] = v + end end else _NgConfigValues[key] = value @@ -104,6 +111,7 @@ M.config_values = function() end M.setup = function(cfg) + print(vim.inspect(cfg)) extend_config(cfg) -- local log = require"navigator.util".log -- log(debug.traceback()) @@ -119,7 +127,7 @@ M.setup = function(cfg) -- log("navigator loader") if _NgConfigValues.code_action_prompt.enable then - vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'navigator.codeAction'.code_action_prompt()]] + vim.cmd [[autocmd CursorHold * lua require'navigator.codeAction'.code_action_prompt()]] end -- vim.cmd("autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4") if not _NgConfigValues.loaded then diff --git a/lua/navigator/lspclient/clients.lua b/lua/navigator/lspclient/clients.lua index da5a23c..d8b5217 100644 --- a/lua/navigator/lspclient/clients.lua +++ b/lua/navigator/lspclient/clients.lua @@ -447,7 +447,7 @@ local function setup(user_opts) return end if user_opts ~= nil then - log("navigator setup", user_opts) + log("navigator user setup", user_opts) end trace(debug.traceback()) user_opts = user_opts or config -- incase setup was triggered from autocmd