From 70360437cd1b391b1d666d2ad72ea2263fa70a40 Mon Sep 17 00:00:00 2001 From: Tommy Allen Date: Sat, 11 Jun 2016 18:35:09 -0400 Subject: [PATCH] Prevent duplication of InsertLeave autocmds in buffers (#582) --- AUTHORS.txt | 1 + ftplugin/python/jedi.vim | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 6e77b5c..4278db1 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -49,5 +49,6 @@ Daniel Hahler (@blueyed) Dave Honneffer (@pearofducks) Bagrat Aznauryan (@n9code) Tomoyuki Kashiro (@kashiro) +Tommy Allen (@tweekmonster) @something are github user names. diff --git a/ftplugin/python/jedi.vim b/ftplugin/python/jedi.vim index 3bc9449..aa29e51 100644 --- a/ftplugin/python/jedi.vim +++ b/ftplugin/python/jedi.vim @@ -43,6 +43,9 @@ if g:jedi#auto_initialization if g:jedi#auto_close_doc " close preview if its still open after insert - autocmd InsertLeave if pumvisible() == 0|pclose|endif + augroup jedi_preview + autocmd! + autocmd InsertLeave if pumvisible() == 0|pclose|endif + augroup END endif endif