mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:42:44 +00:00 
			
		
		
		
	LibWeb: Whitespace that causes a line to wrap should be hidden
We were only pruning trailing whitespace on lines. This patch makes it so we also don't add whitespace as the leading line box fragment on new lines. This logic is pretty crufty and I think we can do better, but for now I've just made it handle this extra case so we can stop having lines that start with a space character. :^)
This commit is contained in:
		
							parent
							
								
									172707a945
								
							
						
					
					
						commit
						6d7892cfc4
					
				
					 3 changed files with 9 additions and 6 deletions
				
			
		|  | @ -73,10 +73,10 @@ void LineBox::trim_trailing_whitespace() | |||
|     } | ||||
| } | ||||
| 
 | ||||
| bool LineBox::ends_in_whitespace() const | ||||
| bool LineBox::is_empty_or_ends_in_whitespace() const | ||||
| { | ||||
|     if (m_fragments.is_empty()) | ||||
|         return false; | ||||
|         return true; | ||||
|     return m_fragments.last().ends_in_whitespace(); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling