Commit Graph

12 Commits (dda220f140bd071bc7ff0576f9129744ca02c16c)

Author SHA1 Message Date
Eric Freese 256293cbb6 Use typeset -g to avoid warnnestedvar warnings
Fixes github issue #271
8 years ago
Stefan Siegel 7f8ff2867c Simplify escaping of pattern and fix match_prev_cmd strategy
Maybe this is also a fix for #247, #248 and #258. Supersedes #267.

Testcase:
Using match_prev_cmd strategy and with these lines in history:
echo '1^'
echo '2^'
echo '1^'

type:
echo       (unexpected suggestion echo '1^' instead of echo '2^')
echo '1^1  (wrong suggestion echo '1^1echo '1^')
echo '1^#  (error "bad math expression")
8 years ago
Eric Freese ed8056c5e8 Lots of async changes 9 years ago
Eric Freese e3eb286ea2 Lots of little async cleanups 9 years ago
Eric Freese 0305908adf Revert `fc` usage in calculating suggestion
As far as I know, `fc` makes it impossible to tell whether history items
used an actual newline character or the string "\n". Pulling from the
`$history` array gives a more accurate representation of the actual
command that was run.
9 years ago
Eric Freese e33eb570c4 Send only the prefix to the suggestion server 9 years ago
Eric Freese 63816c5da8 Fix #164: Use `fc` builtin instead of `$history` array for lookup
According to a few tests, the `fc` builtin appears to be quite a bit
faster than searching through the `$history` associative array when
dealing with large history files (500K+).
9 years ago
Eric Freese 011d8bdfd1 Refactor to remove prev cmd function and simplify escaping 9 years ago
Eric Freese a314a01a6a Fix various bugs found while testing 9 years ago
Eric Freese ee6dde9ee8 Rename escape command function 9 years ago
Geza Lore 976acc708c Fix default suggestion strategy and add testing 9 years ago
Eric Freese 83f78d0760 Add suggestion "strategy" concept with default strategy 9 years ago