Optimization: initialize highlighting's cache only once per run

This commit is contained in:
Sebastian Gniazdowski 2016-10-24 13:05:16 +02:00
parent eefe1f1149
commit 2e4c70638c

View file

@ -42,6 +42,7 @@ _hsmw_main() {
zstyle -s ":plugin:history-search-multi-word" synhl __hsmw_synhl || __hsmw_synhl="yes" zstyle -s ":plugin:history-search-multi-word" synhl __hsmw_synhl || __hsmw_synhl="yes"
zstyle -s ":plugin:history-search-multi-word" active __hsmw_active || __hsmw_active="underline" zstyle -s ":plugin:history-search-multi-word" active __hsmw_active || __hsmw_active="underline"
[[ "$__hsmw_synhl" != "1" && "$__hsmw_synhl" != "yes" && "$__hsmw_synhl" != "true" ]] && __hsmw_synhl="no" || __hsmw_synhl="yes" [[ "$__hsmw_synhl" != "1" && "$__hsmw_synhl" != "yes" && "$__hsmw_synhl" != "true" ]] && __hsmw_synhl="no" || __hsmw_synhl="yes"
-hsmw-highlight-init
fi fi
# '0' will get changed into $to_display limit # '0' will get changed into $to_display limit
@ -128,7 +129,6 @@ _hsmw_main() {
region_highlight=( ) region_highlight=( )
if [[ "$__hsmw_synhl" = "yes" ]]; then if [[ "$__hsmw_synhl" = "yes" ]]; then
-hsmw-highlight-init
integer pre_index=0 integer pre_index=0
local line local line
for line in "${disp_list[@]}"; do for line in "${disp_list[@]}"; do