Skip to content

Commit

Permalink
-git.ch: Detect if remote isn't url and doesn't exist (in .git/config)
Browse files Browse the repository at this point in the history
  • Loading branch information
psprint committed Sep 18, 2018
1 parent b9aa55a commit 3abb12f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion chroma/-git.ch
Expand Up @@ -59,6 +59,7 @@ else
__style=${FAST_THEME_NAME}incorrect-subtle
fi
fi
# The counter includes the subcommand itself
(( FAST_HIGHLIGHT[chroma-git-counter] += 1 ))
else
__wrd="${__wrd//\`/x}"
Expand All @@ -81,10 +82,14 @@ else
if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
(( __start=__start_pos-${#PREBUFFER}, __end=__start_pos+${#__wrd}-${#PREBUFFER}, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
# if ref dose not exist and subcommand is push
# if ref (__idx1 == 3) does not exist and subcommand is push
elif (( __idx1 != 2 )) && [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "push" ]]; then
(( __start=__start_pos-${#PREBUFFER}, __end=__start_pos+${#__wrd}-${#PREBUFFER}, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
# if not existing remote name, because not an URL (i.e. no colon)
elif [[ $__idx1 -eq 2 && $__wrd != *:* ]]; then
(( __start=__start_pos-${#PREBUFFER}, __end=__start_pos+${#__wrd}-${#PREBUFFER}, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
fi
# if option
else
Expand Down

0 comments on commit 3abb12f

Please sign in to comment.