Skip to content

Commit

Permalink
chore: use a more unique and unlikely-to-be-searched string
Browse files Browse the repository at this point in the history
  • Loading branch information
LangLangBart committed Oct 8, 2023
1 parent 633469d commit b286f5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions gh-find-code
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ gh_query() {
# create a unique list of patterns separated by a vertical line to use in
# extended grep
patterns: ([.value.text_matches[] | .. | .text? | select(type=="string")] as $patterns_array |
if $patterns_array == [] then "null" else $patterns_array | unique | join("|") end)
if $patterns_array == [] then "__NoPatternFound__" else $patterns_array | unique | join("|") end)
} | [.index, .owner_repo_name, .file_name, .file_path, .patterns] | @tsv)' 2>"$store_gh_search_debug"); then
{
error_encountered=false
Expand Down Expand Up @@ -331,7 +331,7 @@ gh_query() {
} >>"${store_file_contents}_${index}"
fi
index_color="$RED_NORMAL"
patterns="null"
patterns="__NoPatternFound__"
fi

curl --silent \
Expand All @@ -344,7 +344,7 @@ gh_query() {
fi

line_numbers=()
[[ $patterns != "null" ]] && while IFS='' read -r matched_line; do
[[ $patterns != "__NoPatternFound__" ]] && while IFS='' read -r matched_line; do
line_numbers+=("$matched_line")
# '--' is used as an indicator to signify the end of command options.
# After this, 'sanitized_patterns' is treated as an argument, not as
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export FZF_DEFAULT_OPTS="
macOS?](https://superuser.com/questions/496090/how-to-use-alt-commands-in-a-terminal-on-os-x)

### Pager
- If the `PAGER` environment variable is set to `less` or `bat`, when opening the destination file, it
will automatically scroll to the matching line found.
- If the `PAGER` environment variable is set to `less` or `bat`, when opening the destination file,
it will automatically scroll to the matching line found.

---

Expand Down

0 comments on commit b286f5a

Please sign in to comment.