From 3d7d0fecca885b00a7ae80180ea1841fab2c5993 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 11 Apr 2024 11:37:18 +1000 Subject: 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 --- src/highlighter_group.hh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/highlighter_group.hh') diff --git a/src/highlighter_group.hh b/src/highlighter_group.hh index a0873dc0..1502b796 100644 --- a/src/highlighter_group.hh +++ b/src/highlighter_group.hh @@ -43,6 +43,8 @@ class Highlighters : public SafeCountable public: Highlighters(Highlighters& parent) : SafeCountable{}, m_parent{&parent}, m_group{HighlightPass::All} {} + void reparent(Highlighters& parent) { m_parent = &parent; } + HighlighterGroup& group() { return m_group; } const HighlighterGroup& group() const { return m_group; } -- cgit v1.2.3