-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put in a general fix for #219 - Handling input from
zle -U
Depends on patch to ZSH from workers/40702: http://www.zsh.org/mla/workers/2017/msg00414.html
- Loading branch information
1 parent
596e15d
commit ee763e3
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
describe 'using `zle -U`' do | ||
let(:before_sourcing) do | ||
-> do | ||
session. | ||
run_command('_zsh_autosuggest_strategy_test() { sleep 1; _zsh_autosuggest_strategy_default "$1" }'). | ||
run_command('foo() { zle -U - "echo hello" }; zle -N foo; bindkey ^B foo') | ||
end | ||
end | ||
|
||
let(:options) { ['unset ZSH_AUTOSUGGEST_USE_ASYNC', 'ZSH_AUTOSUGGEST_STRATEGY=test'] } | ||
|
||
# TODO: This is only possible with the $KEYS_QUEUED_COUNT widget parameter, coming soon... | ||
xit 'does not fetch a suggestion for every inserted character' do | ||
session.send_keys('C-b') | ||
wait_for { session.content }.to eq('echo hello') | ||
end | ||
|
||
it 'shows a suggestion when the widget completes' do | ||
with_history('echo hello world') do | ||
session.send_keys('C-b') | ||
wait_for { session.content(esc_seqs: true) }.to match(/\Aecho hello\e\[[0-9]+m world/) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters