diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-07-27 00:14:49 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-07-27 00:14:49 +0100 |
| commit | 35f1ad100ea8d8979382a4cf9be4fdb5e3e44899 (patch) | |
| tree | c937d6a638cd3b109f7ba63ba15d12a588c0709e | |
| parent | d9e6c3b89f26bc4c2b2d9f01be2bb0e4908f68e2 (diff) | |
| parent | ad288be1a057620aacc95e89a0f8c932f82f1221 (diff) | |
Merge remote-tracking branch 'lenormf/select-arbitrary-punctuation'
| -rw-r--r-- | src/normal.cc | 8 | ||||
| -rw-r--r-- | test/unit/around/slash/cmd | 1 | ||||
| -rw-r--r-- | test/unit/around/slash/in | 1 | ||||
| -rw-r--r-- | test/unit/around/slash/selections | 1 | ||||
| -rw-r--r-- | test/unit/inner/slash/cmd | 1 | ||||
| -rw-r--r-- | test/unit/inner/slash/in | 1 | ||||
| -rw-r--r-- | test/unit/inner/slash/selections | 1 |
7 files changed, 14 insertions, 0 deletions
diff --git a/src/normal.cc b/src/normal.cc index 50f7ca61..288b70e5 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -996,6 +996,14 @@ void select_object(Context& context, NormalParams params) sur.opening, sur.closing, level, flags)); } + + if (is_punctuation(*cp)) + { + StringView strview_codepoint{String(*cp)}; + return select<mode>(context, std::bind(select_surrounding, _1, _2, + strview_codepoint, strview_codepoint, + level, flags)); + } }, get_title(), "b,(,): parenthesis block\n" "B,{,}: braces block \n" diff --git a/test/unit/around/slash/cmd b/test/unit/around/slash/cmd new file mode 100644 index 00000000..3b264409 --- /dev/null +++ b/test/unit/around/slash/cmd @@ -0,0 +1 @@ +<a-a>/ diff --git a/test/unit/around/slash/in b/test/unit/around/slash/in new file mode 100644 index 00000000..d6b8a544 --- /dev/null +++ b/test/unit/around/slash/in @@ -0,0 +1 @@ +foo(/%(b)ar/) diff --git a/test/unit/around/slash/selections b/test/unit/around/slash/selections new file mode 100644 index 00000000..a5a08411 --- /dev/null +++ b/test/unit/around/slash/selections @@ -0,0 +1 @@ +/bar/ diff --git a/test/unit/inner/slash/cmd b/test/unit/inner/slash/cmd new file mode 100644 index 00000000..753eb6b7 --- /dev/null +++ b/test/unit/inner/slash/cmd @@ -0,0 +1 @@ +<a-i>/ diff --git a/test/unit/inner/slash/in b/test/unit/inner/slash/in new file mode 100644 index 00000000..d6b8a544 --- /dev/null +++ b/test/unit/inner/slash/in @@ -0,0 +1 @@ +foo(/%(b)ar/) diff --git a/test/unit/inner/slash/selections b/test/unit/inner/slash/selections new file mode 100644 index 00000000..5716ca59 --- /dev/null +++ b/test/unit/inner/slash/selections @@ -0,0 +1 @@ +bar |
