From ce6ee94f30abeaa63cfd5d3c861175e15045f615 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Mon, 15 Apr 2019 12:47:21 -0600 Subject: [PATCH] Add spec to demonstrate bracketed-paste-magic bug workaround Add `bracketed-paste` to list of widgets that clear the suggestion as a workaround for GitHub #351 --- spec/integrations/bracketed_paste_magic_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/integrations/bracketed_paste_magic_spec.rb b/spec/integrations/bracketed_paste_magic_spec.rb index 64092ad..41ff267 100644 --- a/spec/integrations/bracketed_paste_magic_spec.rb +++ b/spec/integrations/bracketed_paste_magic_spec.rb @@ -24,4 +24,20 @@ describe 'pasting using bracketed-paste-magic' do end end end + + context 'with `bracketed-paste` added to the list of widgets that clear the suggestion' do + let(:options) { ['ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(bracketed-paste)'] } + + it 'does not retain an old suggestion' do + with_history ('echo foo') do + session.send_string('echo ') + wait_for { session.content }.to eq('echo foo') + session.paste_string('bar') + wait_for { session.content }.to eq('echo bar') + session.send_keys('C-a') # Any cursor movement works + sleep 1 + expect(session.content).to eq('echo bar') + end + end + end end