mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	API: make nvim_win_set_option() set window-global, not buffer-local #9110
NB: the `!(flags & SOPT_GLOBAL)` exception is for 'statusline'. Because `:set statusline=...` sets the global value for _all_ windows, `:setlocal` is the best we can do there. This is a one-of-a-kind option that doesn't work like any other option.
This commit is contained in:
		 Björn Linse
					Björn Linse
				
			
				
					committed by
					
						 Justin M. Keyes
						Justin M. Keyes
					
				
			
			
				
	
			
			
			 Justin M. Keyes
						Justin M. Keyes
					
				
			
						parent
						
							b10d703213
						
					
				
				
					commit
					fb19aeeb33
				
			| @@ -228,9 +228,9 @@ describe('getbufvar() function', function() | ||||
|     eq(0, funcs.getbufvar(1, '&g:number')) | ||||
|     command('new') | ||||
|     -- But with window-local options it probably does not what you expect | ||||
|     curwinmeths.set_option('number', true) | ||||
|     command("setl number") | ||||
|     -- (note that current window’s buffer is 2, but getbufvar() receives 1) | ||||
|     eq(2, bufmeths.get_number(curwinmeths.get_buf())) | ||||
|     eq({id=2}, curwinmeths.get_buf()) | ||||
|     eq(1, funcs.getbufvar(1, '&number')) | ||||
|     eq(1, funcs.getbufvar(1, '&l:number')) | ||||
|     -- You can get global value though, if you find this useful. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user