Fix bugs resulting from refactoring the terminal into project and workspace halves

This commit is contained in:
Mikayla Maki 2022-12-08 15:18:24 -08:00
parent 83aefffa38
commit 2733f91d8c
7 changed files with 101 additions and 76 deletions

View file

@ -199,7 +199,7 @@ impl Default for Shell {
}
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, JsonSchema)]
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum AlternateScroll {
On,
@ -473,6 +473,32 @@ impl Settings {
})
}
pub fn terminal_scroll(&self) -> AlternateScroll {
*self.terminal_overrides.alternate_scroll.as_ref().unwrap_or(
self.terminal_defaults
.alternate_scroll
.as_ref()
.unwrap_or_else(|| &AlternateScroll::On),
)
}
pub fn terminal_shell(&self) -> Option<Shell> {
self.terminal_overrides
.shell
.as_ref()
.or(self.terminal_defaults.shell.as_ref())
.cloned()
}
pub fn terminal_env(&self) -> HashMap<String, String> {
self.terminal_overrides.env.clone().unwrap_or_else(|| {
self.terminal_defaults
.env
.clone()
.unwrap_or_else(|| HashMap::default())
})
}
#[cfg(any(test, feature = "test-support"))]
pub fn test(cx: &gpui::AppContext) -> Settings {
Settings {