From 407b6e6262382231e79d9e7d9b0ab541f4b6486d Mon Sep 17 00:00:00 2001 From: LoricAndre Date: Fri, 8 Nov 2024 10:42:15 +0100 Subject: [PATCH] fix: reserve --tmux until it is implemented --- shell/completion.bash | 14 +++++++++----- shell/completion.zsh | 3 ++- skim/src/options.rs | 28 +++++++++++++++------------- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/shell/completion.bash b/shell/completion.bash index 6aae1f8d..fc26d86f 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -19,7 +19,7 @@ _sk() { case "${cmd}" in sk) - opts="-t -n -d -e -b -m -c -i -p -q -1 -0 -f -x -h --tac --no-sort --tiebreak --nth --with-nth --delimiter --exact --regex --algo --case --bind --multi --no-multi --no-mouse --cmd --interactive --color --no-hscroll --keep-right --skip-to-pattern --no-clear-if-empty --no-clear-start --no-clear --show-cmd-error --layout --reverse --height --no-height --min-height --margin --prompt --cmd-prompt --ansi --tabstop --inline-info --header --header-lines --tmux --history --history-size --cmd-history --cmd-history-size --preview --preview-window --query --cmd-query --expect --read0 --print0 --print-query --print-cmd --print-score --select-1 --exit-0 --sync --pre-select-n --pre-select-pat --pre-select-items --pre-select-file --filter --extended --literal --cycle --hscroll-off --filepath-word --jump-labels --border --no-bold --info --pointer --marker --phony --help" + opts="-t -n -d -e -b -m -c -i -I -p -q -1 -0 -f -x -h --tac --no-sort --tiebreak --nth --with-nth --delimiter --exact --regex --algo --case --bind --multi --no-multi --no-mouse --cmd --interactive --color --no-hscroll --keep-right --skip-to-pattern --no-clear-if-empty --no-clear-start --no-clear --show-cmd-error --layout --reverse --height --no-height --min-height --margin --prompt --cmd-prompt --ansi --tabstop --inline-info --header --header-lines --history --history-size --cmd-history --cmd-history-size --preview --preview-window --query --cmd-query --expect --read0 --print0 --print-query --print-cmd --print-score --select-1 --exit-0 --sync --pre-select-n --pre-select-pat --pre-select-items --pre-select-file --filter --tmux --extended --literal --cycle --hscroll-off --filepath-word --jump-labels --border --no-bold --info --pointer --marker --phony --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -77,6 +77,10 @@ _sk() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; + -I) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; --color) COMPREPLY=($(compgen -f "${cur}")) return 0 @@ -125,10 +129,6 @@ _sk() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; - --tmux) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; --history) COMPREPLY=($(compgen -f "${cur}")) return 0 @@ -193,6 +193,10 @@ _sk() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; + --tmux) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; --hscroll-off) COMPREPLY=($(compgen -f "${cur}")) return 0 diff --git a/shell/completion.zsh b/shell/completion.zsh index 30f1d1e4..91aba866 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -28,6 +28,7 @@ _sk() { '*--bind=[Comma separated list of bindings]:BIND:_default' \ '-c+[Command to invoke dynamically in interactive mode]:CMD:_default' \ '--cmd=[Command to invoke dynamically in interactive mode]:CMD:_default' \ +'-I+[Replace replstr with the selected item in commands]:REPLSTR:_default' \ '--color=[Set color theme]:COLOR:_default' \ '--skip-to-pattern=[Show the matched pattern at the line start]:SKIP_TO_PATTERN:_default' \ '--layout=[Set layout]:LAYOUT:(default reverse reverse-list)' \ @@ -40,7 +41,6 @@ _sk() { '--tabstop=[Number of spaces that make up a tab]:TABSTOP:_default' \ '--header=[Set header, displayed next to the info]:HEADER:_default' \ '--header-lines=[Number of lines of the input treated as header]:HEADER_LINES:_default' \ -'--tmux=[Run in a tmux popup]' \ '--history=[History file]:HISTORY:_default' \ '--history-size=[Maximum number of query history entries to keep]:HISTORY_SIZE:_default' \ '--cmd-history=[Command history file]:CMD_HISTORY:_default' \ @@ -57,6 +57,7 @@ _sk() { '--pre-select-file=[Pre-select the items read from this file]:PRE_SELECT_FILE:_default' \ '-f+[Query for filter mode]:FILTER:_default' \ '--filter=[Query for filter mode]:FILTER:_default' \ +'--tmux=[Reserved for later use]' \ '--hscroll-off=[Reserved for later use]:HSCROLL_OFF:_default' \ '--jump-labels=[Reserved for later use]:JUMP_LABELS:_default' \ '--tac[Show results in reverse order]' \ diff --git a/skim/src/options.rs b/skim/src/options.rs index e1f843c3..d6284367 100644 --- a/skim/src/options.rs +++ b/skim/src/options.rs @@ -463,19 +463,6 @@ pub struct SkimOptions { #[arg(long, default_value = "0", help_heading = "Display")] pub header_lines: usize, - /// Run in a tmux popup - /// - /// Format: sk --tmux [,SIZE[%]][,SIZE[%]] - /// - /// Depending on the direction, the order and behavior of the sizes varies: - /// - center: (width, height) or (size, size) if only one is provided - /// - top | bottom: (height, width) or height = size, width = 100% if only one is provided - /// - left | right: (width, height) or height = 100%, width = size if only one is provided - /// - /// Default: center,50% - #[arg(long, verbatim_doc_comment, help_heading = "Display", default_missing_value = "center,50%", num_args=0..)] - pub tmux: Option, - // --- History --- /// History file /// @@ -646,6 +633,21 @@ pub struct SkimOptions { #[arg(long, short, help_heading = "Scripting")] pub filter: Option, + /// Reserved for later use + /// + /// Run in a tmux popup + /// + /// Format: sk --tmux [,SIZE[%]][,SIZE[%]] + /// + /// Depending on the direction, the order and behavior of the sizes varies: + /// - center: (width, height) or (size, size) if only one is provided + /// - top | bottom: (height, width) or height = size, width = 100% if only one is provided + /// - left | right: (width, height) or height = 100%, width = size if only one is provided + /// + /// Default: center,50% + #[arg(long, verbatim_doc_comment, help_heading = "Display", default_missing_value = "center,50%", num_args=0..)] + pub tmux: Option, + /// Reserved for later use #[arg(short = 'x', long, hide = true, help_heading = "Reserved for later use")] pub extended: bool,