float title

pull/268/head
ray-x 1 year ago
parent 8b3d26453d
commit 274581e35e

@ -126,6 +126,7 @@ local function ctags_symbols()
transparency = 50,
prompt = true,
rawdata = true,
title = 'ctags',
rect = { height = height, pos_x = 0, pos_y = 0, width = width },
}

@ -29,7 +29,7 @@ local definition_hdlr = function(err, locations, ctx, _)
if vim.tbl_islist(locations) then
if #locations > 1 then
local items = locations_to_items(locations)
gui.new_list_view({ items = items, api = 'Definition' })
gui.new_list_view({ items = items, api = 'Definition', title = 'Definition' })
else
vim.lsp.util.jump_to_location(locations[1], oe)
end

@ -404,6 +404,7 @@ M.show_buf_diagnostics = function()
.. _NgConfigValues.icons.diagnostic_head
.. ' Diagnostic ',
enable_preview_edit = true,
title = 'LSP Diagnostic',
})
if listview == nil then
return log('nil listview')

@ -56,6 +56,7 @@ function M.new_list_view(opts)
opts.external = config.external
opts.preview_lines_before = 4
opts.title = opts.title or 'Navigator Searcher'
if _NgConfigValues.debug then
local logopts = { items = {}, data = {} }
logopts = vim.tbl_deep_extend('keep', logopts, opts)

@ -122,6 +122,7 @@ hierarchy_handler = function(dir, handler, show, api, err, result, ctx, cfg)
bufnr = bufnr,
panel = opts.panel,
parent_node = opts.parent_node,
title = 'Call Hierarchy',
}
local win = show(show_args)
return results, win

@ -18,7 +18,7 @@ end
local function implementation_handler(_, err, result, ctx, cfg)
local results = location_handler(err, result, ctx, cfg, 'Implementation not found')
local ft = vim.api.nvim_buf_get_option(ctx.bufnr, 'ft')
gui.new_list_view({ items = results, ft = ft, api = 'Implementation' })
gui.new_list_view({ items = results, ft = ft, api = 'Implementation', title = 'Implementation' })
end
function M.implementation(bang, opts)
@ -29,7 +29,12 @@ function M.implementation(bang, opts)
local params = vim.lsp.util.make_position_params()
log('impel params', params)
lsphelper.call_sync('textDocument/implementation', params, opts, partial(implementation_handler, bang))
lsphelper.call_sync(
'textDocument/implementation',
params,
opts,
partial(implementation_handler, bang)
)
end
M.implementation_call = partial(M.implementation, 0)

@ -94,6 +94,7 @@ local ref_view = function(err, locations, ctx, cfg)
width = width,
api = 'Reference',
enable_preview_edit = true,
title = 'References ' .. vim.fn.expand('<cword>'),
}
local listview
if not ctx.no_show then
@ -215,24 +216,27 @@ local function fetch_lsp_references(bufnr, lsp_params, callback)
log(bufnr, params)
-- return id, closer
return vim.lsp.buf_request(bufnr, 'textDocument/references', params, function(err, result, ctx, cfg)
log(result)
if err then
log('[nav-rename] Error while finding references: ' .. err.message)
return
end
if not result or vim.tbl_isempty(result) then
log('[nav-rename] Nothing to rename', result)
return
end
if callback then
callback(err, result, ctx, cfg)
return vim.lsp.buf_request(
bufnr,
'textDocument/references',
params,
function(err, result, ctx, cfg)
log(result)
if err then
log('[nav-rename] Error while finding references: ' .. err.message)
return
end
if not result or vim.tbl_isempty(result) then
log('[nav-rename] Nothing to rename', result)
return
end
if callback then
callback(err, result, ctx, cfg)
end
end
end)
)
end
local ref_req = function()
if _NgConfigValues.closer ~= nil then
-- do not call it twice

@ -308,6 +308,7 @@ M.rename = function()
ghinput.setup({
on_change = function(new_name) end,
on_concel = function(new_name) end,
title = 'lsp rename',
on_cancel = function() end,
})
vim.ui.input = ghinput.input

@ -126,6 +126,7 @@ M.document_symbol_handler = function(err, result, ctx)
rawdata = true,
height = 0.62,
preview_height = 0.1,
title = 'Document Symbols',
ft = ft,
api = _NgConfigValues.icons.doc_symbol,
})
@ -153,7 +154,7 @@ M.workspace_symbol_handler = function(err, result, ctx, cfg)
log(items[1])
local ft = vim.api.nvim_buf_get_option(ctx.bufnr, 'ft')
gui.new_list_view({ items = items, prompt = true, ft = ft, rowdata = true, api = '' })
gui.new_list_view({ items = items, prompt = true, ft = ft, rowdata = true, api = '' , title = 'Workspace Symbols''})
end
function M.side_panel()

@ -785,6 +785,7 @@ function M.buf_ts()
height = 0.62,
preview_height = 0.12,
width = (width or 80) + 10,
title = 'treesitter symbols',
api = _NgConfigValues.icons.treesitter_defult,
})
return listview, all_nodes, width
@ -825,6 +826,7 @@ function M.bufs_ts()
height = 0.62,
preview_height = 0.12,
width = max_length + 10,
title = 'treesitter symbols',
api = _NgConfigValues.icons.treesitter_defult,
})
end

@ -93,6 +93,7 @@ M.list_workspace_folders = function()
local folders = vim.lsp.buf.list_workspace_folders()
if #folders > 0 then
return require('navigator.gui').new_list_view({
title = 'workspace folders',
items = folders,
border = 'single',
rawdata = true,

Loading…
Cancel
Save