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

Allow switching to source editor by document ID #250

Open
gadenbuie opened this issue Feb 22, 2022 · 1 comment
Open

Allow switching to source editor by document ID #250

gadenbuie opened this issue Feb 22, 2022 · 1 comment

Comments

@gadenbuie
Copy link
Member

AFAICT it's currently not possible to activate a source editor by document ID, which makes unsaved documents inaccessible to automation when they lose focus.

library(rstudioapi)

documentNew("# first document")
id1 <- getSourceEditorContext()

# we have context for first document, open a second doc
documentNew("# second document")
id2 <- getSourceEditorContext()

# cannot re-activate first document
@gadenbuie
Copy link
Member Author

gadenbuie commented Feb 22, 2022

I just followed a few internal Slack conversation threads and realized that rstudio/rstudio#8938 is intended to support a feature like this where the proposal was for

something like documentActivate(), that accepts either a document ID or a document path.

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

1 participant