When inserting at the end, store the next line as end pos in the change
This commit is contained in:
parent
e42881fa38
commit
69789d4793
|
@ -484,7 +484,8 @@ BufferCoord Buffer::do_insert(BufferCoord pos, StringView content)
|
|||
std::make_move_iterator(new_lines.end()));
|
||||
|
||||
const LineCount last_line = pos.line + new_lines.size() - 1;
|
||||
const BufferCoord end = BufferCoord{ last_line, m_lines[last_line].length() - suffix.length() };
|
||||
const auto end = at_end ? line_count()
|
||||
: BufferCoord{ last_line, m_lines[last_line].length() - suffix.length() };
|
||||
|
||||
m_changes.push_back({ Change::Insert, at_end, pos, end });
|
||||
return pos;
|
||||
|
|
Loading…
Reference in New Issue
Block a user