Skip to content

feat(editor): indent lists by the marker above - #523

Merged
tomymaritano merged 1 commit into
developfrom
feat/editor-list-indent
Aug 20, 2026
Merged

feat(editor): indent lists by the marker above#523
tomymaritano merged 1 commit into
developfrom
feat/editor-list-indent

Conversation

@tomymaritano

Copy link
Copy Markdown
Collaborator

Why

Tab always indented by two spaces. That nests a bullet under -, but not under 1. (needs 3) or 10. (needs 4). Inkdrop v6.1 fixed this last week; we still had indentWithTab.

What

  • Tab / Shift-Tab indent a list item by the marker width of the item above (- → 2, 1. → 3, 10. → 4). Descendants move with the parent.
  • Numbered lists in the same region are renumbered in the same undo step.
  • List markers in the editor are colored by nesting level (--md-list-mark-color, --md-list-mark-2-color, --md-list-mark-3-color). Deeper levels cycle. Preview markers stay text-colored unless a theme opts into --mde-preview-list-marker-*.
  • Tables still own Tab inside a cell (plugin keymap is later). Plain lines still fall through to indentWithTab.

Independent of #522.

Test plan

  • In a note: 1. parent then - child. Tab on the bullet — it should sit three spaces in and render nested.
  • Shift-Tab lifts it back. One undo reverts both the indent and any renumber.
  • 1. a / 2. b / 3. c — Tab on 2. → nested 1. b, outer 2. c.
  • Nested bullets get a second/third marker color in the editor.
  • Tab inside a table cell still moves between cells.
  • Tab on a non-list line still indents by tab size.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tomymaritano, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 540c2c1e-efa9-4dad-905b-b0a8893ea1e5

📥 Commits

Reviewing files that changed from the base of the PR and between 73f1078 and 068ec3f.

📒 Files selected for processing (11)
  • apps/desktop/src/renderer/components/MarkdownEditor.tsx
  • apps/desktop/src/renderer/components/editor/MarkdownPreview.module.css
  • apps/desktop/src/renderer/components/editor/__tests__/listMarkDecorations.test.ts
  • apps/desktop/src/renderer/components/editor/listMarkDecorations.ts
  • apps/desktop/src/renderer/components/editorTheme.ts
  • apps/desktop/src/renderer/ui/tokens/tokens.css
  • packages/commands/src/index.ts
  • packages/commands/src/markdown/listIndent.test.ts
  • packages/commands/src/markdown/listIndent.ts
  • packages/plugin-api/src/theme/themeTypes.ts
  • packages/plugin-api/tests/themeTypes.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

tomymaritano added a commit that referenced this pull request Aug 20, 2026
## Why

Inkdrop v6.1 shipped 30 `editor:*` line commands and Enter that
continues a list. We had copy/move line only because CodeMirror's
default keymap binds them — they were invisible in the palette, and
Enter was a plain newline.

## What

- Palette + dispatch for the v6.1 set: copy/move line, select line,
matching bracket, subword, comments, sort, join, case, find-under, split
selection, scroll.
- Enter continues bullets, numbered lists (and renumbers), tasks (`- [
]`), and blockquotes. An empty item outdents / leaves the block. Fences
fall through.
- `<!-- -->` via `toggleComment` in Markdown (line comments still come
from the fenced language).
- Multiple selections enabled so "select all occurrences" actually adds
cursors.
- Keybindings that match Inkdrop where they don't collide:
  - Alt+↑/↓ move line, Shift+Alt+↑/↓ copy (already in CM)
- Mod+L select line, Mod+/ toggle comment, Mod+F3 find under, Alt+F3
select all
- F5/F9 sort, Ctrl+J join, Ctrl+Alt+←/→ subword (CM keymap — registry
treats Ctrl as Mod)
- **Not rebound:** Mod+Enter stays Edit with AI (`insert-blank-line` is
palette-only). Mod+Shift+Enter stays follow-link (`insert-line-before`
is palette-only). Mod+D stays duplicate note.

Independent of #522 and #523.

## Test plan

- [ ] `- item` then Enter → new `- ` sibling. Enter on an empty `- ` →
leaves the list.
- [ ] `1. a` / `2. b`, Enter at the end of a → `2. ` inserted, `b`
becomes `3.`
- [ ] `> quote` Enter continues `> `. Empty `> ` exits.
- [ ] Enter inside a fence is a normal newline.
- [ ] Select three lines, Command Palette → Sort Lines.
- [ ] Alt+↑ moves the line. Shift+Alt+↓ copies it down.
- [ ] Mod+L selects the line. Mod+/ wraps the line in `<!-- -->`.
- [ ] Palette → Join Lines on two lines. Ctrl+J does the same.
- [ ] Command Palette lists the new editor commands.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added enhanced Markdown editing, including automatic continuation for
lists, task lists, blockquotes, and ordered-list numbering.
* Added editor commands for selecting, moving, sorting, joining,
splitting, and transforming lines and text.
* Added search-under, occurrence selection, scrolling, cursor centering,
and multiple-selection support.
* Added the new editing actions to the command palette with keyboard
shortcuts.

* **Bug Fixes**
  * Markdown comments are now recognized correctly.
* List continuation is disabled within fenced code blocks and handles
empty list items appropriately.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@tomymaritano
tomymaritano force-pushed the feat/editor-list-indent branch 3 times, most recently from 3003b15 to 4863346 Compare August 20, 2026 05:53
Tab always added two spaces, so a bullet under `1.` never nested.
Match Inkdrop: indent by the marker width, renumber, color marks.
@tomymaritano
tomymaritano force-pushed the feat/editor-list-indent branch from 4863346 to 068ec3f Compare August 20, 2026 05:56
@tomymaritano
tomymaritano merged commit 6634239 into develop Aug 20, 2026
16 checks passed
@tomymaritano
tomymaritano deleted the feat/editor-list-indent branch August 20, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant