From 2e02662867242303c180431ea9de810382ab622e Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Tue, 19 Oct 2021 18:18:53 +0900 Subject: [PATCH] Fix --- plugin/cmp.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/cmp.lua b/plugin/cmp.lua index 4f13060..f78cac1 100644 --- a/plugin/cmp.lua +++ b/plugin/cmp.lua @@ -3,6 +3,7 @@ if vim.g.loaded_cmp then end vim.g.loaded_cmp = true +local api = require "cmp.utils.api" local misc = require('cmp.utils.misc') local highlight = require('cmp.utils.highlight') @@ -79,3 +80,13 @@ vim.cmd [[command! CmpStatus lua require('cmp').status()]] vim.cmd [[doautocmd User cmp#ready]] +vim.on_key(function(keys) + if keys == vim.api.nvim_replace_termcodes('', true, true, true) then + vim.schedule(function() + if not api.is_suitable_mode() then + require('cmp.utils.autocmd').emit('InsertLeave') + end + end) + end +end, vim.api.nvim_create_namespace('cmp.plugin')) +