Underline of current element no longer lacking from matched text

This commit is contained in:
Sebastian Gniazdowski 2016-10-22 11:37:02 +02:00
parent 25d593ec29
commit c70a807b25

View file

@ -138,12 +138,13 @@ _hsmw_main() {
done
fi
region_highlight+=( "$(( offset + ${#txt_before} )) $(( offset + ${#txt_before} + ${#entry} + 1 )) underline" )
if [ -n "$colsearch_pattern" ]; then
local nl=$'\n'
# Following line is taken from Zaw (GH zsh-users/zaw)  license is named "Zaw", it is in LICENSE file
region_highlight+=( "${(f)${(S)text//*(#bi)(${~colsearch_pattern})/$(( offset + mbegin[1] - 1 )) $(( offset + mend[1] )) ${__hsmw_hl_color}${nl}}%$nl*}" )
fi
region_highlight+=( "$(( offset + ${#txt_before} )) $(( offset + ${#txt_before} + ${#entry} + 1 )) underline" )
}
[[ "$__HSMW_MH_SOURCED" != "1" ]] && source "$HSMW_REPO_DIR/hsmw-highlight"