[codex] Add bulleted list continuation - #89
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 554c566182
ℹ️ 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".
| const match = line.text.match(/^(\s*)([-*+])\s+(.*)$/); | ||
| if (!match) { |
There was a problem hiding this comment.
Restrict Enter continuation to real list syntax
This handler treats any line matching ^\s*[-*+]\s+ as a list item without checking Markdown parse context, so pressing Enter inside fenced/indented code blocks (or other non-list contexts) that contain lines like - flag will incorrectly inject another bullet marker instead of a normal newline. That is a behavior regression introduced by this keybinding because it now rewrites non-list content based on plain text shape alone.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds a CodeMirror command and keybinding intended to continue unordered Markdown list markers on Enter, including exiting an empty list item, with unit tests covering the new command behavior.
Changes:
- Introduces
continueUnorderedListCommandto continue (or exit) unordered list items onEnter. - Wires an
Enterkeybinding into the editor base keymap. - Adds unit tests for continuation, empty-item exit, and fallthrough behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/controllerShortcuts.test.ts |
Adds unit tests for unordered list continuation / exit behavior and updates the FakeView dispatch type to accept scrollIntoView. |
src/renderer/editor/codemirror/extensions.ts |
Adds an Enter keybinding to run continueUnorderedListCommand. |
src/renderer/editor/codemirror/commands.ts |
Implements continueUnorderedListCommand (continue marker or remove marker for empty items). |
💡 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: continueUnorderedListCommand, | ||
| }, | ||
| ...searchKeymap, | ||
| ]; |
| const match = line.text.match(/^(\s*)([-*+])\s+(.*)$/); | ||
| if (!match) { | ||
| return false; | ||
| } | ||
|
|
Summary
Validation