Better handling of "synhl" zstyle, via -T zstyle option

This commit is contained in:
Sebastian Gniazdowski 2016-11-05 11:44:50 +01:00
parent 9f6da82c9b
commit 4465b57f95

View file

@ -46,10 +46,9 @@ _hsmw_main() {
# Read configuration data # Read configuration data
zstyle -s ':history-search-multi-word' page-size __hsmw_page_size || __hsmw_page_size=$(( LINES / 3 )) zstyle -s ':history-search-multi-word' page-size __hsmw_page_size || __hsmw_page_size=$(( LINES / 3 ))
zstyle -s ':history-search-multi-word' highlight-color __hsmw_hl_color || __hsmw_hl_color="fg=yellow,bold" zstyle -s ':history-search-multi-word' highlight-color __hsmw_hl_color || __hsmw_hl_color="fg=yellow,bold"
zstyle -s ":plugin:history-search-multi-word" synhl __hsmw_synhl || __hsmw_synhl="yes" zstyle -T ":plugin:history-search-multi-word" synhl && __hsmw_synhl=1 || __hsmw_synhl=0
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"
zstyle -T ":plugin:history-search-multi-word" check-paths && __hsmw_no_check_paths=0 || __hsmw_no_check_paths=1 zstyle -T ":plugin:history-search-multi-word" check-paths && __hsmw_no_check_paths=0 || __hsmw_no_check_paths=1
[[ "$__hsmw_synhl" != "1" && "$__hsmw_synhl" != "yes" && "$__hsmw_synhl" != "true" ]] && __hsmw_synhl="no" || __hsmw_synhl="yes"
-hsmw-highlight-init -hsmw-highlight-init
fi fi
@ -146,7 +145,7 @@ _hsmw_main() {
if (( page_start_idx != __hsmw_page_start_idx || offset != __hsmw_prev_offset )); then if (( page_start_idx != __hsmw_page_start_idx || offset != __hsmw_prev_offset )); then
region_highlight=( ) region_highlight=( )
if [[ "$__hsmw_synhl" = "yes" ]]; then if (( __hsmw_synhl )); then
integer pre_index=$offset integer pre_index=$offset
local line local line
for line in "${__hsmw_disp_list_newlines[@]}"; do for line in "${__hsmw_disp_list_newlines[@]}"; do