Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Cores almost on demand in patcompile()



PS. Last runshfunc() uses this file:

https://github.com/psprint/zcommodore/blob/master/__zcmdr-process-buffer

I've added debug marks to this file – attached is diff where I've
added them. The resulted debug-prints file contains also the text
processed, with the  ^A, ^B, etc. – this is what patcompile() is feed
with. Mark 8 is the last one generated before core, and points to this
lines as the source of core-triggering patcompile():

    # Remove the word
    MATCH=""
    buf="${buf#(#m)$word}"


Best regards,
Sebastian Gniazdowski
Mark 1
Mark 2
Mark 3
Mark 5
Mark 6
Mark 7 [zcmdr_checkbox_18fda582ec5fd98c00e8178613810dc239ba6cb7f/Mark\ for\ feature//Users/sgniazdowski/github/zsh-navigation-tools.git4[_]]
Mark 8 [zcmdr_checkbox_18fda582ec5fd98c00e8178613810dc239ba6cb7f/Mark\ for\ feature//Users/sgniazdowski/github/zsh-navigation-tools.git4[_] glogA0/Open\ commit//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f8fda582 glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f"Updated README.md" glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f((3 days ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 9 [ glogA0/Open\ commit//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f8fda582 glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f"Updated README.md" glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f((3 days ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 10
Mark 11
Mark 7 [glogA0/Open\ commit//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f8fda582]
Mark 8 [glogA0/Open\ commit//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f8fda582 glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f"Updated README.md" glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f((3 days ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 9 [ glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f"Updated README.md" glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f((3 days ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 10
Mark 11
Mark 7 [glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f"Updated README.md"]
Mark 8 [glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f"Updated README.md" glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f((3 days ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 9 [ glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f((3 days ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 10
Mark 11
Mark 7 [glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f((3 days ago))]
Mark 8 [glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git8fda582ec5fd98c00e8178613810dc239ba6cb7f((3 days ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 9 [ glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 10
Mark 11
Mark 7 [glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 8 [glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 9 []
Mark 10
Mark 11
Mark 12
Mark 13
Mark 14
Mark 15
Mark 1
Mark 2
Mark 3
Mark 5
Mark 6
Mark 7 [zcmdr_checkbox_10a87c8044c1c6677a38ccdabd36334cc2aaab496/Mark\ for\ feature//Users/sgniazdowski/github/zsh-navigation-tools.git3[_]]
Mark 8 [zcmdr_checkbox_10a87c8044c1c6677a38ccdabd36334cc2aaab496/Mark\ for\ feature//Users/sgniazdowski/github/zsh-navigation-tools.git3[_] glogA0/Open\ commit//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab4960a87c80 glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496"znt-tmux.zsh â?? initial commit of skylite21 submission" glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496((70 minutes ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 9 [ glogA0/Open\ commit//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab4960a87c80 glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496"znt-tmux.zsh â?? initial commit of skylite21 submission" glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496((70 minutes ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 10
Mark 11
Mark 7 [glogA0/Open\ commit//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab4960a87c80]
Mark 8 [glogA0/Open\ commit//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab4960a87c80 glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496"znt-tmux.zsh â?? initial commit of skylite21 submission" glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496((70 minutes ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 9 [ glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496"znt-tmux.zsh â?? initial commit of skylite21 submission" glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496((70 minutes ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]
Mark 10
Mark 11
Mark 7 [glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496"znt-tmux.zsh â?? initial commit of skylite21 submission"]
Mark 8 [glogB0/Diff//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496"znt-tmux.zsh â?? initial commit of skylite21 submission" glogC0/Same-files\ commits//Users/sgniazdowski/github/zsh-navigation-tools.git0a87c8044c1c6677a38ccdabd36334cc2aaab496((70 minutes ago)) glogD0/Same-author\ commits//Users/sgniazdowski/github/zsh-navigation-tools.gitSebastian\ Gniazdowski`Sebastian Gniazdowski`]

HERE CORE DUMP STARTED TO BE GENERATED
diff --git a/__zcmdr-process-buffer b/__zcmdr-process-buffer
index 61592b3..3107e8b 100644
--- a/__zcmdr-process-buffer
+++ b/__zcmdr-process-buffer
@@ -14,24 +14,30 @@
 emulate -LR zsh
 setopt typesetsilent extendedglob noshortloops
 
+echo "Mark 1" >> /tmp/reply
 local MBEGIN MEND MATCH mbegin mend match
 
 local buf="${1:-$BUFFER}"
 local cursor="${2:-$CURSOR}"
 
+echo "Mark 2" >> /tmp/reply
 ZCMDR_PB_WORDS=( "${(Z+n+)buf}" )
 ZCMDR_PB_SPACES=( )
 ZCMDR_PB_WORDS_BEGINNINGS=( )
 ZCMDR_PB_SELECTED_WORD="-1"
+echo "Mark 3" >> /tmp/reply
 
 # (Z+n+) will return 1 element for buf that is empty or only whitespace
 if [[ "$buf" = ( |$'\t')# ]]; then
     ZCMDR_PB_WORDS=( )
     integer nwords=0
+    echo "Mark 4" >> /tmp/reply
 else
     integer nwords="${#ZCMDR_PB_WORDS}"
+    echo "Mark 5" >> /tmp/reply
 fi
 
+echo "Mark 6" >> /tmp/reply
 # Remove ZCMDR_PB_WORDS one by one, counting characters,
 # computing beginning of each word, to find
 # place to break the word into 2 halves (for
@@ -50,6 +56,7 @@ for (( i=1; i<=nwords; i++ )); do
     ZCMDR_PB_WORDS[i]="${ZCMDR_PB_WORDS[i]%% ##}"
     word="${ZCMDR_PB_WORDS[i]}"
 
+    echo "Mark 7 [${ZCMDR_PB_WORDS[i]}]" >> /tmp/reply
     # In general, $buf can start with white spaces
     # We will not search for them, but instead for
     # leading character of current shell word,
@@ -58,6 +65,7 @@ for (( i=1; i<=nwords; i++ )); do
 
     # Remove white spaces
     buf="${buf##(#m)[^$word[1]]#}"
+    echo "Mark 8 [$buf]" >> /tmp/reply
     # Count them
     char_count=char_count+"$#MATCH"
     # This is the beginning of current word
@@ -69,6 +77,7 @@ for (( i=1; i<=nwords; i++ )); do
     MATCH=""
     buf="${buf#(#m)$word}"
 
+    echo "Mark 9 [$buf]" >> /tmp/reply
     # If shell word not found, return. This shoudln't happen
     [ -z "$MATCH" ] && return 1
 
@@ -76,25 +85,31 @@ for (( i=1; i<=nwords; i++ )); do
     # Visual cursor right after spaces (-ge) -> not enough to select previous word (-gt required)
     [[ "$ZCMDR_PB_SELECTED_WORD" -eq "-1" && "$char_count" -gt "$cursor" ]] && ZCMDR_PB_SELECTED_WORD=$(( i-1 ))
 
+    echo "Mark 10" >> /tmp/reply
     # Actual characters point to current shell word
     # Visual cursor right after letters (-ge) -> enough to select current word
     char_count=char_count+"$#word"
     [[ "$ZCMDR_PB_SELECTED_WORD" -eq "-1" && "$char_count" -ge "$cursor" ]] && ZCMDR_PB_SELECTED_WORD="$i"
+    echo "Mark 11" >> /tmp/reply
 done 
 
+echo "Mark 12" >> /tmp/reply
 # What's left in $buf can be only white spaces
 char_count=char_count+"$#buf"
 ZCMDR_PB_SPACES[i]="$buf"
 
+echo "Mark 13" >> /tmp/reply
 # Visual cursor right after spaces (-ge) -> enough to select last word
 [[ "$ZCMDR_PB_SELECTED_WORD" -eq "-1" && "$char_count" -ge "$cursor" ]] && ZCMDR_PB_SELECTED_WORD=$(( i-1 ))
 
+echo "Mark 14" >> /tmp/reply
 # Divide active word into two halves
 integer diff=$(( cursor - ZCMDR_PB_WORDS_BEGINNINGS[ZCMDR_PB_SELECTED_WORD] + 1 ))
 word="${ZCMDR_PB_WORDS[ZCMDR_PB_SELECTED_WORD]}"
 ZCMDR_PB_LEFT="${word[1,diff]}"
 ZCMDR_PB_RIGHT="${word[diff+1,-1]}"
 
+echo "Mark 15" >> /tmp/reply
 # This function should be tested
 return 0
 


Messages sorted by: Reverse Date, Date, Thread, Author