parent
86dc4130e1
commit
81787792d0
|
@ -662,6 +662,8 @@ BufferCoord paste_pos(Buffer& buffer, BufferCoord min, BufferCoord max, PasteMod
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case PasteMode::Append:
|
case PasteMode::Append:
|
||||||
|
if (buffer.is_end(max))
|
||||||
|
return max;
|
||||||
return linewise ? std::min(buffer.line_count(), max.line+1) : buffer.char_next(max);
|
return linewise ? std::min(buffer.line_count(), max.line+1) : buffer.char_next(max);
|
||||||
case PasteMode::Insert:
|
case PasteMode::Insert:
|
||||||
return linewise ? min.line : min;
|
return linewise ? min.line : min;
|
||||||
|
|
1
test/regression/4844-crash-on-empty-paste/cmd
Normal file
1
test/regression/4844-crash-on-empty-paste/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<a-o>Cpp
|
2
test/regression/4844-crash-on-empty-paste/out
Normal file
2
test/regression/4844-crash-on-empty-paste/out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user