From ed592a30056f65f5c431c10efc9e11f970239cbb Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 8 Oct 2012 14:28:54 +0200 Subject: [PATCH] DisplayAtom: add utf8 sanity check --- src/display_buffer.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/display_buffer.cc b/src/display_buffer.cc index ac2bb593..576e5a14 100644 --- a/src/display_buffer.cc +++ b/src/display_buffer.cc @@ -1,6 +1,7 @@ #include "display_buffer.hh" #include "assert.hh" +#include "utf8.hh" namespace Kakoune { @@ -11,6 +12,8 @@ DisplayLine::iterator DisplayLine::split(iterator it, BufferIterator pos) assert(it->content.begin() < pos); assert(it->content.end() > pos); + assert(utf8::is_character_start(pos)); + DisplayAtom atom = *it; atom.content.m_end = pos; it->content.m_begin = pos;