From 3dc8c02c39c78ed108500bd32ac91b9f21c36512 Mon Sep 17 00:00:00 2001 From: ray-x Date: Sat, 2 Jul 2022 20:49:54 +1000 Subject: [PATCH] add scope info in panel --- lua/navigator/symbols.lua | 1 + lua/navigator/treesitter.lua | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lua/navigator/symbols.lua b/lua/navigator/symbols.lua index caee706..baef5cb 100644 --- a/lua/navigator/symbols.lua +++ b/lua/navigator/symbols.lua @@ -146,6 +146,7 @@ function M.side_panel() local Panel = require('guihua.panel') local buf = vim.api.nvim_get_current_buf() local p = Panel:new({ + scope = 'range', render = function(bufnr) local ft = vim.api.nvim_buf_get_option(bufnr, 'buftype') if ft == 'nofile' or ft == 'guihua' or ft == 'prompt' then diff --git a/lua/navigator/treesitter.lua b/lua/navigator/treesitter.lua index 0f17421..3f26f9b 100644 --- a/lua/navigator/treesitter.lua +++ b/lua/navigator/treesitter.lua @@ -26,6 +26,7 @@ local trace = function(...) end if vim.fn.has('nvim-0.7') == 1 then local trace = require('navigator.util').trace end +trace = log local get_icon = function(kind) if kind == nil or _NgConfigValues.icons.match_kinds[kind] == nil then @@ -641,6 +642,7 @@ function M.side_panel() end return require('navigator.treesitter').all_ts_nodes(b) end, + scope = 'node_scope' }) panel:open(true) end