fix the style of several functions

I'm going to modify these functions as part of dealing with issue #3000
and don't want those changes to be masked by running the files through
`make style`.
This commit is contained in:
Kurtis Rader 2016-05-08 16:27:15 -07:00
parent 0d1d324e9f
commit 3626c39398
3 changed files with 403 additions and 377 deletions

View file

@ -1,9 +1,8 @@
# Initializations that should only be performed when entering
# interactive mode.
# This function is called by the __fish_on_interactive function, which
# is defined in config.fish.
#
# Initializations that should only be performed when entering interactive mode.
#
# This function is called by the __fish_on_interactive function, which is defined in config.fish.
#
function __fish_config_interactive -d "Initializations that should be performed when entering interactive mode"
@ -38,45 +37,69 @@ function __fish_config_interactive -d "Initializations that should be performed
set -U __fish_init_1_50_0
# Regular syntax highlighting colors
set -q fish_color_normal; or set -U fish_color_normal normal
set -q fish_color_command; or set -U fish_color_command 005fd7 purple
set -q fish_color_param; or set -U fish_color_param 00afff cyan
set -q fish_color_redirection; or set -U fish_color_redirection normal
set -q fish_color_comment; or set -U fish_color_comment red
set -q fish_color_error; or set -U fish_color_error red --bold
set -q fish_color_escape; or set -U fish_color_escape cyan
set -q fish_color_operator; or set -U fish_color_operator cyan
set -q fish_color_end; or set -U fish_color_end green
set -q fish_color_quote; or set -U fish_color_quote brown
set -q fish_color_autosuggestion; or set -U fish_color_autosuggestion 555 yellow
set -q fish_color_user; or set -U fish_color_user green
set -q fish_color_normal
or set -U fish_color_normal normal
set -q fish_color_command
or set -U fish_color_command 005fd7 purple
set -q fish_color_param
or set -U fish_color_param 00afff cyan
set -q fish_color_redirection
or set -U fish_color_redirection normal
set -q fish_color_comment
or set -U fish_color_comment red
set -q fish_color_error
or set -U fish_color_error red --bold
set -q fish_color_escape
or set -U fish_color_escape cyan
set -q fish_color_operator
or set -U fish_color_operator cyan
set -q fish_color_end
or set -U fish_color_end green
set -q fish_color_quote
or set -U fish_color_quote brown
set -q fish_color_autosuggestion
or set -U fish_color_autosuggestion 555 yellow
set -q fish_color_user
or set -U fish_color_user green
set -q fish_color_host; or set -U fish_color_host normal
set -q fish_color_valid_path; or set -U fish_color_valid_path --underline
set -q fish_color_host
or set -U fish_color_host normal
set -q fish_color_valid_path
or set -U fish_color_valid_path --underline
set -q fish_color_cwd; or set -U fish_color_cwd green
set -q fish_color_cwd_root; or set -U fish_color_cwd_root red
set -q fish_color_cwd
or set -U fish_color_cwd green
set -q fish_color_cwd_root
or set -U fish_color_cwd_root red
# Background color for matching quotes and parenthesis
set -q fish_color_match; or set -U fish_color_match cyan
set -q fish_color_match
or set -U fish_color_match cyan
# Background color for search matches
set -q fish_color_search_match; or set -U fish_color_search_match --background=purple
set -q fish_color_search_match
or set -U fish_color_search_match --background=purple
# Background color for selections
set -q fish_color_selection; or set -U fish_color_selection --background=purple
set -q fish_color_selection
or set -U fish_color_selection --background=purple
# Pager colors
set -q fish_pager_color_prefix; or set -U fish_pager_color_prefix cyan
set -q fish_pager_color_completion; or set -U fish_pager_color_completion normal
set -q fish_pager_color_description 555; or set -U fish_pager_color_description 555 yellow
set -q fish_pager_color_progress; or set -U fish_pager_color_progress cyan
set -q fish_pager_color_prefix
or set -U fish_pager_color_prefix cyan
set -q fish_pager_color_completion
or set -U fish_pager_color_completion normal
set -q fish_pager_color_description 555
or set -U fish_pager_color_description 555 yellow
set -q fish_pager_color_progress
or set -U fish_pager_color_progress cyan
#
# Directory history colors
#
set -q fish_color_history_current; or set -U fish_color_history_current cyan
set -q fish_color_history_current
or set -U fish_color_history_current cyan
end
#
@ -98,7 +121,8 @@ function __fish_config_interactive -d "Initializations that should be performed
else
# The greeting used to be skipped when fish_greeting was empty (not just undefined)
# Keep it that way to not print superfluous newlines on old configuration
test -n "$fish_greeting"; and echo $fish_greeting
test -n "$fish_greeting"
and echo $fish_greeting
end
#
@ -171,7 +195,8 @@ function __fish_config_interactive -d "Initializations that should be performed
# Notify vte-based terminals when $PWD changes (issue #906)
if test "$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal"
function __update_vte_cwd --on-variable PWD --description 'Notify VTE of change to $PWD'
status --is-command-substitution; and return
status --is-command-substitution
and return
printf '\033]7;file://%s%s\a' (hostname) (pwd | __fish_urlencode)
end
__update_vte_cwd # Run once because we might have already inherited a PWD from an old tab
@ -183,7 +208,8 @@ function __fish_config_interactive -d "Initializations that should be performed
# First check if we are on OpenSUSE since SUSE's handler has no options
# and expects first argument to be a command and second database
# also check if there is command-not-found command.
if test -f /etc/SuSE-release; and type -q -p command-not-found
if test -f /etc/SuSE-release
and type -q -p command-not-found
function __fish_command_not_found_handler --on-event fish_command_not_found
/usr/bin/command-not-found $argv[1]
end

View file

@ -15,7 +15,7 @@ function cd --description "Change directory"
return $status
end
# Avoid set completions
# Avoid set completions.
set -l previous $PWD
if test "$argv" = "-"
@ -31,7 +31,8 @@ function cd --description "Change directory"
set -l cd_status $status
if test $cd_status -eq 0 -a "$PWD" != "$previous"
set -q dirprev[$MAX_DIR_HIST]; and set -e dirprev[1]
set -q dirprev[$MAX_DIR_HIST]
and set -e dirprev[1]
set -g dirprev $dirprev $previous
set -e dirnext
set -g __fish_cd_direction prev

View file

@ -1,7 +1,6 @@
#
#Deletes an item from history
#
function history --description "Deletes an item from history"
set -l argc (count $argv)