Wednesday, May 24, 2017

Re: Bug in ftdetect?

On May 24, Frew Schmidt wrote:

> [...]
>
> Maybe a dumb question, but why would BufNew be more expensive
> than BufRead? Shouldn't the filetype stuff get run either way?
> I wouldn't expect BufRead to take 500ms and BufNew to take
> multiple seconds, would you?

The bufnew autocommands happen all at once. Change your autocommand
to this instead:

au bufnew *.md echo 'markdown bufnew'
au bufread *.md echo 'markdown bufread'

Then :args * and see what happens.

I think you should still remove the 'BufNew' from your autocommand
(Christian's helpful-looking patch notwithstanding). I can't see
what purpose it serves other than to detect name changes. If that's
a real requirement, there's buffilepost. --Antony

--
--
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.
For more options, visit https://groups.google.com/d/optout.

No comments: