fix-keymap-buffer
ray-x 2 years ago
parent de5c88c766
commit c3ef990390

@ -491,7 +491,8 @@ function M.treesitter_and_diag_panel()
})
p:add_section({
header = 'diagnostic',
render = function(bufnr)
render = function(buf)
log(buf, diagnostic)
if diagnostic_list[ft] ~= nil then
local display_items = {}
for _, client_items in pairs(results) do

@ -32,6 +32,9 @@ return {
end, 100)
end,
range_foramt = function(err, result, ctx, _)
if err then
print("failed to format", vim.inspect(result), vim.inspect(ctx))
end
local old_func = vim.go.operatorfunc
_G.op_func_formatting = function()
local start = vim.api.nvim_buf_get_mark(0, '[')

@ -1,6 +1,6 @@
local M = {}
local ListView = require('guihua.listview')
local TextView = require('guihua.textview')
-- local ListView = require('guihua.listview')
-- local TextView = require('guihua.textview')
local util = require('navigator.util')
local log = util.log
local trace = require('navigator.util').trace
@ -16,7 +16,7 @@ function M.new_list_view(opts)
local winnr = active_list_view.win
local bufnr = active_list_view.buf
if bufnr and vim.api.nvim_buf_is_valid(bufnr) and winnr and vim.api.nvim_win_is_valid(winnr) then
if bufnr and api.nvim_buf_is_valid(bufnr) and winnr and api.nvim_win_is_valid(winnr) then
log('list view already present')
return active_list_view
end

@ -100,7 +100,7 @@ hierarchy_handler = function(dir, handler, show, api, err, result, ctx, cfg)
trace(dir, handler, api, show, err, result, ctx, cfg)
ctx = ctx or {} -- can be nil if it is async call
cfg = cfg or {}
opts = ctx.opts or {}
local opts = ctx.opts or {}
vim.validate({ handler = { handler, 'function' }, show = { show, 'function' }, api = { api, 'string' } })
local bufnr = ctx.bufnr or vim.api.nvim_get_current_buf()
assert(next(vim.lsp.buf_get_clients(bufnr)), 'Must have a client running to use lsp hierarchy')
@ -142,11 +142,12 @@ local function display_panel(args)
local Panel = require('guihua.panel')
local bufnr = args.bufnr or vim.api.nvim_get_current_buf()
local ft = args.ft or vim.api.nvim_buf_get_option(bufnr, 'buftype')
-- local ft = args.ft or vim.api.nvim_buf_get_option(bufnr, 'buftype')
local items = args.items
local p = Panel:new({
header = args.header or 'Call Hierarchy',
render = function(bufnr)
render = function(buf)
log(buf)
return items
end,
fold = function(panel, node)

@ -1,7 +1,6 @@
return {
init = function()
local loader = nil
packer_plugins = packer_plugins or nil -- suppress warnings
local log = require('navigator.util').log
-- packer only
if packer_plugins ~= nil then -- packer install

@ -1,5 +1,3 @@
local lsp = require("vim.lsp")
local M = {}
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true

@ -61,7 +61,7 @@ function M.get_data_from_file(filename, startLine)
return { data = data, line = displayLine }
end
function M.io_read(filename, total)
function M.io_read(filename)
local f = io.open(filename, 'r')
if f == nil then
return nil

Loading…
Cancel
Save