diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-10-08 09:28:23 +0800 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-10-10 10:53:24 +0800 |
| commit | 78d7d512cbef31144106c05cfcc0ade7dcfad6fc (patch) | |
| tree | 3b15c931e4048edf53d4d55162ffa0a780a9cf4b | |
| parent | 397e5ef0e1999e4a7514d4aced28765a3ea54753 (diff) | |
Fix utf8::to_previous that could go before the begin iterator
| -rw-r--r-- | src/utf8.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utf8.hh b/src/utf8.hh index 68d0b48d..4d4de274 100644 --- a/src/utf8.hh +++ b/src/utf8.hh @@ -157,7 +157,7 @@ void to_previous(Iterator& it, const Iterator& begin) noexcept { if (it != begin) --it; - while (not is_character_start(*it)) + while (it != begin and not is_character_start(*it)) --it; } // returns an iterator to the previous character first byte |
