From 04cf51f6c8387e695a19cfc1dda11e3af4692dae Mon Sep 17 00:00:00 2001 From: ray-x Date: Thu, 19 Aug 2021 09:56:17 +1000 Subject: [PATCH] feature: blur effect feature: transparancy setup --- README.md | 1 + lua/navigator.lua | 6 +++++- lua/navigator/gui.lua | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 38725d2..4113273 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,7 @@ require'navigator'.setup({ -- this kepmap gK will override "gD" mapping function declaration() in default kepmap -- please check mapping.lua for all keymaps treesitter_analysis = true, -- treesitter variable context + transparency = 50, -- 0 ~ 100 blur the main window, 100: fully transparent, 0: opaque, set to nil or 100 to disable it code_action_prompt = {enable = true, sign = true, sign_priority = 40, virtual_text = true}, icons = { -- Code action diff --git a/lua/navigator.lua b/lua/navigator.lua index af96886..22b0cd7 100644 --- a/lua/navigator.lua +++ b/lua/navigator.lua @@ -13,9 +13,10 @@ _NgConfigValues = { -- function(client, bufnr) -- -- your on_attach will be called at end of navigator on_attach -- end, - + ts_fold = false, code_action_prompt = {enable = true, sign = true, sign_priority = 40, virtual_text = true}, treesitter_analysis = true, -- treesitter variable context + transparency = 50, -- 0 ~ 100 blur the main window, 100: fully transparent, 0: opaque, set to nil to disable it lsp = { format_on_save = true, -- set to false to disasble lsp code format on save (if you are using prettier/efm/formater etc) disply_diagnostic_qf = true, -- always show quickfix if there are diagnostic errors @@ -105,6 +106,9 @@ M.setup = function(cfg) require("navigator.definition") require("navigator.hierarchy") require("navigator.implementation") + if _NgConfigValues.ts_fold == true then + require('navigator.foldts').on_attach() + end -- log("navigator loader") if _NgConfigValues.code_action_prompt.enable then vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'navigator.codeAction'.code_action_prompt()]] diff --git a/lua/navigator/gui.lua b/lua/navigator/gui.lua index 28113a8..c3feba8 100644 --- a/lua/navigator/gui.lua +++ b/lua/navigator/gui.lua @@ -159,7 +159,10 @@ function M.new_list_view(opts) offset_y = offset_y + 1 -- need to check this out end local idx = require"guihua.util".fzy_idx - + local transparency = _NgConfigValues.transparency + if transparency == 100 then + transparency = nil + end return ListView:new({ loc = loc, prompt = prompt, @@ -178,6 +181,7 @@ function M.new_list_view(opts) util.open_file_at(item.filename, item.lnum, item.col) end end, + transparency = transparency, on_move = opts.on_move or function(item) trace("on move", pos, item) trace("on move", pos, item.text or item, item.uri, item.filename)