summaryrefslogtreecommitdiff
path: root/src/selection.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-12-31 12:45:55 +1100
committerMaxime Coste <mawww@kakoune.org>2019-12-31 12:49:24 +1100
commita17a0345cf80bb326e5c35b438d6922979df14bc (patch)
treebca3988911b25306128c64326cbb3099d05c60ea /src/selection.cc
parent22bfbd06af1d0257419a9c9e0f2e3b0ebff30ddb (diff)
Fix replacing at begining of buffer
Fixes #3275
Diffstat (limited to 'src/selection.cc')
-rw-r--r--src/selection.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/selection.cc b/src/selection.cc
index 781f7c4f..d637e007 100644
--- a/src/selection.cc
+++ b/src/selection.cc
@@ -413,7 +413,7 @@ void SelectionList::insert(ConstArrayView<String> strings, InsertMode mode,
auto& min = sel.min();
auto& max = sel.max();
min = range.begin;
- max = m_buffer->char_prev(range.end);
+ max = range.end > range.begin ? m_buffer->char_prev(range.end) : range.begin;
}
else
{