mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-30 21:47:00 -06:00
Merge pull request #1518
Automatic lists work without Replace text as you type
This commit is contained in:
@@ -142,7 +142,7 @@ pub fn correct_word(prefs: &crate::Prefs, word: &str, sentence_start: bool, typi
|
||||
|
||||
/// After a space or punctuation, correct the word just typed.
|
||||
pub(super) fn autocorrect(s: &mut Session, typing: bool) -> Result<()> {
|
||||
if !s.prefs.autocorrect {
|
||||
if !s.prefs.autocorrect && !(typing && s.prefs.ac_lists) {
|
||||
return Ok(());
|
||||
}
|
||||
let st = s.doc()?;
|
||||
@@ -160,6 +160,9 @@ pub(super) fn autocorrect(s: &mut Session, typing: bool) -> Result<()> {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
if !s.prefs.autocorrect {
|
||||
return Ok(());
|
||||
}
|
||||
let mut word_end = end - 1;
|
||||
let mut start = word_end;
|
||||
while start > 0 && line.get(start - 1).is_some_and(|c| !c.is_whitespace()) {
|
||||
|
||||
@@ -4429,6 +4429,16 @@ fn autoformat_starts_bulleted_and_numbered_lists_as_you_type() {
|
||||
assert_eq!(s.execute("text.autocorrect", &json!({})).unwrap()["lists"], true);
|
||||
s.execute("text.autocorrect", &json!({"lists": false})).unwrap();
|
||||
assert_eq!(typed(&mut s, "* x"), ("* x".to_string(), none));
|
||||
// List AutoFormat is independent of the Replace text as you type setting.
|
||||
s.execute("text.autocorrect", &json!({"on": false, "lists": true})).unwrap();
|
||||
assert_eq!(typed(&mut s, "*"), ("*".to_string(), Some(Bullet::None)));
|
||||
s.execute("text.insert", &json!({"text": " "})).unwrap();
|
||||
assert_eq!(para(&s), (String::new(), ch("•")));
|
||||
s.execute("text.delete", &json!({"dir": "backward"})).unwrap();
|
||||
assert_eq!(para(&s), ("* ".to_string(), Some(Bullet::None)));
|
||||
// Word replacements still run while list formatting is disabled.
|
||||
s.execute("text.autocorrect", &json!({"on": true, "lists": false})).unwrap();
|
||||
assert_eq!(typed(&mut s, "teh "), ("The ".to_string(), Some(Bullet::None)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
# Where DeckCraft falls short of PowerPoint
|
||||
|
||||
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-22 · **Change:** minor (Animation Pane ▸ Play From; previous: minor, native chart payloads stored in bounded ZIP members; previous: major, community PR wave 2026-10-14: soak tests, PPTX corpus, comment threads (#70), embedded fonts, SmartArt Text Pane, Animation Pane timeline, Hunspell spelling, thesaurus, AutoCorrect, 14 new dialogs, pen pressure and trackpad gestures; duplicated entries and headers folded; previous: minor, 3-D bevel, camera and face lighting rendered) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
|
||||
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-28 · **Change:** trivial (AutoFormat lists run independently of Replace text as you type; previous: minor, Animation Pane ▸ Play From; previous: minor, native chart payloads stored in bounded ZIP members; previous: major, community PR wave 2026-10-14: soak tests, PPTX corpus, comment threads (#70), embedded fonts, SmartArt Text Pane, Animation Pane timeline, Hunspell spelling, thesaurus, AutoCorrect, 14 new dialogs, pen pressure and trackpad gestures; duplicated entries and headers folded; previous: minor, 3-D bevel, camera and face lighting rendered) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
|
||||
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-20 · **Change:** trivial (empty chart number-format sections hide values; previous: minor, native chart payloads stored in bounded ZIP members; previous: major, community PR wave 2026-10-14: soak tests, PPTX corpus, comment threads (#70), embedded fonts, SmartArt Text Pane, Animation Pane timeline, Hunspell spelling, thesaurus, AutoCorrect, 14 new dialogs, pen pressure and trackpad gestures; duplicated entries and headers folded; previous: minor, 3-D bevel, camera and face lighting rendered) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
|
||||
|
||||
Every known shortfall, one entry each, ranked by how much it stops someone who presents with
|
||||
@@ -268,8 +268,8 @@ and starts at that effect. The pane has an advanced timeline with draggable bars
|
||||
PowerPoint's options (two initial capitals, sentence and day capitals, caps lock, fractions, an
|
||||
editable replace list), and AutoFormat superscripts ordinals (1st) and starts bulleted and
|
||||
numbered lists (`* `, `1. `) as you type; no undo of a single correction. Automatic lists start
|
||||
only while Replace text as you type is on, where PowerPoint has a separate AutoFormat option,
|
||||
and Backspace right after one puts the typed lead back, which PowerPoint does not.
|
||||
independently of Replace text as you type, and Backspace right after one puts the typed lead
|
||||
back, which PowerPoint does not.
|
||||
- **Estimate:** 1–2 h (bundle openly licensed dictionaries; under 1 h for the AutoFormat option).
|
||||
|
||||
### Copying text and cell ranges
|
||||
@@ -372,6 +372,7 @@ Detail in [localization-parity.md](localization-parity.md).
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-28 | trivial | Automatic lists now run independently of Replace text as you type; proofing gap description updated |
|
||||
| 2026-10-25 | trivial | New entries: copying text and cell ranges (no media, no table), a control-server timing test that may fail under load; Proofing notes that automatic lists follow Replace text as you type and that Backspace puts the typed lead back |
|
||||
| 2026-10-24 | trivial | AutoFormat starts bulleted and numbered lists as you type (`* `, `-- `, `> `, `1. `, `a) ` and the rest), with an AutoCorrect option to turn it off |
|
||||
| 2026-10-22 | minor | Animation Pane ▸ Play From starts the preview at the selected effect; gap 10 keeps the effect gallery (7–13 h) |
|
||||
|
||||
Reference in New Issue
Block a user