Fix terminal default profile saving incorrectly (#3142)

This commit is contained in:
MinusGix 2024-03-31 22:34:42 -05:00 committed by GitHub
parent bc617f8995
commit 2202343cdc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -19,6 +19,7 @@
### Bug Fixes
- [#2779](https://github.com/lapce/lapce/pull/2779): Fix files detection on fresh git/VCS repository
- [#3031](https://github.com/lapce/lapce/pull/3031): Fix find not receiving inputs when clicked
- [#3142](https://github.com/lapce/lapce/pull/3142): Fix terminal default profile saving incorrectly
## 0.3.1

View File

@ -933,6 +933,16 @@ pub fn update_file(
key: &str,
value: toml_edit::Value,
) -> Option<()> {
// TODO: This is a hack to fix the fact that terminal default profile is saved in a
// different manner than other fields. As it is per-operating-system.
// Thus we have to instead set the terminal.default-profile.{OS}
// It would be better to not need a special hack.
let (parent, key) = if parent == "terminal" && key == "default-profile" {
("terminal.default-profile", std::env::consts::OS)
} else {
(parent, key)
};
let mut main_table = Self::get_file_table().unwrap_or_default();
// Find the container table