mirror of
				https://github.com/zsh-users/zsh-autosuggestions.git
				synced 2024-05-11 05:54:57 +00:00 
			
		
		
		
	Fix cr/lf handling in completion strategy
This commit is contained in:
		@@ -14,6 +14,12 @@ describe 'the `completion` suggestion strategy' do
 | 
			
		||||
    wait_for { session.content }.to eq('baz bar')
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it 'does not add extra carriage returns when prefix has a line feed' do
 | 
			
		||||
    skip '`stty` does not work inside zpty below zsh version 5.0.3' if session.zsh_version < Gem::Version.new('5.0.3')
 | 
			
		||||
    session.send_string('baz \\').send_keys('C-v', 'C-j')
 | 
			
		||||
    wait_for { session.content }.to eq("baz \\\nbar")
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  context 'when async mode is enabled' do
 | 
			
		||||
    let(:options) { ['ZSH_AUTOSUGGEST_USE_ASYNC=true', 'ZSH_AUTOSUGGEST_STRATEGY=completion'] }
 | 
			
		||||
 | 
			
		||||
@@ -21,6 +27,12 @@ describe 'the `completion` suggestion strategy' do
 | 
			
		||||
      session.send_string('baz ')
 | 
			
		||||
      wait_for { session.content }.to eq('baz bar')
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it 'does not add extra carriage returns when prefix has a line feed' do
 | 
			
		||||
      skip '`stty` does not work inside zpty below zsh version 5.0.3' if session.zsh_version < Gem::Version.new('5.0.3')
 | 
			
		||||
      session.send_string('baz \\').send_keys('C-v', 'C-j')
 | 
			
		||||
      wait_for { session.content }.to eq("baz \\\nbar")
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user