From eba98ecad488c0416b0efc300c565090104d78ee Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 22 May 2014 09:52:52 +0100 Subject: [PATCH] Clamp modified coord in Selection as it could be buffer end --- src/selection.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/selection.cc b/src/selection.cc index f2126975..176bc076 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -143,11 +143,11 @@ void SelectionList::update() { auto anchor = update_pos(modifs, sel.anchor()); kak_assert(m_buffer->is_valid(anchor)); - sel.anchor() = anchor; + sel.anchor() = m_buffer->clamp(anchor); auto cursor = update_pos(modifs, sel.cursor()); kak_assert(m_buffer->is_valid(cursor)); - sel.cursor() = cursor; + sel.cursor() = m_buffer->clamp(cursor); } merge_overlapping(overlaps);