mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-19 21:21:15 -03:00
stop subclassing env_var_t from wcstring
This is the first step to implementing issue #4200 is to stop subclassing env_var_t from wcstring. Not too surprisingly doing this identified several places that were incorrectly treating env_var_t and wcstring as interchangeable types. I'm not talking about those places that passed an env_var_t instance to a function that takes a wcstring. I'm talking about doing things like assigning the former to the latter type, relying on the implicit conversion, and thus losing information. We also rename `env_get_string()` to `env_get()` for symmetry with `env_set()` and to make it clear the function does not return a string.
This commit is contained in:
@@ -201,8 +201,8 @@ static int input_function_args_index = 0;
|
||||
|
||||
/// Return the current bind mode.
|
||||
wcstring input_get_bind_mode() {
|
||||
env_var_t mode = env_get_string(FISH_BIND_MODE_VAR);
|
||||
return mode.missing() ? DEFAULT_BIND_MODE : mode;
|
||||
env_var_t mode = env_get(FISH_BIND_MODE_VAR);
|
||||
return mode.missing() ? DEFAULT_BIND_MODE : mode.as_string();
|
||||
}
|
||||
|
||||
/// Set the current bind mode.
|
||||
|
||||
Reference in New Issue
Block a user