Mercurial > dotfiles
comparison .zfun/zsh-autosuggestions/spec/integrations/vi_mode_spec.rb @ 467:e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Mon, 03 Dec 2018 22:37:29 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
466:f248cf012d9a | 467:e1ce8897030d |
---|---|
1 describe 'when using vi mode' do | |
2 let(:before_sourcing) do | |
3 -> do | |
4 session.run_command('bindkey -v') | |
5 end | |
6 end | |
7 | |
8 describe 'moving the cursor after exiting insert mode' do | |
9 it 'should not clear the current suggestion' do | |
10 with_history('foobar foo') do | |
11 session. | |
12 send_string('foo'). | |
13 send_keys('escape'). | |
14 send_keys('h') | |
15 | |
16 wait_for { session.content }.to eq('foobar foo') | |
17 end | |
18 end | |
19 end | |
20 | |
21 describe '`vi-forward-word-end`' do | |
22 it 'should accept through the end of the current word' do | |
23 with_history('foobar foo') do | |
24 session. | |
25 send_string('foo'). | |
26 send_keys('escape'). | |
27 send_keys('e'). # vi-forward-word-end | |
28 send_keys('a'). # vi-add-next | |
29 send_string('baz') | |
30 | |
31 wait_for { session.content }.to eq('foobarbaz') | |
32 end | |
33 end | |
34 end | |
35 | |
36 describe '`vi-forward-word`' do | |
37 it 'should accept through the first character of the next word' do | |
38 with_history('foobar foo') do | |
39 session. | |
40 send_string('foo'). | |
41 send_keys('escape'). | |
42 send_keys('w'). # vi-forward-word | |
43 send_keys('a'). # vi-add-next | |
44 send_string('az') | |
45 | |
46 wait_for { session.content }.to eq('foobar faz') | |
47 end | |
48 end | |
49 end | |
50 | |
51 describe '`vi-find-next-char`' do | |
52 it 'should accept through the next occurrence of the character' do | |
53 with_history('foobar foo') do | |
54 session. | |
55 send_string('foo'). | |
56 send_keys('escape'). | |
57 send_keys('f'). # vi-find-next-char | |
58 send_keys('o'). | |
59 send_keys('a'). # vi-add-next | |
60 send_string('b') | |
61 | |
62 wait_for { session.content }.to eq('foobar fob') | |
63 end | |
64 end | |
65 end | |
66 end | |
67 |