[codex] Add numbered list continuation - #90
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40e1a8be5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| key: "Enter", | ||
| run: continueOrderedListCommand, | ||
| }, | ||
| ...searchKeymap, |
There was a problem hiding this comment.
Move ordered-list Enter binding before default keymaps
This Enter binding is added to buildBaseKeymap, but keymapExtension appends base bindings after bindings, and bindings includes CodeMirror defaultKeymap from app.tsx (which already handles Enter via newline/indent). In practice, pressing Enter in an ordered list will be consumed by the earlier default handler, so continueOrderedListCommand never runs and the new feature is effectively inactive.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds ordered-list “Enter” behavior to the CodeMirror Markdown editor so pressing Enter in a numbered item continues numbering, preserves . vs ) delimiter style, and exits the list when the current item is empty.
Changes:
- Added
continueOrderedListCommandto generate the next ordered-list marker (or remove an empty marker). - Wired the command to the
Enterkey via the editor base keymap. - Added unit tests covering continuation, delimiter preservation, and exiting empty items.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/controllerShortcuts.test.ts |
Adds unit tests for ordered-list continuation and exit behavior; updates the FakeView dispatch typing to allow scrollIntoView. |
src/renderer/editor/codemirror/extensions.ts |
Adds an Enter keybinding intended to run continueOrderedListCommand. |
src/renderer/editor/codemirror/commands.ts |
Implements continueOrderedListCommand to continue numbering / preserve delimiter / remove empty list markers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const buildBaseKeymap = | ||
| (): import("@codemirror/view").KeyBinding[] => [...searchKeymap]; | ||
| (): import("@codemirror/view").KeyBinding[] => [ | ||
| { | ||
| key: "Enter", | ||
| run: continueOrderedListCommand, | ||
| }, | ||
| ...searchKeymap, | ||
| ]; |
Summary
Validation