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

Retrieving information about source document should include the mod (Source vs Visual) when applicable #266

Open
daattali opened this issue Oct 20, 2022 · 4 comments
Milestone

Comments

@daattali
Copy link

Related to #265

When trying to work with Rmd/Qmd files, it may be helpful to know whether the script is currently open in Source or in Visual mode.

I do see that there are a few functions that are meant to work with visual mode eg. documentId(), selectionGet() - but these only work for the currently active document, so if I run them from the commandline they don't return something useful.

@GegznaV
Copy link

GegznaV commented Oct 1, 2023

Is there any progress towards solving this issue?

@kevinushey
Copy link
Contributor

Any thoughts on the right fix? Should we add something like documentEditorMode() for querying the editor mode type, or include that as part of the other "context" requests?

@GegznaV
Copy link

GegznaV commented Oct 3, 2023

I think, the output of rstudioapi::getActiveDocumentContext() and friends could have an additional field, e.g., editor_mode with values visual or source or is_visual_mode with values TRUE or FALSE.

@GegznaV
Copy link

GegznaV commented Oct 3, 2023

@kevinushey, is there a way to know which type of Visual Editor's content a cursor is in? E.g., is it in the R code block, in heading 1 or heading 3 block, or a regular text block? I.e., in theory, can this type of information be also retrieved?

@kevinushey kevinushey added this to the 0.16.0 milestone Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants