diff --git a/spec/integrations/async_line_or_beginning_spec.rb b/spec/integrations/async_line_or_beginning_spec.rb new file mode 100644 index 0000000..41935fd --- /dev/null +++ b/spec/integrations/async_line_or_beginning_spec.rb @@ -0,0 +1,27 @@ +describe 'using up-line-or-beginning-search when async is enabled' do + let(:options) { ["ZSH_AUTOSUGGEST_USE_ASYNC="] } + let(:before_sourcing) do + -> do + session. + run_command('autoload -U up-line-or-beginning-search'). + run_command('zle -N up-line-or-beginning-search'). + send_string('bindkey "'). + send_keys('C-v').send_keys('up'). + send_string('" up-line-or-beginning-search'). + send_keys('enter') + end + end + + it 'should show previous history entries' do + with_history( + 'echo foo', + 'echo bar', + 'echo baz' + ) do + session.clear_screen + 3.times { session.send_keys('up') } + wait_for { session.content }.to eq("echo foo") + end + end +end + diff --git a/src/config.zsh b/src/config.zsh index ba694c0..5c44af5 100644 --- a/src/config.zsh +++ b/src/config.zsh @@ -21,6 +21,8 @@ ZSH_AUTOSUGGEST_CLEAR_WIDGETS=( history-beginning-search-backward history-substring-search-up history-substring-search-down + up-line-or-beginning-search + down-line-or-beginning-search up-line-or-history down-line-or-history accept-line diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index a9330ea..3e0405d 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -57,6 +57,8 @@ ZSH_AUTOSUGGEST_CLEAR_WIDGETS=( history-beginning-search-backward history-substring-search-up history-substring-search-down + up-line-or-beginning-search + down-line-or-beginning-search up-line-or-history down-line-or-history accept-line