Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-loader/src/lib.rs')
-rw-r--r--helix-loader/src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs
index 54980dd7..37ec9ec3 100644
--- a/helix-loader/src/lib.rs
+++ b/helix-loader/src/lib.rs
@@ -132,6 +132,15 @@ pub fn cache_dir() -> PathBuf {
path
}
+pub fn state_dir() -> PathBuf {
+ let strategy = choose_base_strategy().expect("could not determine XDG strategy");
+ let mut path = strategy
+ .state_dir()
+ .expect("state_dir is always Some for default base strategy");
+ path.push("helix");
+ path
+}
+
pub fn config_file() -> PathBuf {
CONFIG_FILE.get().map(|path| path.to_path_buf()).unwrap()
}
@@ -152,6 +161,11 @@ pub fn default_log_file() -> PathBuf {
cache_dir().join("helix.log")
}
+// TODO: personal dictionary per language.
+pub fn personal_dictionary_file() -> PathBuf {
+ state_dir().join("personal-dictionary.txt")
+}
+
/// Merge two TOML documents, merging values from `right` onto `left`
///
/// `merge_depth` sets the nesting depth up to which values are merged instead