mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	 033b1cb7d9
			
		
	
	033b1cb7d9
	
	
	
		
			
			Reverts commit 337b6179df
Closes #6716 at the expense of not being able to use a
multi-key 'pastetoggle' manually.
Multi-key 'pastetoggle' can still be used when inserting the entire
option into the typebuffer at once (though the use here is
questionable).
Also remove those tests to do with waiting for the completion of
'pastetoggle' and mention in the documentation that 'pastetoggle'
doesn't wait for timeout.
		
	
		
			
				
	
	
		
			41 lines
		
	
	
		
			943 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			943 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
| local helpers = require('test.functional.helpers')(after_each)
 | |
| 
 | |
| local clear = helpers.clear
 | |
| local feed = helpers.feed
 | |
| local command = helpers.command
 | |
| local eq = helpers.eq
 | |
| local eval = helpers.eval
 | |
| local sleep = helpers.sleep
 | |
| local expect = helpers.expect
 | |
| 
 | |
| describe("'pastetoggle' option", function()
 | |
|   before_each(function()
 | |
|     clear()
 | |
|     command('set nopaste')
 | |
|   end)
 | |
| 
 | |
|   it("toggles 'paste'", function()
 | |
|     command('set pastetoggle=a')
 | |
|     eq(0, eval('&paste'))
 | |
|     feed('a')
 | |
|     -- Need another key so that the vgetorpeek() function returns.
 | |
|     feed('j')
 | |
|     eq(1, eval('&paste'))
 | |
|   end)
 | |
| 
 | |
| 
 | |
|   it('does not wait for timeout', function()
 | |
|     command('set pastetoggle=abc')
 | |
|     command('set ttimeoutlen=9999999')
 | |
|     eq(0, eval('&paste'))
 | |
|     -- n.b. need <esc> to return from vgetorpeek()
 | |
|     feed('abc<esc>')
 | |
|     eq(1, eval('&paste'))
 | |
|     feed('ab')
 | |
|     sleep(10)
 | |
|     feed('c<esc>')
 | |
|     expect('bc')
 | |
|     eq(1, eval('&paste'))
 | |
|   end)
 | |
| end)
 |