mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
docs: small improvements to compl-autocomplete example (#25299)
- Don't complete when there is pending input. - Use vim.list_contains() instead of vim.tbl_contains().
This commit is contained in:
parent
6555176f34
commit
fcfc87cb77
@ -1093,11 +1093,11 @@ To get basic "autocompletion" without installing a plugin, try this script: >lua
|
||||
vim.api.nvim_create_autocmd("InsertCharPre", {
|
||||
buffer = vim.api.nvim_get_current_buf(),
|
||||
callback = function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
if vim.fn.pumvisible() == 1 or vim.fn.state("m") == "m" then
|
||||
return
|
||||
end
|
||||
local char = vim.v.char
|
||||
if vim.tbl_contains(triggers, char) then
|
||||
if vim.list_contains(triggers, char) then
|
||||
local key = vim.keycode("<C-x><C-n>")
|
||||
vim.api.nvim_feedkeys(key, "m", false)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user