Avoid copying selection before the first line
This commit is contained in:
parent
733e004d44
commit
36ffff96be
|
@ -994,7 +994,8 @@ void copy_selections_on_next_lines(Context& context, NormalParams params)
|
||||||
const LineCount anchor_line = anchor.line + offset;
|
const LineCount anchor_line = anchor.line + offset;
|
||||||
const LineCount cursor_line = cursor.line + offset;
|
const LineCount cursor_line = cursor.line + offset;
|
||||||
|
|
||||||
if (anchor_line >= buffer.line_count() or cursor_line >= buffer.line_count())
|
if (anchor_line < 0 or cursor_line < 0 or
|
||||||
|
anchor_line >= buffer.line_count() or cursor_line >= buffer.line_count())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ByteCount anchor_byte = get_byte_to_column(buffer, tabstop, {anchor_line, anchor_col});
|
ByteCount anchor_byte = get_byte_to_column(buffer, tabstop, {anchor_line, anchor_col});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user