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

Re: subscript too small after complete in variable



On Apr 6, 11:57pm, Dylan Alex Simon wrote:
} Subject: subscript too small after complete in variable
}
} 4. shell hangs a second and then:
}    _subscript:20: subscript too small: -262145

Try the patch below.  Doesn't actually find any useful completions,
but at least fixes the infinite-but-for-memory-limits loop.

--- ../zsh-forge/current/Completion/Zsh/Context/_subscript      2008-10-04
09:28:48.000000000 -0700
+++ Completion/Zsh/Context/_subscript   2009-04-06 21:12:26.000000000 -0700
@@ -17,7 +17,7 @@
 # name expansion.  Also expand in anything that looks like an assignment
 # or colon list.
 integer pos=$((CURSOR+1))
-while [[ pos > 1 && $BUFFER[pos-1] != '[' ]]; do (( pos-- )); done
+while [[ pos -gt 1 && $BUFFER[pos-1] != '[' ]]; do (( pos-- )); done
 if [[ $BUFFER[1,pos-1] = *[[:space:]:=]##\~\[ ]]; then
   _dynamic_directory_name
 elif [[ "$PREFIX" = :* ]]; then



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