Try to rationalize universal variable syncing

Prior to this commit, setting a universal variable may trigger syncing
against the file which will modify other universal variables. But if we
want to support multiple environments we need the parser to decide when to
sync uvars. Shift the decision of when to sync to the parser itself. When a
universal variable is modified, now we just set a flag and it's up to the
(main) parser when to pick it up. This is hopefully just a refactoring with
no user-visible changes.
This commit is contained in:
ridiculousfish
2022-03-27 18:59:34 -07:00
parent 9c53033f54
commit f45e16e59d
12 changed files with 75 additions and 49 deletions

View File

@@ -351,6 +351,10 @@ void inputter_t::select_interrupted() /* override */ {
this->push_front(char_event_t{char_event_type_t::check_exit});
}
void inputter_t::uvar_change_notified() /* override */ {
this->parser_->sync_uvars_and_fire(true /* always */);
}
void inputter_t::function_push_arg(wchar_t arg) { input_function_args_.push_back(arg); }
wchar_t inputter_t::function_pop_arg() {