-
Notifications
You must be signed in to change notification settings - Fork 105
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
markdown filetype check: use get() #363
Conversation
Hmm, I think maybe we'd better fix the root cause of this issue. I suspect my da4c0b0 commit is to blame here. I'm having trouble understanding the sequence of events though because in some cases this does not seem to be a problem. Do you understand when ftdetect code gets run in relation to the plugin itself? Where do we need to set this in the first place? |
I once encountered a similar issue and this is what I learned: neomutt/neomutt.vim#4 (comment) |
Since vim plugins are generally installed straight from the master branch on github, could we maybe just revert da4c0b0 on master for now? |
@timokau No I'm sorry but I'm not just going to revert that commit, it fixes another issue that was an active problem for many people and we were getting more and more reports of it. This issue is just a warning message on startup, that was a full on breaker. I'm happy to fix this issue too, but we need to figure out the right way to do that. @doronbehar I've reviewed that other PR and the comment you liked, but I don't think they are the same issue at all. Could you be more specific? |
I think I see what's going on, we have a regular land grab going on and there are actually two possible race conditions. I'll try to patch up the other half of it as an extension to this PR. |
@alerque I think the proposed solution would solve the problem. I can't reproduce the issue, though, it might be useful if @doronbehar would provide us with the output of |
@alerque TBH now that I'm thinking about it, I'm not sure that idea is relevant. But it's pretty simple - don't use Sorry for not suggesting a patch with broader changes, it's just that The relevant documentation for this What confuses me is the fact there are 2 settings with somewhat colliding purposes:
And:
Which makes #342 legitimate. FWIW, I think using |
@fmoralesc I think I actually figured out the problematic scenario. As @doronbehar points out though there are actually two competing systems in the same plugin and different plugin managers handle leading in different orders. I believe using |
@alerque Great to hear! (BTW, sorry I haven't been around more, I've been crunching my thesis.) @doronbehar I think you are right about the settings, it might even be a good idea to remove |
@fmoralesc Dropping The ftdetect setting the filetype for *.pandoc etc files makes perfect sense but whas is the actual advantage of force-changing the filetype of things already detected as markdown to pandoc vs. loading the plugin functions anyway and leaving the filetype alone? Right now both ways seems to work for me and I think it would make sense to drop the former (i.e. not have a |
whas is the actual advantage of force-changing the filetype of things
already detected as markdown to pandoc vs. loading the plugin functions
anyway and leaving the filetype alone?
To load our syntax file instead of the markdown syntax file (I haven't
tested how that combination works in ages.) Remember that the original
version of vim-pandoc 'bundle' included the syntax file.
…On Wed, Mar 18, 2020 at 6:43 PM Caleb Maclennan ***@***.***> wrote:
@fmoralesc <https://github.com/fmoralesc> Dropping
g:#filetypes#pandoc_markdown would definitely simply things. There are
currently not even two but three general ways the plugin could get
triggered. This is definitely part of the issue with #342
<#342> and general
confusion over when this plugin is running vs. what the filetype is.
The ftdetect setting the filetype for *.pandoc etc files makes perfect
sense but whas is the actual advantage of force-changing the filetype of
things already detected as markdown to pandoc vs. loading the plugin
functions anyway and leaving the filetype alone? Right now both ways seems
to work for me and I think it would make sense to drop the former (i.e. not
have a pandoc_markdown setting at all and just "handle" and load the
plugin for markdown file types.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#363 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABWCGJGVHBI274RY2ZATPTRIEB5PANCNFSM4LJH6EYQ>
.
|
I agree. Usually, when a plugin introduces a new filetype, it instructs users to add appropriate lines to their
Maybe vim-pandoc should drop all |
The reason all of this was setup like this was that ideally the user
wouldn't have to configure anything to use the plugin with reasonable
defaults. The other reason is that the pandoc functionality is mostly
independent of the filetype, due to pandoc's own handling of multiple
filetypes; so I designed it to work more or less like an Emacs (gasp!)
minor mode...
…On Wed, Mar 18, 2020 at 7:02 PM Doron Behar ***@***.***> wrote:
The ftdetect setting the filetype for *.pandoc etc files makes perfect
sense but whas is the actual advantage of force-changing the filetype of
things already detected as markdown to pandoc vs. loading the plugin
functions anyway and leaving the filetype alone?
I agree. Usually, when a plugin introduces a new filetype, it instructs
users to add appropriate lines to their filetype.vim, such as:
au BufNewFile,BufRead *.md setf pandoc
Maybe vim-pandoc should drop all pandoc#filetypes# settings and instruct
using lines such as this instead?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#363 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABWCGJ5O3GWQ5JC5CRHIRLRIEEDVANCNFSM4LJH6EYQ>
.
|
That's understandable, but that's the idea of
TBH, I've checked with many filetype-introducing plugins and only few of them use And I found another example in my own set of plugins: You can test that with these plugins installed and along with an appropriate line in your own |
This is an emergency fix for the plugin managers that run plugins before any ftdetect has happened (or inhibit it ever happening). It is not a permanent fix (which we're kind of agreed with involve dropping this setting entirely), it's just a hold over.
As a tide-over until we can get the file type handling worked out to everybody's satisfaction I added a commit to this PR to never bother setting |
The vim-pandoc patch is now outdated and has been replaced by a better workaround upstream: vim-pandoc/vim-pandoc#363
Fixes this startup error for me:
Might fix (NOT) #342 as well.