-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run __mundo__ autocmds earlier #92
Comments
@simnalamburt do you have any thoughts on this? |
@BlueDrink9 OMG sorry to keep you extremely late. We used Well.. Since diff --git a/autoload/mundo.vim b/autoload/mundo.vim
index 18009d9..3c437fe 100644
--- a/autoload/mundo.vim
+++ b/autoload/mundo.vim
@@ -533,8 +533,8 @@ augroup MundoAug
\ call s:MundoRenderPreview() |
\ call s:MundoStopRefreshTimer() |
\ endif |
- autocmd BufEnter __Mundo__ call s:MundoSettingsGraph()
- autocmd BufEnter __Mundo_Preview__ call s:MundoSettingsPreview()
+ autocmd BufNewFile,BufEnter __Mundo__ call s:MundoSettingsGraph()
+ autocmd BufNewFile,BufEnter __Mundo_Preview__ call s:MundoSettingsPreview()
autocmd CursorHold,CursorMoved,TextChanged,InsertLeave *
\ call s:MundoRefresh()
augroup END But well.. I'm not sure if it's really a big deal to Execute I made a draft PR of this patch, but I want to listen @dsummersl's opinion first. :) |
I see. #74 is definitely a reason to keep using |
Alternatively, if it's just |
I use some autocmds to set the default filetype for new buffers:
For some reason, the combination of the first and last autocmd in that list breaks mundo, causing the
__mundo__
files to be opened as actual non-hidden new files, with ft=scratch.Changing the MundoAug groups to
BufNewFile
instead ofBufEnter
fixes this:This would mean re-entering an existing Mundo window wouldn't reapply the autocmd. That's potentially a benefit, since it is marginally more efficient if they only set local settings anyway (which can't be changed unless within the buffer), and wouldn't override user changes to buffer settings each time they re-enter it.
It also makes Mundo's ft setup etc more robust, since it's happening earlier in the setup process. It stops buggy vimrc or plugins from modifying the buffer if their autocmds fire first, for example.
The text was updated successfully, but these errors were encountered: