Skip to content

Codeblock indent rnw pr - #3298

Closed
rnwelsh wants to merge 2 commits into
marktext:developfrom
rnwelsh:Codeblock-indent-rnw-pr
Closed

rnwelsh wants to merge 2 commits into
marktext:developfrom
rnwelsh:Codeblock-indent-rnw-pr

Conversation

@rnwelsh

@rnwelsh rnwelsh commented Jun 9, 2022

Copy link
Copy Markdown
Q A
Bug fix? yes
New feature? no
Breaking changes? no
Deprecations? no
New tests added? not needed
Fixed tickets #3273
License MIT

inserts \u0020 (Space) instead of \u00a0 (NBSP) with tab key

Inserting the NBSP character from tabs causes bugs when copying code from a codeblock in certain environments. The specific issue I encountered was with Oracle Database, where the NBSP is not interchangeable with a space character.

Q A
Bug fix? yes
New feature? yes
Breaking changes? no
Deprecations? no
New tests added? not needed
Fixed tickets #2427
License MIT

Maintain indentation within codeblocks

With a minor adjustment to the regex for detecting indentation within codeblocks, indentation level is maintained on the next line. I also included an update so that backspace decreases indentation when the cursor is directly behind at least a tabWidth of whitespace, and a range is not selected.

@Jocs

Jocs commented May 15, 2026

Copy link
Copy Markdown
Member

This project recently merged a large refactor (electron-vite migration, PR #4001) that upgraded dependencies and fixed several issues.

Please review this PR and let us know if it is still needed, or if the changes have already been addressed upstream.

Note: This PR currently has merge conflicts with the develop branch. If you decide to continue with this PR, please rebase or merge the latest develop branch to resolve the conflicts before it can be reviewed.

@Jocs

Jocs commented May 20, 2026

Copy link
Copy Markdown
Member

Thank you for the contribution. We're closing this PR for a few reasons:

  1. It has no description, making the intent hard to review.
  2. It overlaps with feature #3274: Select multiple lines in the code block and press tab … #3275, which addresses the same area (src/muya/lib/contentState/tabCtrl.js) with a clearer scope.
  3. It also touches .gitignore and .nvmrc, which look unrelated to a codeblock-indent change and are likely accidental.
  4. The diff conflicts with develop after the electron-vite refactor (Re-Factor MarkText with electron-vite #4001).

If the underlying codeblock-indent improvement is still relevant, please feel free to open a focused new PR against the latest develop branch — we'd be happy to review it.

@Jocs Jocs closed this May 20, 2026
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