diff --git a/src/selection.cc b/src/selection.cc index f6eab856..de8e75b1 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -487,7 +487,7 @@ void SelectionList::insert(memoryview strings, InsertMode mode, if (str.empty()) { if (mode == InsertMode::Replace) - sel.anchor() = sel.cursor() = pos.coord(); + sel.anchor() = sel.cursor() = m_buffer->clamp(pos.coord()); continue; }