diff --git a/spec/kill_ring_spec.rb b/spec/kill_ring_spec.rb new file mode 100644 index 0000000..4d0178f --- /dev/null +++ b/spec/kill_ring_spec.rb @@ -0,0 +1,23 @@ +context 'with some items in the kill ring' do + before do + session. + send_string('echo foo'). + send_keys('C-u'). + send_string('echo bar'). + send_keys('C-u') + end + + describe '`yank-pop`' do + it 'should cycle through all items in the kill ring' do + session.send_keys('C-y') + wait_for { session.content }.to eq('echo bar') + + session.send_keys('escape').send_keys('y') + wait_for { session.content }.to eq('echo foo') + + session.send_keys('escape').send_keys('y') + wait_for { session.content }.to eq('echo bar') + end + end +end + diff --git a/src/config.zsh b/src/config.zsh index c4d07fd..597307f 100644 --- a/src/config.zsh +++ b/src/config.zsh @@ -61,6 +61,7 @@ ZSH_AUTOSUGGEST_IGNORE_WIDGETS=( set-local-history which-command yank + yank-pop ) # Max size of buffer to trigger autosuggestion. Leave undefined for no upper bound. diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 4c06cdb..7f6e7de 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -97,6 +97,7 @@ ZSH_AUTOSUGGEST_IGNORE_WIDGETS=( set-local-history which-command yank + yank-pop ) # Max size of buffer to trigger autosuggestion. Leave undefined for no upper bound.