Repository navigation
fix: make every editor preference take effect and save it as soon as it changes - #20
Merged
Merged
Conversation
The --version check read argv with std::env::args(), which panics on an argument that is not valid Unicode, so a file manager passing a Latin-1 path aborted Avalon at startup. Read argv as OsString instead. Also replace an em dash in a Cargo.toml comment.
…it changes Most editor preferences were stored but never read, and settings were only written when the Settings window closed. - The editor font, size, zoom and line spacing now set the text in the main editor, split view, focus mode and composition mode. The editor width and the composition text width set the text column width. - Smart punctuation applies curly quotes, em dashes and ellipses as you type. Its substitution toggles are now project settings, so they are saved too. - "Word count in status bar" shows or hides the counts, and "Show synopses in binder" shows a synopsis tooltip on binder items. - Removed the controls that could not work: typewriter scrolling, paragraph marks, as-you-type spell check, default document type and scene auto-numbering, plus the unused composition colours. Older project files that still carry them load as before. - Each settings change writes the title and settings into project.json at once, without rewriting the documents. - Recording an insertion no longer panics when the stale cursor range falls inside a multi-byte character.
Double hyphens after the | of a table row, as in | --- |, no longer turn into an em dash. A Backspace right after a smart punctuation correction puts back the characters it replaced. AutoCorrection loads with serde defaults and drops capitalize_sentences and superscript_ordinals, which nothing read.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Most editor preferences in the Settings window were stored in the project but never read, and settings reached the disk only when the Settings window closed. Each preference now either works or is gone, and every change is saved at once.
Every project setting and its fate
editor_fonteditor_font_sizeeditor_zoomline_spacingeditor_widthfullscreen_text_widthshow_word_countshow_synopsis_in_bindersmart_punctuationauto_correction(new)smart_quotes,em_dashes,ellipsis), saved like the others, and applied as you type. Double hyphens at the start of a line, after punctuation or after the|of a table row stay as they are, so Markdown rules (---), comments (<!--) and table rules (|---|,| --- |) keep working.capitalize_sentences,superscript_ordinals(inside the old auto-correction state)project.json.auto_save_seconds,target_word_count,target_deadline,auto_backup,backup_interval_saves,labels,statusestypewriter_scrollshow_paragraph_marksspell_check_enableddefault_doc_typeauto_numberingfullscreen_bg_color,composition_bg_colorhigh_contrast,large_ui,ui_scale,reduce_motion,screen_reader_hintsSmart punctuation is on by default
smart_punctuationand the three substitutions default to on, and projects saved by older versions already carrysmart_punctuation: true, so every existing project now gets curly quotes, em dashes and ellipses as you type. A Backspace right after a correction puts back the characters you typed (",',--,...), so a literal straight quote or double hyphen takes one extra key. The README says so.Saving
project.json, through the same atomic write as a full save. It does not rewrite every document on each keystroke in a settings field, and it never records binder entries whose documents are not on disk yet. A project that was never saved keeps its settings until its first save, as before.auto_correction.Also in this PR
--versioncheck reads the command line withstd::env::args_os(), so an argument that is not valid UTF-8 no longer aborts Avalon at startup. (fix: start normally when a command-line argument is not valid UTF-8 #18 also replaced an em dash in aCargo.tomlcomment; chore(deps): move PDF export to printpdf 0.12 and drop unused dependencies #19 already made that change on main.)How it was verified
save_settingsleaves unsaved binder entries out; aproject.jsonwith every removed field and noauto_correctionstill loads.cargo fmt --checkandcargo clippy --locked --all-targets -- -D warningspass locally, as do the targeted tests. CI runs the full matrix.BEGIN_COMMIT_OVERRIDE
fix: make every editor preference take effect and save it as soon as it changes
fix: start normally when a command-line argument is not valid UTF-8
END_COMMIT_OVERRIDE