Remove special case when appending at eol
This commit is contained in:
parent
a834f1aa75
commit
fc4d77964e
|
@ -443,11 +443,7 @@ BufferIterator prepare_insert(Buffer& buffer, const Selection& sel, InsertMode m
|
||||||
case InsertMode::Replace:
|
case InsertMode::Replace:
|
||||||
return erase(buffer, sel);
|
return erase(buffer, sel);
|
||||||
case InsertMode::Append:
|
case InsertMode::Append:
|
||||||
{
|
return utf8::next(buffer.iterator_at(sel.max()), buffer.end());
|
||||||
// special case for end of lines, append to current line instead
|
|
||||||
auto pos = buffer.iterator_at(sel.max());
|
|
||||||
return *pos == '\n' ? pos : utf8::next(pos, buffer.end());
|
|
||||||
}
|
|
||||||
case InsertMode::InsertAtLineBegin:
|
case InsertMode::InsertAtLineBegin:
|
||||||
return buffer.iterator_at(sel.min().line);
|
return buffer.iterator_at(sel.min().line);
|
||||||
case InsertMode::AppendAtLineEnd:
|
case InsertMode::AppendAtLineEnd:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user