summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/selectors.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/selectors.cc b/src/selectors.cc
index f6ca36ca..ead2ba63 100644
--- a/src/selectors.cc
+++ b/src/selectors.cc
@@ -250,7 +250,7 @@ SelectionAndCaptures select_surrounding(const Selection& selection,
BufferIterator first = selection.last();
while (not first.is_begin())
{
- if (*first == matching.second)
+ if (first != selection.last() and *first == matching.second)
++level;
else if (*first == matching.first)
{