Skip to content

Commit

Permalink
more updates for nvim 0.10 nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-x committed Nov 25, 2023
1 parent 4dbf5e1 commit 40d1907
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 79 deletions.
15 changes: 5 additions & 10 deletions lua/navigator/lspclient/mapping.lua
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,6 @@ function M.setup(attach_opts)
if hassig then
sig.setup(_NgConfigValues.signature_help_cfg or {})
end
else
vim.lsp.handlers['textDocument/signatureHelp'] =
vim.lsp.with(require('navigator.signature').signature_handler, {
border = { '', '', '', '', '', '', '', '' },
})
end

api.nvim_create_autocmd({ 'BufWritePre' }, {
Expand All @@ -511,11 +506,11 @@ function M.setup(attach_opts)
if _NgConfigValues.border == 'double' then
border_style = double
end
if _NgConfigValues.lsp.hover then
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(require('navigator.hover').handler, {
border = border_style,
})
end
-- if _NgConfigValues.lsp.hover then
-- vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(require('navigator.hover').handler, {
-- border = border_style,
-- })
-- end
if cap.documentFormattingProvider then
log('formatting enabled setup hdl')
vim.lsp.handlers['textDocument/formatting'] = require('navigator.formatting').format_hdl
Expand Down
69 changes: 0 additions & 69 deletions lua/navigator/signature.lua

This file was deleted.

32 changes: 32 additions & 0 deletions lua/navigator/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -563,4 +563,36 @@ function M.sub_match(str)
return str
end


function M.try_trim_markdown_code_blocks(lines)
local language_id = lines[1]:match('^```(.*)')
if language_id then
local has_inner_code_fence = false
for i = 2, (#lines - 1) do
local line = lines[i]
if line:sub(1, 3) == '```' then
has_inner_code_fence = true
break
end
end
-- No inner code fences + starting with code fence = hooray.
if not has_inner_code_fence then
table.remove(lines, 1)
table.remove(lines)
return language_id
end
end
return 'markdown'
end

function M.trim_empty_lines(lines)
local new_list = {}
for i, str in ipairs(lines) do
if str ~= '' and str then
table.insert(new_list, str)
end
end
return new_list
end

return M

0 comments on commit 40d1907

Please sign in to comment.