mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-11 02:19:56 -06:00
Part of #4936: custom dictionary and Ignore All commands
text.spelling.addWord, removeWord and changeWord are Check Spelling's Add and Edit Custom Dictionary's Add, Delete and Change; text.spelling.dictionary lists the words. They live in craft-proof, which every language's check reads. The desktop app and vectorcraft-cli keep them in `Custom Dictionary.txt` next to the preferences (none without preferences); elsewhere they last until the app closes. text.spelling.ignoreAll is Ignore All: the active document's checks skip the word while it is open; not saved, not undoable, and not a change to the document's revision. Behaviour: https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/check-and-correct-spelling.html
This commit is contained in:
@@ -224,12 +224,14 @@ fn main() -> ExitCode {
|
||||
}
|
||||
|
||||
/// A headless session that remembers what the user keeps between runs: the PDF presets saved, the
|
||||
/// ICC profiles loaded and the plug-ins installed (#2168, #2174, #2541), in the folders next to the preferences that the desktop
|
||||
/// app uses too. `VECTORCRAFT_NO_PREFS` and `VECTORCRAFT_CONFIG_DIR` apply as they do there.
|
||||
/// ICC profiles loaded, the plug-ins installed (#2168, #2174, #2541) and the custom dictionary's words (#4936), in the folders
|
||||
/// and files next to the preferences that the desktop app uses too. `VECTORCRAFT_NO_PREFS` and `VECTORCRAFT_CONFIG_DIR` apply
|
||||
/// as they do there.
|
||||
fn with_stores(mut h: Headless) -> Headless {
|
||||
prefs_dir::attach_profile_store(&mut h.session);
|
||||
prefs_dir::attach_plugin_store(&mut h.session);
|
||||
prefs_dir::attach_pdf_preset_store(&mut h.session);
|
||||
prefs_dir::attach_custom_dictionary(&mut h.session);
|
||||
h
|
||||
}
|
||||
|
||||
|
||||
@@ -466,6 +466,8 @@ fn main() -> std::process::ExitCode {
|
||||
// The saved PDF presets live in their own folder (also read by vectorcraft-cli),
|
||||
// which takes over from the copy the preferences file used to hold.
|
||||
prefs_dir::attach_pdf_preset_store(&mut app.session);
|
||||
// The custom dictionary's words, kept in their own file next to the preferences.
|
||||
prefs_dir::attach_custom_dictionary(&mut app.session);
|
||||
// Fit the window to its monitor, or put it back where it was (still hidden).
|
||||
let winit_window = cc.winit_window().cloned();
|
||||
if let Some(w) = &winit_window {
|
||||
|
||||
@@ -57,6 +57,14 @@ pub fn attach_pdf_preset_store(session: &mut vectorcraft_engine::Session) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Keep the custom dictionary (Edit › Spelling › Add, Edit Custom Dictionary) in the
|
||||
/// `Custom Dictionary.txt` file next to the settings, one word per line, and take in its words.
|
||||
pub fn attach_custom_dictionary(session: &mut vectorcraft_engine::Session) {
|
||||
if let Some(path) = store_dir("Custom Dictionary.txt") {
|
||||
session.attach_custom_dictionary(path);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user