@@ -134,8 +134,8 @@ _tfind_main() {
134134 zstyle -s " :plugin:zinit:symbol-search" macro-color __tfind_macro_color || __tfind_macro_color=" fg=208,bold"
135135 zstyle -s " :plugin:zinit:symbol-search" eqdol-color __tfind_eqdol_color || __tfind_eqdol_color=" fg=69,bold"
136136
137- # Find the index to operate on, git dir, etc.
138- _tfind_find_index || { _tfind_error_msg && return ; }
137+ # Find the index to operate on, git dir, etc.
138+ _tfind_find_index || { _tfind_error_msg; return ; }
139139 fi
140140
141141 # '0' will get changed into $to_display limit
@@ -216,9 +216,7 @@ _tfind_main() {
216216 #
217217 local noun=${${${__tfind_spe_funct:# 0} : +function} :- symbol}
218218 local preamble=$' \n ' " View of ${noun} s for repo: «««${(U)TAG[git-or-project]} »»» located at: $TAG [repo-dir]:h" $' \n ' " ${(C)noun} no. #$__tfind_spe_index . Found $max_index ${noun} s in the index." $' \n ' \
219- key=" Ctrl-f to toggle functions-ONLY view. Alt-s to toggle sort." $' \n '
220- preamble+=$key
221-
219+ key=" Ctrl-F to toggle functions-ONLY view. Alt-s to toggle sort." $' \n '
222220 local text=" ${(F)disp_list} "
223221 integer offset=${# preamble} +$buflen
224222
@@ -236,7 +234,7 @@ _tfind_main() {
236234 : " ${preamble// (# b)no. ([^.]## )./ $((coloratt(buflen,mbegin[1],mend[1],0)))} "
237235 : " ${preamble// (# b)Found ([0-9]## )/ $((coloratt(buflen,mbegin[1],mend[1],1)))} "
238236 : " ${preamble// (# b)» located at: ([^$p]## )/ $((coloratt(buflen,mbegin[1],mend[1],1)))} "
239- : " ${preamble// (# b)(Ctrl-f )/ $((coloratt(buflen,mbegin[1],mend[1],0)))} "
237+ : " ${preamble// (# b)(Ctrl-F )/ $((coloratt(buflen,mbegin[1],mend[1],0)))} "
240238 : " ${preamble// (# b)(Alt-s)/ $((coloratt(buflen,mbegin[1],mend[1],0)))} "
241239 : " ${text// ((# s)|$p )(# b)(»)/ $((coloratt(offset,mbegin[1],mend[1],3)))} "
242240 # Basic syntax highlighting - a few keywords like C/Java type names
@@ -387,8 +385,10 @@ if [[ $__tfind_spe_call_count -eq 1 ]]; then
387385 zle -A $pup_widget saved-$pup_widget
388386 zle -N $pdown_widget _tfind_simulate_widget
389387 zle -N $pup_widget _tfind_simulate_widget
390- zle -A zle-line-pre-redraw saved-pre-redraw
391- zle -D zle-line-pre-redraw
388+ if (( $+ widgets[zle- line- pre- redraw] )) ; then
389+ zle -A zle-line-pre-redraw saved-pre-redraw
390+ zle -D zle-line-pre-redraw
391+ fi
392392 local selected_editor cd_at_edit tagtext tagline taglinebyte tagfile
393393 local -a comm
394394 comm=()
@@ -468,8 +468,11 @@ if [[ $__tfind_spe_call_count -eq 1 ]]; then
468468 zle -A saved-$pup_widget $pup_widget
469469 zle -D saved-$pdown_widget saved-$pup_widget
470470
471- zle -A saved-pre-redraw zle-line-pre-redraw
472- zle -D saved-pre-redraw
471+ if (( $+ widgets[saved- pre- redraw] )) ; then
472+ zle -A saved-pre-redraw zle-line-pre-redraw
473+ zle -D saved-pre-redraw
474+ fi
475+
473476 # Full reinitialisation at next call
474477 __tfind_spe_call_count=0
475478
0 commit comments