src: Make the cursor character an opening delimiter

This commit allows the editor to consider the character under the cursor
as an opening delimiter when using an object selector, instead of
ignoring it and looking for one before the cursor.
This commit is contained in:
Frank LENORMAND 2017-03-15 14:30:49 +03:00
parent 5a403a9611
commit 0acb350619

View File

@ -295,7 +295,7 @@ find_surrounding(Iterator begin, Iterator end,
const bool nestable = opening != closing; const bool nestable = opening != closing;
auto first = pos; auto first = pos;
if (to_begin) if (to_begin and opening != *pos)
{ {
using RevIt = std::reverse_iterator<Iterator>; using RevIt = std::reverse_iterator<Iterator>;
auto res = find_closing(RevIt{pos+1}, RevIt{begin}, auto res = find_closing(RevIt{pos+1}, RevIt{begin},