fix(gutter): prevent integer overlow if view top moves past file end in relative numbering mode
This commit is contained in:
		
							parent
							
								
									dbd8521bc2
								
							
						
					
					
						commit
						4dce4ad994
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -195,7 +195,7 @@ pub fn render_relative(self: *Self, theme: *const Widget.Theme) void {
 | 
			
		|||
    var rows = self.view_rows;
 | 
			
		||||
    var diff_symbols = self.diff_symbols.items;
 | 
			
		||||
    while (rows > 0) : (rows -= 1) {
 | 
			
		||||
        if (pos > self.lines - @as(u32, @intCast(row))) return;
 | 
			
		||||
        if (self.lines > @as(u32, @intCast(row)) and pos > self.lines - @as(u32, @intCast(row))) return;
 | 
			
		||||
        self.plane.set_style(if (linenum == 0) theme.editor_gutter_active else theme.editor_gutter);
 | 
			
		||||
        const val = @abs(if (linenum == 0) line else linenum);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue