Skip to content

Commit

Permalink
clear completions on CursorMoved (#87)
Browse files Browse the repository at this point in the history
* clear completions on CursorMoved

This is only triggered in normal and visual modes according to the docs

* pass a table of events to nvim_create_autocmd
  • Loading branch information
aarondill committed Jun 19, 2023
1 parent 9dfaa18 commit 73c56a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/tabnine/auto_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ local config = require("tabnine.config")
local M = {}

function M.setup()
api.nvim_create_autocmd("InsertLeave", { pattern = "*", callback = completion.clear })
-- CursorMoved is only triggered in Normal or Visual - see ':h CursorMoved'
api.nvim_create_autocmd({ "InsertLeave", "CursorMoved" }, { pattern = "*", callback = completion.clear })

if config.get_config().disable_auto_comment then
api.nvim_create_autocmd("FileType", {
Expand Down

0 comments on commit 73c56a1

Please sign in to comment.