Skip to content

Conversation

@kevinoid
Copy link

This plugin evaluates the modeline during the autocmd BufRead event, which occurs before the modeline would normally be evaluated and, more importantly, before :filetype detect. This causes a filetype set in a modeline (e.g. // vim: set ft=foo :) not to work in cases that filetype
is set in ~/.vim/filetype.vim or a ftdetect script from a package.

This commit fixes the issue by moving the plugin to the package after directory which causes autocmd BufRead to be executed after :filetype detect as it would be if this plugin were not installed, which makes filetype (and any other settings) from the modeline override settings from ftdetect as they normally would.

Fixes: #20

This plugin evaluates the modeline during the `autocmd BufRead` event,
which occurs before the modeline would normally be evaluated and, more
importantly, before `:filetype detect`.  This causes a filetype set in a
modeline (e.g. `// vim: set ft=foo :`) not to work in cases that
filetype is set in `~/.vim/filetype.vim` or a `ftdetect` script from a
package.

This commit fixes the issue by moving the script to the package `after`
directory which causes `autocmd BufRead` to be executed after `:filetype
detect` as it would be if this plugin were not installed.

Fixes: ciaranm#20

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
ypcrts added a commit to ypcrts/securemodelines that referenced this pull request Dec 23, 2019
alexghergh added a commit to alexghergh/securemodelines that referenced this pull request Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Order of evaluation

1 participant