1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-30 23:37:17 +03:00

select_matching: fix when matching is the first character

This commit is contained in:
Maxime Coste 2012-12-27 13:41:45 +01:00
parent f3a7c76c4e
commit ac778c8aa2

View File

@ -205,12 +205,14 @@ Selection select_matching(const Selection& selection)
int level = 0;
const Codepoint opening = *(match-1);
const Codepoint closing = *match;
while (not is_begin(it))
while (true)
{
if (*it == closing)
++level;
else if (*it == opening and --level == 0)
return utf8_selection(begin, it);
if (is_begin(it))
break;
--it;
}
}