Closed olivroy closed 1 year ago
cli converts hyperlinks to files to absolute file://
links, because relative file:
links do not exist. They would not make sense anyway, because different processes have different working directories, and the process you run with the click might be different from the process creating the link.
cli also does not open anything, it only creates the link, and then it is the job of the terminal or IDE, or the OS to decide what happens if you click on it.
So I am afraid that you'll need to take this up with RStudio. It would make sense to avoid opening the same file twice.
As a package developer, how do you cope with that when debugging? (or is it just an issue on Windows?) For example, you have a .R file opened with a short path.
short path: ~/path/to/file.R
long path: C:/.../path/to/file.R
Workflow example:
file.R
with the short path (with Ctrl/Cmd + .)load_all()
Any recommendation on how you avoid that?
Thanks
As a package developer, how do you cope with that when debugging?
I usually use a different editor, so I am afraid that I can't give you advice on this.
Any recommendation on how you avoid that?
Report an issue to RStudio. The IDE should recognize that the file is already open, especially because AFAIR you should not be able to open the same file twice.
Hello,
I was wondering if it was possible to open files with a relative path. (Windows)
https://cli.r-lib.org/reference/links.html#files
I usually open files with 5 ways, the first 4 are consistent, but {.file } is not. (when in Project)
Opening a file from Ctrl + .,
Files pane in RStudio,
Find in Files RStudio
or with
usethis::edit_file()
With cli {.file } hyperlinks
to 4. open with a relative path "~/path/to/file.R" (when hovering over the tab) in RStudio, so avoid opening the same file in 2 different tabs. Clicking on
opens a 'new' file (duplicate tab) When hovering over it, I see that the path is "C:/Users/.../path/to/file.R"
RStudio doesn't recognize that they are the same file, so they are open twice.
I would expect the cli hyperlink to just change the focus of the source, instead of opening 2 instances of the file.