mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(ui): ruler is not redrawn in cmdline with redrawstatus
This commit is contained in:
		| @@ -32,7 +32,8 @@ CTRL-L			Clears and redraws the screen.  The redraw may happen | ||||
| 						*:redraws* *:redrawstatus* | ||||
| :redraws[tatus][!]	Redraws the status line and window bar of the current | ||||
| 			window, or all status lines and window bars if "!" is | ||||
| 			included. Useful if 'statusline' or 'winbar' includes | ||||
| 			included. Redraws the commandline instead if it contains | ||||
| 			the 'ruler'. Useful if 'statusline' or 'winbar' includes | ||||
| 			an item that doesn't cause automatic updating. | ||||
|  | ||||
| 						*:redrawt* *:redrawtabline* | ||||
|   | ||||
| @@ -2683,6 +2683,11 @@ void status_redraw_buf(buf_T *buf) | ||||
|       redraw_later(wp, UPD_VALID); | ||||
|     } | ||||
|   } | ||||
|   // Redraw the ruler if it is in the command line and was not marked for redraw above | ||||
|   if (p_ru && !curwin->w_status_height && !curwin->w_redr_status) { | ||||
|     redraw_cmdline = true; | ||||
|     redraw_later(curwin, UPD_VALID); | ||||
|   } | ||||
| } | ||||
|  | ||||
| /// Redraw all status lines that need to be redrawn. | ||||
|   | ||||
| @@ -636,3 +636,20 @@ it('statusline is redrawn on recording state change #22683', function() | ||||
|     recording @Q                            | | ||||
|   ]]) | ||||
| end) | ||||
|  | ||||
| it('ruler is redrawn in cmdline with redrawstatus #22804', function() | ||||
|   clear() | ||||
|   local screen = Screen.new(40, 2) | ||||
|   screen:attach() | ||||
|   command([[ | ||||
|     let g:n = 'initial value' | ||||
|     set ls=1 ru ruf=%{g:n} | ||||
|     redraw | ||||
|     let g:n = 'other value' | ||||
|     redrawstatus | ||||
|   ]]) | ||||
|   screen:expect([[ | ||||
|     ^                                        | | ||||
|                           other value       | | ||||
|   ]]) | ||||
| end) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Luuk van Baal
					Luuk van Baal