echomsg "EnhancedDiffLayout_autocmd disabled"
augroup difflayout
autocmd!
augroup END
Le lundi 6 décembre 2021 à 13:36:41 UTC+1, Ni Va a écrit :
Hi,I the plugin directory vim9script of a plugin of mine, i would like to toggle autocmd.In plugin part, I got this augroupfoobar/plugin/foobar.vim....augroup difflayoutau!autocmd CursorHold *.tmp call EnhancedDiffLayout()augroup END....meanwhile in the following autoload part I got this to toggle autocmd.foobar/autoload/foobar.vimexport def EnhancedDiffLayout_Toggle() #{{{g:EnhancedDiffLayout_Options.autocmd_enabled = !g:EnhancedDiffLayout_Options.autocmd_enabledif !g:EnhancedDiffLayout_Options.autocmd_enabledechomsg "EnhancedDiffLayout_autocmd disabled"autocmd! CursorHold *.tmp call EnhancedDiffLayout()augroup! difflayoutelseechomsg "EnhancedDiffLayout_autocmd enabled"augroup difflayoutau!autocmd CursorHold *.tmp call EnhancedDiffLayout()augroup ENDendifenddef #}}}It seems at runtime that augroup cannot be deleted because autocmd! does not delete the autocmd.How can I fix it ?Thank youNiVa
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/685086c3-e097-4d76-a673-ba2ecf9b24d7n%40googlegroups.com.
No comments:
Post a Comment