Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Nov 4, 2023
1 parent bb9c1ff commit 11a9adf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ vim.keymap.set('i', '<S-TAB>', function()
return '<S-TAB>'
end
end, { expr = true })

vim.keymap.set('i', '<C-e>', function()
if vim.fn.pumvisible() == 1 then
require('epo').disable_trigger()
end
return '<C-e>'
end, {expr = true})
```


Expand Down
11 changes: 6 additions & 5 deletions lua/epo/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ local function complete_ondone(bufnr)
return
end
local lnum, col = unpack(api.nvim_win_get_cursor(0))
if completion_item.additionalTextEdits then
lsp.util.apply_text_edits(completion_item.additionalTextEdits, bufnr, 'utf-8')
end
local startidx = context[args.buf].startidx

local curline = api.nvim_get_current_line()
local is_snippet = completion_item.insertTextFormat == protocol.InsertTextFormat.Snippet
local offset_snip
Expand Down Expand Up @@ -228,6 +223,12 @@ local function complete_ondone(bufnr)
end
end

-- addtional usually for import header
-- so make it applied after textEdit
if completion_item.additionalTextEdits then
lsp.util.apply_text_edits(completion_item.additionalTextEdits, bufnr, 'utf-8')
end

if signature then
local clients =
vim.lsp.get_clients({ bufnr = args.buf, method = ms.textDocument_signatureHelp })
Expand Down

0 comments on commit 11a9adf

Please sign in to comment.