fix: prevent an integer overflow in editor.cancel_all_selections() on project switch
This commit is contained in:
		
							parent
							
								
									e1b1591167
								
							
						
					
					
						commit
						d2735a5dd7
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1568,7 +1568,7 @@ pub const Editor = struct {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    fn cancel_all_selections(self: *Self) void {
 | 
			
		||||
        var primary = self.cursels.getLast() orelse CurSel{};
 | 
			
		||||
        var primary = self.get_primary().*;
 | 
			
		||||
        primary.selection = null;
 | 
			
		||||
        self.cursels.clearRetainingCapacity();
 | 
			
		||||
        self.cursels.addOneAssumeCapacity().* = primary;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue