diff options
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/normal.cc b/src/normal.cc index 7154f409..1c2ec6d3 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -941,23 +941,26 @@ void select_object(Context& context, NormalParams params) static constexpr struct { - MatchingPair pair; + StringView opening; + StringView closing; Codepoint name; } surrounding_pairs[] = { - { { '(', ')' }, 'b' }, - { { '{', '}' }, 'B' }, - { { '[', ']' }, 'r' }, - { { '<', '>' }, 'a' }, - { { '"', '"' }, 'Q' }, - { { '\'', '\'' }, 'q' }, - { { '`', '`' }, 'g' }, + { "(", ")", 'b' }, + { "{", "}", 'B' }, + { "[", "]", 'r' }, + { "<", ">", 'a' }, + { "\"", "\"", 'Q' }, + { "'", "'", 'q' }, + { "`", "`", 'g' }, }; for (auto& sur : surrounding_pairs) { - if (sur.pair.opening == *cp or sur.pair.closing == *cp or + if (sur.opening[0_char] == *cp or + sur.closing[0_char] == *cp or (sur.name != 0 and sur.name == *cp)) return select<mode>(context, std::bind(select_surrounding, _1, _2, - sur.pair, level, flags)); + sur.opening, sur.closing, + level, flags)); } }, "select object", "b,(,): parenthesis block\n" |
