File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -286,12 +286,14 @@ M.sort_operator = function(motion_type, from_visual)
286286 -- still represent a logical line selection.
287287 local spans_many_lines = (end_pos [1 ] - start_pos [1 ]) >= 2
288288
289- if starts_at_line_beginning and ends_at_line_end then
290- -- This is a "perfect lines" selection - convert to line motion.
291- effective_motion_type = ' line'
292- elseif spans_many_lines and (starts_at_line_beginning or ends_at_line_end ) then
293- -- For multi-line text objects that look like they cover mostly complete lines,
294- -- treat as line motion to avoid corruption from partial line handling.
289+ -- Treat as line motion if:
290+ -- 1. "Perfect lines" selection (starts at beginning, ends at line end)
291+ -- 2. Multi-line text objects that cover mostly complete lines
292+ local is_perfect_lines = starts_at_line_beginning and ends_at_line_end
293+ local is_multiline_block = spans_many_lines
294+ and (starts_at_line_beginning or ends_at_line_end )
295+
296+ if is_perfect_lines or is_multiline_block then
295297 effective_motion_type = ' line'
296298 end
297299 end
You can’t perform that action at this time.
0 commit comments