Fix select_to_previous_word with spaces at buffer start

Fixes #844
This commit is contained in:
Maxime Coste 2016-10-05 23:42:36 +01:00
parent 8579e299da
commit 9078039326
4 changed files with 4 additions and 2 deletions

View File

@ -94,9 +94,8 @@ Selection select_to_previous_word(const Buffer& buffer, const Selection& selecti
skip_while_reverse(begin, buffer.begin(), [](Codepoint c){ return is_eol(c); }); skip_while_reverse(begin, buffer.begin(), [](Codepoint c){ return is_eol(c); });
Utf8Iterator end = begin; Utf8Iterator end = begin;
skip_while_reverse(end, buffer.begin(), is_horizontal_blank);
bool with_end = false; bool with_end = skip_while_reverse(end, buffer.begin(), is_horizontal_blank);
if (word_type == Word and is_punctuation(*end)) if (word_type == Word and is_punctuation(*end))
with_end = skip_while_reverse(end, buffer.begin(), is_punctuation); with_end = skip_while_reverse(end, buffer.begin(), is_punctuation);

View File

@ -0,0 +1 @@
bb

View File

@ -0,0 +1 @@
%(word)

View File

@ -0,0 +1 @@