mirror of
				https://github.com/zsh-users/zsh-autosuggestions.git
				synced 2025-10-30 15:26:29 +08:00 
			
		
		
		
	Clear the suggestion on copy-earlier-word
This commit is contained in:
		
							parent
							
								
									733abd4af0
								
							
						
					
					
						commit
						a58225154f
					
				
							
								
								
									
										20
									
								
								spec/copy_earlier_word_spec.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								spec/copy_earlier_word_spec.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					describe '`copy-earlier-word`' do
 | 
				
			||||||
 | 
					  let(:before_sourcing) do
 | 
				
			||||||
 | 
					    -> do
 | 
				
			||||||
 | 
					      session.
 | 
				
			||||||
 | 
					        run_command('autoload -Uz copy-earlier-word').
 | 
				
			||||||
 | 
					        run_command('zle -N copy-earlier-word').
 | 
				
			||||||
 | 
					        send_string('bindkey "').
 | 
				
			||||||
 | 
					        send_keys('C-n').
 | 
				
			||||||
 | 
					        send_string('" copy-earlier-word').
 | 
				
			||||||
 | 
					        send_keys('enter')
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  it 'should copy the first word' do
 | 
				
			||||||
 | 
					    session.clear_screen
 | 
				
			||||||
 | 
					    session.send_string('foo bar baz')
 | 
				
			||||||
 | 
					    3.times { session.send_keys('C-n') }
 | 
				
			||||||
 | 
					    wait_for { session.content }.to eq('foo bar bazfoo')
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
@ -35,6 +35,7 @@ typeset -g ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX=autosuggest-orig-
 | 
				
			|||||||
		up-line-or-history
 | 
							up-line-or-history
 | 
				
			||||||
		down-line-or-history
 | 
							down-line-or-history
 | 
				
			||||||
		accept-line
 | 
							accept-line
 | 
				
			||||||
 | 
							copy-earlier-word
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -71,6 +71,7 @@ typeset -g ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX=autosuggest-orig-
 | 
				
			|||||||
		up-line-or-history
 | 
							up-line-or-history
 | 
				
			||||||
		down-line-or-history
 | 
							down-line-or-history
 | 
				
			||||||
		accept-line
 | 
							accept-line
 | 
				
			||||||
 | 
							copy-earlier-word
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user