|
|
@ -22,6 +22,8 @@ static SEARCH_HISTFILE: once_cell::sync::OnceCell<PathBuf> = once_cell::sync::On
|
|
|
|
|
|
|
|
|
|
|
|
static FILE_HISTFILE: once_cell::sync::OnceCell<PathBuf> = once_cell::sync::OnceCell::new();
|
|
|
|
static FILE_HISTFILE: once_cell::sync::OnceCell<PathBuf> = once_cell::sync::OnceCell::new();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static CLIPBOARD_FILE: once_cell::sync::OnceCell<PathBuf> = once_cell::sync::OnceCell::new();
|
|
|
|
|
|
|
|
|
|
|
|
pub fn initialize_config_file(specified_file: Option<PathBuf>) {
|
|
|
|
pub fn initialize_config_file(specified_file: Option<PathBuf>) {
|
|
|
|
let config_file = specified_file.unwrap_or_else(default_config_file);
|
|
|
|
let config_file = specified_file.unwrap_or_else(default_config_file);
|
|
|
|
ensure_parent_dir(&config_file);
|
|
|
|
ensure_parent_dir(&config_file);
|
|
|
@ -52,6 +54,12 @@ pub fn initialize_file_histfile(specified_file: Option<PathBuf>) {
|
|
|
|
FILE_HISTFILE.set(file_histfile).ok();
|
|
|
|
FILE_HISTFILE.set(file_histfile).ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn initialize_clipboard_file(specified_file: Option<PathBuf>) {
|
|
|
|
|
|
|
|
let clipboard_file = specified_file.unwrap_or_else(default_clipboard_file);
|
|
|
|
|
|
|
|
ensure_parent_dir(&clipboard_file);
|
|
|
|
|
|
|
|
CLIPBOARD_FILE.set(clipboard_file).ok();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// A list of runtime directories from highest to lowest priority
|
|
|
|
/// A list of runtime directories from highest to lowest priority
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// The priority is:
|
|
|
|
/// The priority is:
|
|
|
@ -191,6 +199,10 @@ pub fn file_histfile() -> PathBuf {
|
|
|
|
FILE_HISTFILE.get().map(|path| path.to_path_buf()).unwrap()
|
|
|
|
FILE_HISTFILE.get().map(|path| path.to_path_buf()).unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn clipboard_file() -> PathBuf {
|
|
|
|
|
|
|
|
CLIPBOARD_FILE.get().map(|path| path.to_path_buf()).unwrap()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn workspace_config_file() -> PathBuf {
|
|
|
|
pub fn workspace_config_file() -> PathBuf {
|
|
|
|
find_workspace().0.join(".helix").join("config.toml")
|
|
|
|
find_workspace().0.join(".helix").join("config.toml")
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -215,6 +227,10 @@ pub fn default_file_histfile() -> PathBuf {
|
|
|
|
state_dir().join("file_history")
|
|
|
|
state_dir().join("file_history")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn default_clipboard_file() -> PathBuf {
|
|
|
|
|
|
|
|
state_dir().join("clipboard")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Merge two TOML documents, merging values from `right` onto `left`
|
|
|
|
/// Merge two TOML documents, merging values from `right` onto `left`
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// When an array exists in both `left` and `right`, `right`'s array is
|
|
|
|
/// When an array exists in both `left` and `right`, `right`'s array is
|
|
|
|