fzf/shell
Koichi Murase 1dbdb9438f [bash] Refactor access to "_fzf_orig_complete_${cmd//[^A-Za-z0-9_]/_}"
In the current codebase, for the original completion settings, the
pieces of the codes to determine the variable name and to access the
stored data are scattered.  In this patch, we define functions to
access these variables.  Those functions will be used in a coming
patch.

* This patch also resolves an inconsistent escaping of "$cmd": $cmd is
  escaped as ${...//[^A-Za-z0-9_]/_} in some places, but it is escaped
  as ${...//[^A-Za-z0-9_=]/_} in some other places.  The latter leaves
  the character "=" in the command name, which causes an issue because
  "=" cannot be a part of a variable name.  For example, the following
  test case produces an error message:

  $ COMP_WORDBREAKS=${COMP_WORDBREAKS//=}
  $ _test1() { COMPREPLY=(); }
  $ complete -vF _test1 cmd.v=1.0
  $ _fzf_setup_completion path cmd.v=1.0
  $ cmd.v=1.0 [TAB]
  bash: _fzf_orig_completion_cmd_v=1_0: invalid variable name

  The behavior of leaving "=" was present from the beginning when
  saving the original completion is introduced in commit 91401514, and
  this does not seem to be a specific reasoning.  In this patch, we
  replace "=" as well as the other non-identifier characters.

* Note: In this patch, the variable REPLY is used to return values
  from functions.  This design is to make it useful with the value
  substitutions, a new Bash feature of the next release 5.3, which is
  taken from mksh.
2024-03-10 21:41:42 +09:00
..
completion.bash [bash] Refactor access to "_fzf_orig_complete_${cmd//[^A-Za-z0-9_]/_}" 2024-03-10 21:41:42 +09:00
completion.zsh [completion] Handle all hostaliases in /etc/hosts (#3495) 2023-10-29 09:05:30 +09:00
key-bindings.bash [bash] Use command to “protect” further commands (#3462) 2023-10-11 13:07:47 +09:00
key-bindings.fish [fish] exit as well when called from non-interactive shell (#3467) 2023-10-13 01:06:55 +09:00
key-bindings.zsh [zsh] Handle '*' suffix in history line numbers 2024-01-20 13:43:15 +09:00