fix: end_col out of range (#310)
This commit is contained in:
		
							parent
							
								
									0591955c5e
								
							
						
					
					
						commit
						06f1d710bd
					
				| @ -280,6 +280,9 @@ function Selection:create_editing_input() | |||||||
| 
 | 
 | ||||||
|   self.selection = Utils.get_visual_selection_and_range() |   self.selection = Utils.get_visual_selection_and_range() | ||||||
| 
 | 
 | ||||||
|  |   local end_row = self.selection.range.finish.line - 1 | ||||||
|  |   local end_col = math.min(self.selection.range.finish.col, #code_lines[self.selection.range.finish.line]) | ||||||
|  | 
 | ||||||
|   self.selected_code_extmark_id = api.nvim_buf_set_extmark( |   self.selected_code_extmark_id = api.nvim_buf_set_extmark( | ||||||
|     code_bufnr, |     code_bufnr, | ||||||
|     SELECTED_CODE_NAMESPACE, |     SELECTED_CODE_NAMESPACE, | ||||||
| @ -288,8 +291,8 @@ function Selection:create_editing_input() | |||||||
|     { |     { | ||||||
|       hl_group = "Visual", |       hl_group = "Visual", | ||||||
|       hl_mode = "combine", |       hl_mode = "combine", | ||||||
|       end_row = self.selection.range.finish.line - 1, |       end_row = end_row, | ||||||
|       end_col = self.selection.range.finish.col, |       end_col = end_col, | ||||||
|       priority = PRIORITY, |       priority = PRIORITY, | ||||||
|     } |     } | ||||||
|   ) |   ) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 yetone
						yetone