Skip to content

Commit

Permalink
Handle Positron unsaved documents
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Oct 22, 2024
1 parent 0f3addf commit 6ef4599
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/open.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ active_rs_doc <- function() {
# Will work for Positron >= 2024.11
# https://github.com/posit-dev/positron/issues/5112
path <- rstudioapi::getSourceEditorContext()$path

# Handle Positron unsaved docs.
if (grepl("Untitled", path)) {
return(NULL)
}
} else {
cli::cli_abort("Not in RStudio or Positron. rstudioapi problem.")
}
Expand Down

0 comments on commit 6ef4599

Please sign in to comment.