Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/milesmcbain/fnmate
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesMcBain committed Sep 7, 2022
2 parents 7839af5 + de1fd0c commit 18a4c00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/jump.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ git_grep <- function(fn_name) {
search_regex <- fnmate_quote_regex(
glue::glue("\\b{fn_name}\\s*(<-|=)\\s*")
)
other_args <- c("grep", "-nE", search_regex, "--", "\\*.R")
search_pathspec <- fnmate_quote_regex("*.R")
other_args <- c("grep", "-nE", "--untracked", search_regex, "--", search_pathspec)
result <- system2("git", args = other_args, stdout = TRUE)

if (length(result) < 1) {
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ There are some options that affect how `fnmate` works:
* `fnmate_folder` is the name of the folder in the current working directory to place created definition files. Defaults to "R".
* `fnmate_placeholder` is the placeholder value that gets put in the function body. Defaults to `NULL`, can be set to any text.
* `fmate_searcher` is the grep tool to use for the function definition jumping helper. Valid options are `"rg"` (ripgrep), and `"git_grep"`.
* `fnmate_quote_jump_regex` can be set to `TRUE` if `Jump to function definiton` is not working due to an error in the command. This seems necessary on MacOS.
* `fnmate_quote_jump_regex` can be set to `TRUE` if `Jump to function definiton` is not working due to an error in the command. This seems necessary on MacOS and Linux, depending on the shell version.

You can modify any of these options by running, for example, `options(fnmate_quote_jump_regex = TRUE)` in your R session or in your `.Rprofile`.

# Why does this exist?

Expand Down

0 comments on commit 18a4c00

Please sign in to comment.