diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-01-31 22:49:54 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-01-31 22:49:54 +0100 |
| commit | 06e2581cf8ee20470a27aa2e8cb203cd133a01ea (patch) | |
| tree | e40480c7394f1088c49287ca9757ef73cda0563d /lua/alpha/telescope | |
| parent | 669561e21073e6efafddda25ba3ace69fb43819e (diff) | |
| download | nvim-conf-06e2581cf8ee20470a27aa2e8cb203cd133a01ea.tar.gz nvim-conf-06e2581cf8ee20470a27aa2e8cb203cd133a01ea.zip | |
fix: actions, plugins tests
Diffstat (limited to 'lua/alpha/telescope')
| -rw-r--r-- | lua/alpha/telescope/actions.lua | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lua/alpha/telescope/actions.lua b/lua/alpha/telescope/actions.lua index e4bbd8e..abd3381 100644 --- a/lua/alpha/telescope/actions.lua +++ b/lua/alpha/telescope/actions.lua @@ -98,12 +98,7 @@ M.disable_plugin = function(prompt_bufnr) local parsers = require "nvim-treesitter.parsers" local parser = parsers.get_parser(bufnr) - if type(parser:parse()) ~= "table" then - vim.notify("Expected table but got something else ???", vim.log.levels.ERROR, {}) - P(parser:parse()) - return - end - local tree = unpack(parser:parse()) + local tree = parser:parse()[1] local disabled_stm_node = get_disable_stm_node(bufnr, tree) if disabled_stm_node ~= nil then @@ -131,7 +126,7 @@ M.disable_plugin = function(prompt_bufnr) end_line = start_line + 1 end - vim.api.nvim_buf_set_lines(bufnr, start_line, end_line, false, { " enabled = false," }) + vim.api.nvim_buf_set_lines(bufnr, start_line, end_line, false, { " enabled = false," }) vim.notify("Plugin " .. entry[1] .. " Disabled", vim.log.levels.INFO, {}) actions.close(prompt_bufnr) vim.api.nvim_buf_call(bufnr, function() @@ -148,12 +143,7 @@ M.enable_plugin = function(prompt_bufnr) local parsers = require "nvim-treesitter.parsers" local parser = parsers.get_parser(bufnr) - if type(parser:parse()) == "table" then - vim.notify("Expected number but got table ???", vim.log.levels.ERROR, {}) - P(parser:parse()) - return - end - local tree = unpack(parser:parse()) + local tree = parser:parse()[1] local disabled_stm_node = get_disable_stm_node(bufnr, tree) if disabled_stm_node == nil then |