Skip to content

fix: #1592 support real Tab input and list indentation - #5891

Merged
Jocs merged 3 commits into
developfrom
fix/1592-real-tabs
Oct 27, 2026
Merged

Jocs merged 3 commits into
developfrom
fix/1592-real-tabs

Conversation

@Jocs

@Jocs Jocs commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Closes #1592
Closes #2114

Summary

The visual editor always inserted spaces for Tab, and the existing list indentation “Tab” option still emitted spaces. This PR adds real U+0009 input through the existing preference and makes list serialization emit valid Tab indentation.

  • Rename the existing “Tab width” dropdown to “Tab key input” and add a real Tab choice. Keep numeric choices and the four-space default.
  • Use the chosen input unit for caret insertion and code auto-indent. A Tab key edit has its own undo step. A list's first item stays unchanged when it cannot indent; table navigation is unchanged.
  • Keep list indentation independent from text/code input. Generate tabs plus spaces where necessary to retain nesting, including ordered lists and quotes.
  • Restore code payload tabs that Marked expands while parsing lists. Structural columns are consumed; code text retains its actual tabs and spaces.
  • Display existing tabs at four-column stops.

Validation

  • Muya unit tests: 3,924 passed.
  • Desktop unit tests: 1,441 passed.
  • CommonMark/GFM regression suites: 1,347 tests passed. These include the suites' existing expected failures; this is not a claim of complete specification compliance.
  • Chromium: 5 tests passed for real Tab input/deletion/undo, tab-stop display, table navigation, and nested-list HTML export.
  • Root and Muya ESLint, root and Muya type checks, and circular-dependency checks passed. ESLint retains existing warnings.

Scope and follow-ups

This is PR1 of the split. Selection replacement, multiline indent/outdent, and grouped list moves are implemented separately by #5905 for #2052.

This PR does not add list/code syntax fields, source-prefix arrays, indentation transactions, or new state projection logic. Saving may rebuild structural indentation according to the existing list preference. Exact preservation of untouched source prefixes and inherited branch formatting is deferred; the broader request is tracked by #2189.

Marked 18.1.2 still has native parsing differences for some imported multi-level quotes containing tabs. This PR keeps generated quoted list indentation compatible with CommonMark and Marked; it does not replace the quote parser.

Source mode is outside this change. No new preference key or preference row is introduced.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Build artifacts for PR #5891:

Run: https://github.com/marktext/marktext/actions/runs/40454334440

Artifact Size Link
marktext-macos-arm64 301.0 MB Download
marktext-windows-x64 299.7 MB Download
marktext-windows-arm64 291.5 MB Download
marktext-macos-x64 314.3 MB Download
marktext-linux-arm64 523.5 MB Download
marktext-linux-x64 669.6 MB Download

@Jocs
Jocs force-pushed the fix/1592-real-tabs branch from 6233223 to 4de7cec Compare October 27, 2026 02:20
@Jocs
Jocs force-pushed the fix/1592-real-tabs branch from 4de7cec to 58b6881 Compare October 27, 2026 03:56
@Jocs Jocs changed the title fix: #1592 support real tabs in the visual editor fix: #1592 support real Tab input and list indentation Oct 27, 2026
@Jocs
Jocs merged commit 168b4d4 into develop Oct 27, 2026
19 checks passed
Tkaixiang added a commit that referenced this pull request Nov 23, 2026
…te keys on build (#6120)

* fix(i18n): translate strings left in English

Several feature PRs added English placeholder values to most locales and
they were never translated:

- sideBar.move.* (13 keys, #5945): de, es, fr, ja, ko, nl, pt, ru, tr, zh-TW
- multi-folder sidebar strings (12 keys, #5835): de, es, fr, ja, ko, nl, pt,
  ru, tr
- preferences.editor.fileRepresentation.tabInputNotes (#5891): same 9 locales

Also fills one-off gaps: GitHub Alerts labels in pl (desktop and Muya) and
it (Muya), the Academic export theme in it, and the super/subscript
extension label in es and pt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(i18n): remove unused locale keys

None of these keys is referenced anywhere in packages/desktop/src, either
as a literal or through a template/prefix key:

- menu.counter.document, documentSelection, charactersNoSpaces,
  allCharacters
- sideBar.tree.noFolders, overlappingFolder
- sideBar.search.searchInFolder (the UI uses searchInFolders)
- preferences.theme.modeThemes
- dialog.file, files, keepOpen, saveFailure
- error.report, unexpectedErrorWithMessage
- store.editor.anchorLinkCopied
- editor.sourceCode.cursorNullComment, imageStructureDeletedComment
- readingMode.skipped

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* build(i18n): validate locale keys before minifying

minify-locales now fails, before writing any .min.json, when:

- a locale is missing a key from en.json or has a key en.json lacks
- an en.json key is not referenced by any .ts or .vue file under
  packages/desktop/src

The usage check is a single ripgrep pass that collects quoted dotted
strings. Template literals (`menu.theme.${name}`) and concatenation
prefixes ('sideBar.move.') match as patterns, so keys built from a
variable still count as used. ripgrep comes from @vscode/ripgrep,
resolved through packages/desktop, which already declares it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Intent with tabs at code blocks Is it possible to indent with tabs?

1 participant