You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Retrieving information about source document should include the mod (Source vs Visual) when applicable #266
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.
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?
Activity
GegznaV commentedon Oct 1, 2023
Is there any progress towards solving this issue?
kevinushey commentedon Oct 2, 2023
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 commentedon Oct 3, 2023
I think, the output of
rstudioapi::getActiveDocumentContext()and friends could have an additional field, e.g.,editor_modewith valuesvisualorsourceoris_visual_modewith valuesTRUEorFALSE.GegznaV commentedon 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?