summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-02-17 11:22:02 +1100
committerMaxime Coste <mawww@kakoune.org>2019-02-17 11:22:02 +1100
commite169a1893b117e6d8983146c3bcbc2efd1371092 (patch)
tree317b9636a2ede7e5c2e1d58589c757ec122d3409 /src/normal.cc
parent206929b403c02c1a055dc60ab00d8a6546051d69 (diff)
parent000aa2282c3d8bb075cdaa3944c86848b410a05b (diff)
Merge remote-tracking branch 'eraserhd/object-command-submode'
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/normal.cc b/src/normal.cc
index c7b074a4..66eec914 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -1252,12 +1252,12 @@ void select_object(Context& context, NormalParams params)
whole ? "" : (flags & ObjectFlags::ToBegin ? " begin" : " end"));
};
- const int count = params.count <= 0 ? 0 : params.count - 1;
on_next_key_with_autoinfo(context, KeymapMode::Object,
- [count](Key key, Context& context) {
+ [params](Key key, Context& context) {
if (key == Key::Escape)
return;
+ const int count = params.count <= 0 ? 0 : params.count - 1;
static constexpr struct ObjectType
{
Key key;
@@ -1311,6 +1311,12 @@ void select_object(Context& context, NormalParams params)
return;
}
+ if (key == alt(';'))
+ {
+ command(context, params);
+ return;
+ }
+
static constexpr struct SurroundingPair
{
char opening;
@@ -1365,7 +1371,8 @@ void select_object(Context& context, NormalParams params)
{{'i'}, "indent"},
{{'u'}, "argument"},
{{'n'}, "number"},
- {{'c'}, "custom object desc"}}));
+ {{'c'}, "custom object desc"},
+ {{alt(';')}, "run command in object context"}}));
}
enum Direction { Backward = -1, Forward = 1 };