Mercurial > dotfiles
annotate .zfun/zsh-autosuggestions/spec/integrations/bracketed_paste_magic_spec.rb @ 509:cea9a184de6c
zsh: add workaround for mcfly breaking autocd
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Thu, 18 Feb 2021 11:12:42 -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 'pasting using bracketed-paste-magic' do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
2 let(:before_sourcing) do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
3 -> do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
4 session. |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
5 run_command('autoload -Uz bracketed-paste-magic'). |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
6 run_command('zle -N bracketed-paste bracketed-paste-magic') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
7 end |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
8 end |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
9 |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
10 context 'with suggestions disabled while pasting' do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
11 before do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
12 session. |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
13 run_command('bpm_init() { zle autosuggest-disable }'). |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
14 run_command('bpm_finish() { zle autosuggest-enable }'). |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
15 run_command('zstyle :bracketed-paste-magic paste-init bpm_init'). |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
16 run_command('zstyle :bracketed-paste-magic paste-finish bpm_finish') |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
17 end |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
18 |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
19 it 'does not show an incorrect suggestion' do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
20 with_history('echo hello') do |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
21 session.paste_string("echo #{'a' * 60}") |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
22 sleep 1 |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
23 expect(session.content).to eq("echo #{'a' * 60}") |
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 |
e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
27 end |