From ab78177ee23a6509be7e8fe09d265d5640fb333a Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Sat, 20 Jul 2019 21:27:23 +0200 Subject: [PATCH] -git.ch: Make the commit message length limit configurable (#149, #25) via FAST_HIGHLIGHT[git-cmsg-len] field. --- chroma/-git.ch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chroma/-git.ch b/chroma/-git.ch index 44ae619..cb31ff2 100644 --- a/chroma/-git.ch +++ b/chroma/-git.ch @@ -790,8 +790,10 @@ chroma/-git-commit-msg-opt-ARG-action() { reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-quoted-argument]}") fi - if (( ${#_wrd} > 50 )); then - for (( __idx1 = 1, __idx2 = 1; __idx1 <= 50; ++ __idx1, ++ __idx2 )); do + integer length=${FAST_HIGHLIGHT[git-cmsg-len]:-50} + + if (( ${#_wrd} > length )); then + for (( __idx1 = 1, __idx2 = 1; __idx1 <= length; ++ __idx1, ++ __idx2 )); do # Use __arg from the fast-highlight-process's scope while [[ "${__arg[__idx2]}" != "${_wrd[__idx1]}" ]]; do (( ++ __idx2 ))