summaryrefslogtreecommitdiff
path: root/src/alias_registry.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-04-11 11:37:18 +1000
committerMaxime Coste <mawww@kakoune.org>2024-04-12 15:28:40 +1000
commit3d7d0fecca885b00a7ae80180ea1841fab2c5993 (patch)
tree94218f4a6dab3f448ceaff034e51079a0ecc2e3c /src/alias_registry.hh
parentb1c114bf6d950684df0524e450782a151e6a0323 (diff)
Introduce "local" scope in evaluate-commands
When using `eval` a new scope named 'local' gets pushed for the whole evaluation, this makes it possible to temporarily set an option/hook/alias... Local scopes nest so nested evals do work as expected. Remove the now trivial with-option command
Diffstat (limited to 'src/alias_registry.hh')
-rw-r--r--src/alias_registry.hh3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/alias_registry.hh b/src/alias_registry.hh
index c35cdf70..1b7a49eb 100644
--- a/src/alias_registry.hh
+++ b/src/alias_registry.hh
@@ -12,6 +12,9 @@ class AliasRegistry : public SafeCountable
{
public:
AliasRegistry(AliasRegistry& parent) : SafeCountable{}, m_parent(&parent) {}
+
+ void reparent(AliasRegistry& parent) { m_parent = &parent; }
+
void add_alias(String alias, String command);
void remove_alias(StringView alias);
StringView operator[](StringView alias) const;