feat: add multi cursor support to delete_line
This commit is contained in:
		
							parent
							
								
									dff0b233d1
								
							
						
					
					
						commit
						c27795bc95
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		|  | @ -3033,9 +3033,11 @@ pub const Editor = struct { | ||||||
| 
 | 
 | ||||||
|     pub fn delete_line(self: *Self, _: Context) Result { |     pub fn delete_line(self: *Self, _: Context) Result { | ||||||
|         const b = try self.buf_for_update(); |         const b = try self.buf_for_update(); | ||||||
|         const primary = self.get_primary(); |         var root = b.root; | ||||||
|         try self.select_line_at_cursor(b.root, primary, .include_eol); |         for (self.cursels.items) |*cursel_| if (cursel_.*) |*cursel| { | ||||||
|         const root = try self.delete_selection(b.root, primary, b.allocator); |             try self.select_line_at_cursor(root, cursel, .include_eol); | ||||||
|  |             root = try self.delete_selection(root, cursel, b.allocator); | ||||||
|  |         }; | ||||||
|         try self.update_buf(root); |         try self.update_buf(root); | ||||||
|         self.clamp(); |         self.clamp(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue