mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2026-03-03 18:11:07 +00:00
ui: expand home path
This commit is contained in:
parent
ec11593ab1
commit
2fce39d58c
1 changed files with 5 additions and 1 deletions
|
|
@ -79,10 +79,14 @@ pub fn register_signals(sidebar_: pane::PaneSidebar, main: &pane::PaneMain) {
|
|||
let dll = main.dll.imp();
|
||||
dll.entry.connect_changed(|entry| {
|
||||
let _ = config::edit_config(|config| {
|
||||
let text = entry.text().to_string();
|
||||
let mut text = entry.text().to_string();
|
||||
if text.trim().is_empty() {
|
||||
config.global.dll = None;
|
||||
} else {
|
||||
if text.contains("~") {
|
||||
let home = std::env::var("HOME").unwrap_or_else(|_| String::from("/"));
|
||||
text = text.replace("~", &home);
|
||||
}
|
||||
config.global.dll = Some(text);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue