From 24aa05d2f731b387b6fa402ce53d59122669bbd2 Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Tue, 25 Oct 2016 20:14:56 +0200 Subject: [PATCH] *highlight: Compress path separator highlighting code --- hsmw-highlight | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hsmw-highlight b/hsmw-highlight index e6d72c3..eea0c3a 100644 --- a/hsmw-highlight +++ b/hsmw-highlight @@ -612,10 +612,8 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=( style_pathsep=${style}_pathseparator [[ -z "$HSMW_HIGHLIGHT_STYLES[$style_pathsep]" || "$HSMW_HIGHLIGHT_STYLES[$style]" == "$HSMW_HIGHLIGHT_STYLES[$style_pathsep]" ]] && return 0 for (( pos = start_pos; $pos <= end_pos; pos++ )) ; do - if [[ ${buf[pos]} == "/" ]]; then - # ADD - reply+=("$(( pos - 1 )) $pos ${HSMW_HIGHLIGHT_STYLES[$style_pathsep]}") - fi + # ADD + [[ ${buf[pos]} == "/" ]] && reply+=("$(( pos - 1 )) $pos ${HSMW_HIGHLIGHT_STYLES[$style_pathsep]}") done }