Skip to content

Commit

Permalink
confirm, read-key: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Oct 10, 2024
1 parent c48e182 commit 4098286
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions commands/confirm
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ function confirm_() (
# renders
local options_unselected=() options_selected=() options_results=() selected_index='' selectable_count selectable_last yes_index no_index='' abort_index
if test "$option_mode" = 'positive' -o "$option_mode" = 'negative' -o "$option_mode" = 'bool'; then
# if it appears dim, it is because your terminal theme has changed and you haven't opened a new terminal tab
if is-color-enabled --; then
options_selected+=(
"$(echo-style "$legend_indent" --invert+legend+green+bold=' YES ' --key+green+bold='Y')"
Expand Down
6 changes: 3 additions & 3 deletions commands/read-key
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ function read_key() (

local inputs='' input='' last_key=''
if (: </dev/tty >/dev/tty) &>/dev/null; then # is-tty but copied for performance
function discard_key_if_line_buffer_enter {
function __discard_key_if_line_buffer_enter {
return 1
}
else
function discard_key_if_line_buffer_enter {
function __discard_key_if_line_buffer_enter {
test "$input" = $'\n' -a -n "$last_key" -a "$last_key" != $'\n'
}
fi
Expand All @@ -266,7 +266,7 @@ function read_key() (
if test "$input" = $'\e' -o "$input" = $'\n'; then
flush
fi
if discard_key_if_line_buffer_enter; then
if __discard_key_if_line_buffer_enter; then
if test "$option_keep_line_buffer_newlines" = 'yes'; then
printf '%s\n' 'line-buffer'
fi
Expand Down

0 comments on commit 4098286

Please sign in to comment.