diff options
| author | Jason Felice <jason.m.felice@gmail.com> | 2019-02-13 14:14:10 -0500 |
|---|---|---|
| committer | Jason Felice <jason.m.felice@gmail.com> | 2019-02-14 09:32:04 -0500 |
| commit | 000aa2282c3d8bb075cdaa3944c86848b410a05b (patch) | |
| tree | ea0d4581fe9b46f69b983c839aacfbbb2afdebb6 /src/normal.cc | |
| parent | 89cd68d8aff07792b03a0affc19dbb01f036f554 (diff) | |
Add object command
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 13 |
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 }; |
