Skip to content

[codex] Add numbered list continuation - #90

Open
bendsp wants to merge 2 commits into
codex/editor-quality-passfrom
codex/feature-numbered-list-continuation
Open

[codex] Add numbered list continuation#90
bendsp wants to merge 2 commits into
codex/editor-quality-passfrom
codex/feature-numbered-list-continuation

Conversation

@bendsp

@bendsp bendsp commented May 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • continue ordered Markdown list numbering when pressing Enter inside a numbered item
  • preserve dot/paren delimiter style for the next item
  • exit an empty numbered item by removing its marker

Validation

  • pnpm lint
  • pnpm typecheck
  • pnpm test:unit

Copilot AI review requested due to automatic review settings May 9, 2026 14:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +43 to +46
key: "Enter",
run: continueOrderedListCommand,
},
...searchKeymap,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 continueOrderedListCommand to generate the next ordered-list marker (or remove an empty marker).
  • Wired the command to the Enter key 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.

Comment on lines 40 to +47
export const buildBaseKeymap =
(): import("@codemirror/view").KeyBinding[] => [...searchKeymap];
(): import("@codemirror/view").KeyBinding[] => [
{
key: "Enter",
run: continueOrderedListCommand,
},
...searchKeymap,
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants