Mercurial > dotfiles
annotate .zfun/zsh-autosuggestions/spec/widgets/toggle_spec.rb @ 526:852565046ed0 default tip
zsh: fidget with screen/tmux message
This should speed things up very slightly by avoiding some `grep` action
in the common case of no detached screens/tmuxes.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Mon, 14 Nov 2022 11:02:35 -0500 |
parents | e1ce8897030d |
children |
rev | line source |
---|---|
467
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
1 describe 'the `autosuggest-toggle` widget' do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
2 before do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
3 session.run_command('bindkey ^B autosuggest-toggle') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
4 end |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
5 |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
6 it 'toggles suggestions' do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
7 with_history('echo world', 'echo hello') do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
8 session.send_string('echo') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
9 wait_for { session.content }.to eq('echo hello') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
10 |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
11 session.send_keys('C-b') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
12 wait_for { session.content }.to eq('echo') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
13 |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
14 session.send_string(' h') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
15 sleep 1 |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
16 expect(session.content).to eq('echo h') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
17 |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
18 session.send_keys('C-b') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
19 wait_for { session.content }.to eq('echo hello') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
20 |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
21 session.send_keys('C-h') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
22 session.send_string('w') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
23 wait_for { session.content }.to eq('echo world') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
24 end |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
25 end |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
26 end |