Commit Graph

20 Commits (1c3e3fd939141e89dc68394c6bd165987257bf40)

Author SHA1 Message Date
Eric Freese e405afab29 Refactor async mode to no longer use zpty
See technique used in `fast-syntax-highlighting`:
- ca2e18bbc9
- http://www.zsh.org/mla/users/2018/msg00424.html

Also see http://www.zsh.org/mla/users/2018/msg00432.html

In async response handler:
- We only want to read data in case of POLLIN or POLLHUP. Not POLLNVAL
  or select error.
- We always want to remove the handler, so it doesn't get called in an
  infinite loop when error is nval or err.

There is an upstream bug that prevents ctrl-c from resetting the prompt
immediately after a suggestion has been fetched asynchronously. A patch
has been submitted, but a workaround for now is to add `command true`
after the exec.

See https://github.com/zsh-users/zsh-autosuggestions/issues/364
Eric Freese a78ea16c50 Support fallback strategies by setting array in config
Eric Freese a1babef972 Revert "Simplify escaping of pattern and fix match_prev_cmd strategy"
This reverts commit 7f8ff2867c.
Stefan Siegel 7f8ff2867c Simplify escaping of pattern and fix match_prev_cmd strategy
Maybe this is also a fix for ,  and . Supersedes .

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")
Eric Freese 39762ecd97 Set up circle ci
Eric Freese dcce973287 Remove support for long-deprecated options
These options have been deprecated for over a year.
Eric Freese ed8056c5e8 Lots of async changes
Eric Freese 78ba07179a Add feature detection
Checks whether `zpty` gives a file descriptor, which was not the case in
older versions of zsh.

Based on a4b2f81c96/async.zsh (L395-L401)
Eric Freese ab8f295225 First pass at async functionality
Eric Freese 4850119887 Add separate test task for RSpec
Eric Freese 4a2d9f9049 Fix Makefile to not create symbolic link after PR was merged
Eric Freese c477db2696 Remove unused test variables from Makefile
Eric Freese a28e72e84a Test Runner now supports running specific tests and choosing zsh bin
Eric Freese e5cdbb6c33 Lots of test cleanup.
Geza Lore 976acc708c Fix default suggestion strategy and add testing
Eric Freese 83f78d0760 Add suggestion "strategy" concept with default strategy
Eric Freese abe577d519 Fix build
Eric Freese 03bd381112 Add `.plugin` file and installation instructions for Oh My Zsh ().
Eric Freese 00bd0e9125 Use `add-zsh-hook` to remove need to call `autosuggest_start`.
Eric Freese 775dd20706 Rewrite