mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	vim-patch:8.2.3622: "verbose pwd" shows confusing info
Problem:    "verbose pwd" shows confusing info when :lcd does not change
            directory.
Solution:   Clear last_chdir_reason also when the directory does not change.
            (closes vim/vim#9160)
64be6aa3a5
This only ports the tests, as this is already Nvim's behavior.
			
			
This commit is contained in:
		@@ -42,6 +42,14 @@ func Test_verbose_pwd()
 | 
				
			|||||||
  set acd
 | 
					  set acd
 | 
				
			||||||
  wincmd w
 | 
					  wincmd w
 | 
				
			||||||
  call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
 | 
					  call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
 | 
				
			||||||
 | 
					  execute 'lcd' cwd
 | 
				
			||||||
 | 
					  call assert_match('\[window\].*testdir$', execute('verbose pwd'))
 | 
				
			||||||
 | 
					  execute 'tcd' cwd
 | 
				
			||||||
 | 
					  call assert_match('\[tabpage\].*testdir$', execute('verbose pwd'))
 | 
				
			||||||
 | 
					  execute 'cd' cwd
 | 
				
			||||||
 | 
					  call assert_match('\[global\].*testdir$', execute('verbose pwd'))
 | 
				
			||||||
 | 
					  edit
 | 
				
			||||||
 | 
					  call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
 | 
				
			||||||
  wincmd w
 | 
					  wincmd w
 | 
				
			||||||
  call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose pwd'))
 | 
					  call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose pwd'))
 | 
				
			||||||
  set noacd
 | 
					  set noacd
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,7 @@ describe('autochdir behavior', function()
 | 
				
			|||||||
  it(':verbose pwd shows whether autochdir is used', function()
 | 
					  it(':verbose pwd shows whether autochdir is used', function()
 | 
				
			||||||
    local subdir = 'Xautodir'
 | 
					    local subdir = 'Xautodir'
 | 
				
			||||||
    command('cd '..dir)
 | 
					    command('cd '..dir)
 | 
				
			||||||
 | 
					    local cwd = eval('getcwd()')
 | 
				
			||||||
    command('edit global.txt')
 | 
					    command('edit global.txt')
 | 
				
			||||||
    matches('%[global%].*'..dir, exec_capture('verbose pwd'))
 | 
					    matches('%[global%].*'..dir, exec_capture('verbose pwd'))
 | 
				
			||||||
    call('mkdir', subdir)
 | 
					    call('mkdir', subdir)
 | 
				
			||||||
@@ -37,6 +38,14 @@ describe('autochdir behavior', function()
 | 
				
			|||||||
    command('set autochdir')
 | 
					    command('set autochdir')
 | 
				
			||||||
    command('wincmd w')
 | 
					    command('wincmd w')
 | 
				
			||||||
    matches('%[autochdir%].*'..dir, exec_capture('verbose pwd'))
 | 
					    matches('%[autochdir%].*'..dir, exec_capture('verbose pwd'))
 | 
				
			||||||
 | 
					    command('lcd '..cwd)
 | 
				
			||||||
 | 
					    matches('%[window%].*'..dir, exec_capture('verbose pwd'))
 | 
				
			||||||
 | 
					    command('tcd '..cwd)
 | 
				
			||||||
 | 
					    matches('%[tabpage%].*'..dir, exec_capture('verbose pwd'))
 | 
				
			||||||
 | 
					    command('cd '..cwd)
 | 
				
			||||||
 | 
					    matches('%[global%].*'..dir, exec_capture('verbose pwd'))
 | 
				
			||||||
 | 
					    command('edit')
 | 
				
			||||||
 | 
					    matches('%[autochdir%].*'..dir, exec_capture('verbose pwd'))
 | 
				
			||||||
    command('wincmd w')
 | 
					    command('wincmd w')
 | 
				
			||||||
    matches('%[autochdir%].*'..dir..'[/\\]'..subdir, exec_capture('verbose pwd'))
 | 
					    matches('%[autochdir%].*'..dir..'[/\\]'..subdir, exec_capture('verbose pwd'))
 | 
				
			||||||
    command('set noautochdir')
 | 
					    command('set noautochdir')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user