Skip to content
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

the plugin do not start on rmd filetype #13

Closed
olesendan opened this issue Jan 22, 2022 · 7 comments
Closed

the plugin do not start on rmd filetype #13

olesendan opened this issue Jan 22, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@olesendan
Copy link

Hi Jake.

On my system, when I'm opening rmd filetypes, The plugin do not start automatic. I can start the plugin maunally with ':Mkdnflow'. when I run ':set filetype' the value is rmd.

When I open a filetype 'md' the plugin starts automatic.

I'm uncertain how to debug this, so please advise me, for more information.

system:
Archlinux
NVIM: v0.6.1

@jakewvincent
Copy link
Owner

Hi Dan--Another R user! Now I'm curious what field you're in. Anyway, I've noticed some slight oddities myself with rmd filetypes but haven't looked into them much yet. I'll look into this soon. Hopefully it's an easy fix.

@jakewvincent
Copy link
Owner

@olesendan Can you share your config for the plugin, in particular the filetypes key (if you've modified the default value at all)?

@olesendan
Copy link
Author

Hi Jake.

I'm just rolling with the default config. so is just doing a
local plug = require 'mkdnflow' plug.setup({})
greetings from denmark
Dan Olesen

@jakewvincent jakewvincent self-assigned this Jan 30, 2022
@jakewvincent
Copy link
Owner

Hmm, I'm actually having trouble reproducing this (even though I thought I was having this issue myself). Can you tell me what happens if you add the following to the setup function?

filetypes = {md = true, rmd = true}

@olesendan
Copy link
Author

olesendan commented Feb 2, 2022

Hi Jake.

I've been investigating this issue a bit. I tried your suggestion, but without success. Then I tried to open a file with the ext. 'foobar.rmd' and then the plugin is loaded. Then I tested with 'foobar.Rmd' and the plugin did not load. I have looked in to the sourcecode, and my understanding is that the plugin uses the ext of the file instead of filetype.
I would like to suggest that you change the filetype function to get the filetype from the buffer maybe with 'vim.bo.filetype' OR "vim.api.nvim_buf_get_option(0, 'filetype')"

I can try to make a PR with a working solution?

Greetings from denmark.
Dan Olesen

@jakewvincent
Copy link
Owner

OMG, of course it's something as simple as case. At some point I decided to flout the capitalization convention and use a lowercase "r" in my rmd document extensions, so that's why I was having trouble reproducing it. Thank you for looking into this more! I just added a fix--could you update and test for me?

I would like to suggest that you change the filetype function to get the filetype from the buffer maybe with 'vim.bo.filetype' OR "vim.api.nvim_buf_get_option(0, 'filetype')"

I can try to make a PR with a working solution?

If you can get something working, I would be open to changing the method used in the plugin. What you suggest is what I initially wanted to do, but I couldn't get it to work; the plugin would never load. My impression was that the config was sourced before the filetype was determined, so the buffer filetype was 'nil' when my plugin tried to check it, which is of course not a match to any of the acceptable filetypes. It's very possible I missed something.

@jakewvincent
Copy link
Owner

Dan, my testing suggests this issue has been resolved, so I'm closing it now. Please let me know if it isn't resolved for you after updating.

@jakewvincent jakewvincent added the bug Something isn't working label Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants