Skip to content

Commit

Permalink
fix: reserve --tmux until it is implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
LoricAndre committed Nov 8, 2024
1 parent 56eed66 commit 407b6e6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
14 changes: 9 additions & 5 deletions shell/completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion shell/completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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)' \
Expand All @@ -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' \
Expand All @@ -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]' \
Expand Down
28 changes: 15 additions & 13 deletions skim/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <center|top|bottom|left|right>[,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<String>,

// --- History ---
/// History file
///
Expand Down Expand Up @@ -646,6 +633,21 @@ pub struct SkimOptions {
#[arg(long, short, help_heading = "Scripting")]
pub filter: Option<String>,

/// Reserved for later use
///
/// Run in a tmux popup
///
/// Format: sk --tmux <center|top|bottom|left|right>[,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<String>,

/// Reserved for later use
#[arg(short = 'x', long, hide = true, help_heading = "Reserved for later use")]
pub extended: bool,
Expand Down

0 comments on commit 407b6e6

Please sign in to comment.