mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-04 17:18:45 +00:00
f45e16e59d
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.
22 lines
543 B
C++
22 lines
543 B
C++
// Prototypes for functions that react to environment variable changes
|
|
#ifndef FISH_ENV_DISPATCH_H
|
|
#define FISH_ENV_DISPATCH_H
|
|
|
|
#include "config.h" // IWYU pragma: keep
|
|
|
|
#include <memory>
|
|
|
|
#include "common.h"
|
|
#include "env_universal_common.h"
|
|
|
|
class environment_t;
|
|
class env_stack_t;
|
|
class parser_t;
|
|
|
|
/// Initialize variable dispatch.
|
|
void env_dispatch_init(const environment_t &vars);
|
|
|
|
/// React to changes in variables like LANG which require running some code.
|
|
void env_dispatch_var_change(const wcstring &key, env_stack_t &vars);
|
|
|
|
#endif
|