Skip to content

Commit

Permalink
Merge pull request #45 from Eriner/master
Browse files Browse the repository at this point in the history
convert ksh functions to POSIX syntax
  • Loading branch information
sunaku committed Sep 28, 2015
2 parents c4a8356 + e2ab5b8 commit 2c29543
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions zsh-history-substring-search.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i'
# the main ZLE widgets
#-----------------------------------------------------------------------------

function history-substring-search-up() {
history-substring-search-up() {
_history-substring-search-begin

_history-substring-search-up-history ||
Expand All @@ -59,7 +59,7 @@ function history-substring-search-up() {
_history-substring-search-end
}

function history-substring-search-down() {
history-substring-search-down() {
_history-substring-search-begin

_history-substring-search-down-history ||
Expand Down Expand Up @@ -90,7 +90,7 @@ if [[ $+functions[_zsh_highlight] -eq 0 ]]; then
# simply removes any existing highlights when the
# user inserts printable characters into $BUFFER.
#
function _zsh_highlight() {
_zsh_highlight() {
if [[ $KEYS == [[:print:]] ]]; then
region_highlight=()
fi
Expand Down Expand Up @@ -173,7 +173,7 @@ if [[ $+functions[_zsh_highlight] -eq 0 ]]; then
_zsh_highlight_bind_widgets
fi

function _history-substring-search-begin() {
_history-substring-search-begin() {
setopt localoptions extendedglob

_history_substring_search_refresh_display=
Expand Down Expand Up @@ -239,7 +239,7 @@ function _history-substring-search-begin() {
fi
}

function _history-substring-search-end() {
_history-substring-search-end() {
setopt localoptions extendedglob

_history_substring_search_result=$BUFFER
Expand Down Expand Up @@ -275,7 +275,7 @@ function _history-substring-search-end() {
return 0
}

function _history-substring-search-up-buffer() {
_history-substring-search-up-buffer() {
#
# Check if the UP arrow was pressed to move the cursor within a multi-line
# buffer. This amounts to three tests:
Expand Down Expand Up @@ -304,7 +304,7 @@ function _history-substring-search-up-buffer() {
return 1
}

function _history-substring-search-down-buffer() {
_history-substring-search-down-buffer() {
#
# Check if the DOWN arrow was pressed to move the cursor within a multi-line
# buffer. This amounts to three tests:
Expand Down Expand Up @@ -333,7 +333,7 @@ function _history-substring-search-down-buffer() {
return 1
}

function _history-substring-search-up-history() {
_history-substring-search-up-history() {
#
# Behave like up in ZSH, except clear the $BUFFER
# when beginning of history is reached like in Fish.
Expand All @@ -355,7 +355,7 @@ function _history-substring-search-up-history() {
return 1
}

function _history-substring-search-down-history() {
_history-substring-search-down-history() {
#
# Behave like down-history in ZSH, except clear the
# $BUFFER when end of history is reached like in Fish.
Expand All @@ -378,7 +378,7 @@ function _history-substring-search-down-history() {
return 1
}

function _history-substring-search-not-found() {
_history-substring-search-not-found() {
#
# Nothing matched the search query, so put it back into the $BUFFER while
# highlighting it accordingly so the user can revise it and search again.
Expand All @@ -388,7 +388,7 @@ function _history-substring-search-not-found() {
_history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND
}

function _history-substring-search-up-search() {
_history-substring-search-up-search() {
_history_substring_search_refresh_display=1

#
Expand Down Expand Up @@ -484,7 +484,7 @@ function _history-substring-search-up-search() {
fi
}

function _history-substring-search-down-search() {
_history-substring-search-down-search() {
_history_substring_search_refresh_display=1

#
Expand Down

0 comments on commit 2c29543

Please sign in to comment.