mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(diagnostic): setqflist() is stuck after vim.lsp.buf.document_symbol #31553
Previously, when updating the quickfix diagnostics list, we'd update it, and then open the quickfix buffer, but there was no guarantee that the quickfix buffer would be displaying the quickfix diagnostics list (it could very possibly be displaying some other quickfix list!). This fixes things so we first select the quickfix list before opening the quickfix buffer. If `open` is not specified, the behavior is the same as before: we update the diagnostics quickfix list, but do not navigate to it. fixes https://github.com/neovim/neovim/issues/31540
This commit is contained in:
		 Jeremy Fleischman
					Jeremy Fleischman
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							21961967ff
						
					
				
				
					commit
					5eda7aafe9
				
			| @@ -869,7 +869,16 @@ local function set_list(loclist, opts) | ||||
|     }) | ||||
|   end | ||||
|   if open then | ||||
|     api.nvim_command(loclist and 'lwindow' or 'botright cwindow') | ||||
|     if loclist then | ||||
|       api.nvim_command('lwindow') | ||||
|     else | ||||
|       -- First navigate to the diagnostics quickfix list. | ||||
|       local nr = vim.fn.getqflist({ id = _qf_id, nr = 0 }).nr | ||||
|       api.nvim_command(nr .. 'chistory') | ||||
|  | ||||
|       -- Now open the quickfix list. | ||||
|       api.nvim_command('botright cwindow') | ||||
|     end | ||||
|   end | ||||
| end | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user