-
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.
Enabling suggestions should not fetch a suggestion if buffer is empty
- Loading branch information
1 parent
7d4a1d9
commit 6e46ac9
Showing
5 changed files
with
79 additions
and
7 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,38 @@ | ||
describe 'pasting using bracketed-paste-magic' do | ||
let(:before_sourcing) do | ||
-> do | ||
session. | ||
run_command('autoload -Uz bracketed-paste-magic'). | ||
run_command('zle -N bracketed-paste bracketed-paste-magic') | ||
end | ||
end | ||
|
||
context 'with suggestions disabled while pasting' do | ||
before do | ||
session. | ||
run_command('bpm_init() { zle autosuggest-disable }'). | ||
run_command('bpm_finish() { zle autosuggest-enable }'). | ||
run_command('zstyle :bracketed-paste-magic paste-init bpm_init'). | ||
run_command('zstyle :bracketed-paste-magic paste-finish bpm_finish') | ||
end | ||
|
||
it 'does not show an incorrect suggestion' do | ||
with_history('echo hello') do | ||
session.paste_string("echo #{'a' * 60}") | ||
sleep 1 | ||
expect(session.content).to eq("echo #{'a' * 60}") | ||
end | ||
end | ||
|
||
it 'shows a suggestion after a non-modifying keystroke' do | ||
with_history('echo hello') do | ||
session.paste_string('echo') | ||
sleep 1 | ||
expect(session.content).to eq('echo') | ||
|
||
session.send_keys('left') | ||
wait_for { session.content }.to eq('echo hello') | ||
end | ||
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
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