escaped newlines and tabs were expanded on recall
Kudos to Sorin Ionescu for finding this same solution independently. https://github.com/robbyrussell/oh-my-zsh/pull/215#issuecomment-811332 https://github.com/robbyrussell/oh-my-zsh/pull/215#issuecomment-1046603
This commit is contained in:
parent
4e129559a5
commit
b8c4337ddd
1 changed files with 2 additions and 7 deletions
|
|
@ -85,10 +85,7 @@ zsh-history-substring-search-backward() {
|
||||||
if [[ $WIDGET = *backward* ]]; then # we have pressed arrow-up
|
if [[ $WIDGET = *backward* ]]; then # we have pressed arrow-up
|
||||||
if [[ ($F_match_number -ge 2 && $F_match_number -le $F_number_of_matches_plus_one) ]]; then
|
if [[ ($F_match_number -ge 2 && $F_match_number -le $F_number_of_matches_plus_one) ]]; then
|
||||||
let "F_match_number = $F_match_number - 1"
|
let "F_match_number = $F_match_number - 1"
|
||||||
F_command_to_be_retrieved=$(fc -ln $F_matches[$F_match_number] $F_matches[$F_match_number])
|
F_command_to_be_retrieved=$history[$F_matches[$F_match_number]]
|
||||||
F_command_to_be_retrieved=${F_command_to_be_retrieved//\\"n"/$'\n'}
|
|
||||||
F_command_to_be_retrieved=${F_command_to_be_retrieved//\\"t"/$'\t'}
|
|
||||||
# expand newlines and tabs in multi-line commands
|
|
||||||
BUFFER=$F_command_to_be_retrieved
|
BUFFER=$F_command_to_be_retrieved
|
||||||
if [[ ((( $F_zsh_highlighting_available == 1 ) && ( $+BUFFER < $F_max_buffer_size) )) ]]; then
|
if [[ ((( $F_zsh_highlighting_available == 1 ) && ( $+BUFFER < $F_max_buffer_size) )) ]]; then
|
||||||
_zsh_highlight-zle-buffer
|
_zsh_highlight-zle-buffer
|
||||||
|
|
@ -148,9 +145,7 @@ zsh-history-substring-search-backward() {
|
||||||
fi
|
fi
|
||||||
elif [[ ($F_match_number -ge 0 && $F_match_number -le $F_number_of_matches_minus_one) ]]; then
|
elif [[ ($F_match_number -ge 0 && $F_match_number -le $F_number_of_matches_minus_one) ]]; then
|
||||||
let "F_match_number = $F_match_number + 1"
|
let "F_match_number = $F_match_number + 1"
|
||||||
F_command_to_be_retrieved=$(fc -ln $F_matches[$F_match_number] $F_matches[$F_match_number])
|
F_command_to_be_retrieved=$history[$F_matches[$F_match_number]]
|
||||||
F_command_to_be_retrieved=${F_command_to_be_retrieved//\\"n"/$'\n'}
|
|
||||||
F_command_to_be_retrieved=${F_command_to_be_retrieved//\\"t"/$'\t'}
|
|
||||||
BUFFER=$F_command_to_be_retrieved
|
BUFFER=$F_command_to_be_retrieved
|
||||||
if [[ ((( $F_zsh_highlighting_available == 1 ) && ( $+BUFFER < $F_max_buffer_size) )) ]]; then
|
if [[ ((( $F_zsh_highlighting_available == 1 ) && ( $+BUFFER < $F_max_buffer_size) )) ]]; then
|
||||||
_zsh_highlight-zle-buffer
|
_zsh_highlight-zle-buffer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue