Open daattali opened 1 year ago
Is there any progress towards solving this issue?
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?
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
.
@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?
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.