Repository navigation
Use ft = { 'org' } or not? Inconsistent installation instructions
#1177
|
The README.md has installation instructions for lazy.nvim that include a filetype line, Looks like #764 asked about this (and something else) a couple of years ago, but has gone unanswered. This question isn't quite a duplicate of #764, but it's pretty close. I'm still opening a new discussion, though, in the hopes that the different subject line will make it easier to search for the issue. :-) |
Replies: 1 comment 1 reply
|
It's not an oversight you can ignore, the two specs behave differently, and the README one is the correct one. The The reason is that Neovim core ships its own if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1orgmode's if vim.b.did_ftplugin or vim.b.org_tmp_edit_window then
return
endSo it's a race for one buffer-local flag. Measured on Neovim 0.12.5 with lazy.nvim stable and orgmode at
Open So: the docs page is the one that's wrong, and "we updated one and forgot the other" looks right, just in the opposite direction from the harmless one. Keeping both keys is deliberate, not redundant, lazy.nvim ORs its handlers, so Might be worth |
It's not an oversight you can ignore, the two specs behave differently, and the README one is the correct one. The
ftline isn't a lazy-loading nicety here; without it, the first.orgfile you open in a session silently loses orgmode's ftplugin.The reason is that Neovim core ships its own
ftplugin/org.vim, and its first act is:orgmode's
ftplugin/org.luaopens with the mirror image of that guard:So it's a race for one buffer-local flag.
event = 'VeryLazy'fires afterFileType, so onnvim notes.orgcore's ftplugin gets there first, sets the flag, and wh…