cohama / lexima.vim

Auto close parentheses and repeat by dot dot dot...
995 stars 46 forks source link

Suppress W19 #60

Closed k-takata closed 7 years ago

k-takata commented 7 years ago

After 7.4.2117, warning W19 is shown. Removing an augroup from inside of itself was bad idea.

h-east commented 7 years ago

59

Another solution.

diff --git a/plugin/lexima.vim b/plugin/lexima.vim
index 5d5c549..823fb33 100644
--- a/plugin/lexima.vim
+++ b/plugin/lexima.vim
@@ -29,7 +29,7 @@ endfun
 augroup lexima-init
   autocmd!
   autocmd InsertEnter * call lexima#init() | autocmd! lexima-init
-  autocmd InsertEnter * augroup! lexima-init
+  autocmd InsertEnter * augroup lexima-init | au! | augroup END | augroup! lexima-init
 augroup END

 augroup lexima
h-east commented 7 years ago

NOTE: My patch occurs E216 error in the old version of Vim. At least 7.4.1714

k-takata commented 7 years ago

@h-east That's interesting, but unfortunately it doesn't seem to work. It doesn't cause W19, but :augroup still shows lexima-init.

cohama commented 7 years ago

Thanks all! I have confirmed k-takata's patch. It seems to be fine for new and old Vim.