> See
>
> :help :setf
>
> and see if the FALLBACK argument does what you want.
Not quite: the original filetype is set using :setf pascal; I'm trying to
override this in the same sequence of commands.
Here is perhaps a clearer picture:
+ vim file.md.pp
|
+++ filetype detection autocommands trigger
|
+ $VIMRUNTIME *.pp => :setf pascal (did_filetype() now true)
|
+++ my plugin *.pp => doautocommand … file.md
|
+ $VIMRUNTIME *.md => :setf markdown
but did_filetype() was still true, so this has no effect.
Perhaps I've misunderstood your comment, though. Changing the
distribution's setf pascal to setf FALLBACK pascal would work, but that
seems like it would require more discussion.
On Wednesday, June 30, 2021 at 8:39:45 PM UTC-4 Gary Johnson wrote:
> On 2021-06-30, [email protected] wrote:
> > TL;DR, I need to reset did_filetype() in the middle of filetype-detection
> > autocommands. I have a hack that works, but is inefficient (`new |
> bdelete`).
> > Is there another way?
>
> See
>
> :help :setf
>
> and see if the FALLBACK argument does what you want.
>
> For an example of its use, see $VIMRUNTIME/filetype.vim.
>
> HTH,
> Gary
>
>
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/ee396ecc-91a1-416c-b5ab-8119da5059a0n%40googlegroups.com.