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

Incompatibility with visual markdown editor #34

Open
tuberculo opened this issue Feb 3, 2021 · 5 comments
Open

Incompatibility with visual markdown editor #34

tuberculo opened this issue Feb 3, 2021 · 5 comments

Comments

@tuberculo
Copy link

When using visual markdown mode on Rstudio version 1.4, the addin does not work.

@nevrome
Copy link
Owner

nevrome commented Feb 7, 2021

Thanks for reporting this. I found some relevant documentation here and here, but I do not get this to work in the visual editor environment. I always get an empty string from rstudioapi::selectionGet() instead of my selection with rstudioapi 0.13.0.9000 and RStudio 1.4.1087.

Do you know how to use this? A PR would be very welcome.

@tuberculo
Copy link
Author

I also get an empty string when using rstudioapi::selectionGet(). However, based on kevinushey example, I've tried rstudioapi::selectionGet(id = rstudioapi::documentId(allowConsole = FALSE)) and this command works in both modes.

@nevrome
Copy link
Owner

nevrome commented Feb 7, 2021

I see - ok. I wonder if we should turn off the error selection ("highlighting") for the grammar check. That would allow us to use this interface and potentially pave the way to solve #35 as well. But we would loose a feature. What do you think @GegznaV?

@GegznaV
Copy link
Contributor

GegznaV commented Feb 7, 2021

Yes, several months ago I discovered an unsolved issue with RStudio visual mode and RStudio add-ins. Especially those, which use shortcut keys. I did not research this month if there already is an official solution/workaround.

@nevrome Is there an official way to check if visual editor mode is activated in the document of interest?

Are we talking about turning off this kind of highlighting
image
?

@nevrome
Copy link
Owner

nevrome commented Feb 7, 2021

Is there an official way to check if visual editor mode is activated in the document of interest?

Good question! I think a simple function that returns TRUE or FALSE depending on whether the visual editor mode is turned on does not exist unfortunately. Maybe we should open an issue and ask for that feature? The best we seem to have is this: https://cran.r-project.org/web/packages/rstudioapi/vignettes/visual-mode.html

Are we talking about turning off this kind of highlighting

Ja - but I only thought about turning it off for the grammar check, not the spell check. The grammar check should then report the offending text in the issue list on the bottom. It's less cool, but maybe a bit more easy for us to maintain. For the visual editor mode we can't do more anyway, even for the spellcheck.

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

No branches or pull requests

3 participants