Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/cliPublic

Configurable file hyperlinks#744

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gaborcsardi merged 14 commits intomainfromconfigurable-file-hyperlinks
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
14 commits
Select commitHold shift + click to select a range
6bb0b21
Make file hyperlinks configurable
jennybcDec 13, 2024
55c2eb3
Increment version number to 3.6.3.9002
jennybcDec 16, 2024
4e31755
Test helpers that parse and interpolate file link parameters
jennybcDec 17, 2024
f4e7c06
Add docs
jennybcDec 17, 2024
1282f7d
Seems like a good idea
jennybcDec 18, 2024
7edf052
Formatting problems
jennybcDec 18, 2024
544507e
Deal with more path pre-processing; add more tests
jennybcDec 18, 2024
cfe015c
Possible fix for Windows
jennybcDec 18, 2024
3e19f79
Actual fix for Windows
jennybcDec 19, 2024
8757629
Tweaks to comments and docs
jennybcDec 20, 2024
c6bea43
Fix tests if hyperlink format env var is set
gaborcsardiJan 9, 2025
a5a96c7
Set correct baseline for file URLs in test_that_cli()
jennybcJan 9, 2025
9316386
Update NEWS bullet
jennybcJan 9, 2025
79bbe8f
Stick with the status quo
jennybcJan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Stick with the status quo
It appears this is what cli has always done with a leading `./`, so just keep doing that until there's reason not to.
  • Loading branch information
@jennybc
jennybc committedJan 10, 2025
commit79bbe8fae7719bc9b8d1e3653c5f5960607042a6
2 changes: 1 addition & 1 deletionR/ansi-hyperlink.R
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -101,7 +101,7 @@ construct_file_link <- function(params) {

params$path <- sub("^file://", "", params$path)
params$path <- path.expand(params$path)

looks_absolute <- function(path) {
grepl("^/", params$path) || (is_windows() && grepl("^[a-zA-Z]:", params$path))
}
Expand Down
19 changes: 12 additions & 7 deletionstests/testthat/test-ansi-hyperlink.R
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -564,13 +564,18 @@ test_that("construct_file_link() works with custom format and a relative path",
"positron://file/working/directory/relative/path:12:5"
)

# FAILING, what do I want to do here?
# expect_equal(
# sanitize_wd2(construct_file_link(list(path = "./relative/path"))),
# "positron://file/working/directory/relative/path"
# )
# line
# line and column
expect_equal(
sanitize_dir(construct_file_link(list(path = "./relative/path")), what = "wd"),
"positron://file/working/directory/./relative/path"
)
expect_equal(
sanitize_dir(construct_file_link(list(path = "./relative/path:12")), what = "wd"),
"positron://file/working/directory/./relative/path:12"
)
expect_equal(
sanitize_dir(construct_file_link(list(path = "./relative/path:12:5")), what = "wd"),
"positron://file/working/directory/./relative/path:12:5"
)

expect_equal(
sanitize_dir(construct_file_link(list(path = "~/relative/path")), what = "home"),
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp