From 739592d5a0cb6a69f0efc56b1461d5f851370b85 Mon Sep 17 00:00:00 2001 From: LangLangbart <92653266+LangLangBart@users.noreply.github.com> Date: Fri, 23 Aug 2024 03:53:42 +0200 Subject: [PATCH] chore: update fzf to 0.54.0 --- .pre-commit-config.yaml | 6 +++--- gh-find-code | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 093437f..160ab83 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/crate-ci/typos - rev: v1.22.9 + rev: v1.23.7 hooks: - id: typos args: [--format, brief, --write-changes] @@ -49,7 +49,7 @@ repos: name: shfmt args: [--simplify, --indent 0, --case-indent, --write] - repo: https://github.com/lyz-code/yamlfix - rev: 1.16.0 + rev: 1.17.0 hooks: - id: yamlfix - repo: https://github.com/tcort/markdown-link-check @@ -59,7 +59,7 @@ repos: name: markdown link check args: [--quiet] - repo: https://github.com/commitizen-tools/commitizen - rev: v3.27.0 + rev: v3.29.0 hooks: - id: commitizen stages: [commit-msg] diff --git a/gh-find-code b/gh-find-code index 43d8fd3..06a6c80 100755 --- a/gh-find-code +++ b/gh-find-code @@ -5,8 +5,6 @@ set -o allexport -o errexit -o errtrace -o nounset -o pipefail # TODO: lookout for Github adding regex support to the REST or GraphQL API # TODO: add tests - https://github.com/dodie/testing-in-bash # TODO: replace python with a more typical bash solution -# TODO: Use the new '--info-command' from fzf 0.54.0 for the history and apply 'ctrl-t' to search -# for context, similar to 'zdharma-continuum/history-search-multi-word' ############################################################################### # Environment Variables @@ -145,7 +143,7 @@ gh_accept_text_match="Accept: application/vnd.github.text-match+json" gh_rest_api_version="X-GitHub-Api-Version:2022-11-28" # https://github.com/junegunn/fzf/releases/tag/0.52.0 -min_fzf_version="0.52.0" +min_fzf_version="0.54.0" # a bug with 'gh-browse' with relative paths was fixed # https://github.com/cli/cli/issues/7674 min_gh_version="2.37.0" @@ -650,7 +648,7 @@ gh_query() { # Escape special charters before using the string in extended 'grep'. # However, the "|" character should be left unescaped. - sanitized_patterns=$(command sed -e 's/[][?*+.$^()]/\\&/g' <<<"$patterns") + sanitized_patterns=$(command sed -e 's/[][?*+.$^(){}]/\\&/g' <<<"$patterns") line_numbers=() [[ $patterns != "__NoPatternFound__" ]] && while IFS='' read -r matched_line; do # Ensure only valid numbers are included @@ -816,7 +814,7 @@ view_contents() { # Basic style for 'fzf'; useful tool: https://vitormv.github.io/fzf-themes/ # IMPORTANT: anything after "$@" will overwrite options in the actual command fzf_basic_style() { - : | command fzf -- \ + command fzf -- \ --ansi \ --bind 'scroll-up:offset-up,scroll-down:offset-down' \ --border block \ @@ -838,7 +836,6 @@ fzf_basic_style() { --scroll-off 3 \ --scrollbar '│▐' \ --separator '' \ - --sync \ --unicode \ --with-shell "${execution_shell:-"$(which bash) -c"}" \ "$@"