You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
739 B

  1. # vim:ft=zsh:et:sw=4
  2. (( next_word = 2 | 8192 ))
  3. [[ "$__arg_type" = 3 ]] && return 2
  4. local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
  5. if (( __first_call )); then
  6. FAST_HIGHLIGHT[chroma-subcommand]=""
  7. return 1
  8. elif (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
  9. return 1
  10. elif [[ "$2" = -* ]]; then
  11. return 1
  12. elif [[ -z "${FAST_HIGHLIGHT[chroma-subcommand]}" ]]; then
  13. FAST_HIGHLIGHT[chroma-subcommand]="$__wrd"
  14. (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
  15. && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}subcommand]}")
  16. else
  17. return 1
  18. fi
  19. (( this_word = next_word ))
  20. _start_pos=$_end_pos
  21. return 0