feat(editor): indent with tab by default in code block#2982
Draft
gabrielmfern wants to merge 4 commits intofeat/ai-oss-editorfrom
Draft
feat(editor): indent with tab by default in code block#2982gabrielmfern wants to merge 4 commits intofeat/ai-oss-editorfrom
gabrielmfern wants to merge 4 commits intofeat/ai-oss-editorfrom
Conversation
|
Cursor Agent can help with this pull request. Just |
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
ac8caa9 to
5b2e437
Compare
…s tab size Override Tab and Shift-Tab keyboard shortcuts in CodeBlockPrism to dynamically read the tabSize from the code block's selected theme (e.g., dracula uses 4 spaces, oneDark uses 2 spaces) instead of using a hardcoded value. Falls back to 2 spaces when no theme is set. Co-authored-by: Gabriel Miranda <gabrielmfern@outlook.com>
- Replace dynamic namespace import with named imports and a static theme lookup record to avoid noDynamicNamespaceImportAccess warning - Fix biome formatting: collapse multi-line chains to single lines Co-authored-by: Gabriel Miranda <gabrielmfern@outlook.com>
5dd121f to
398788e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(editor): Dynamically adjust code block tab size based on theme
This PR enhances the code block functionality in the editor by making Tab/Shift-Tab indentation dynamic, respecting the
tabSizedefined by the currently selected theme.Previously, code block indentation used a static tab size, leading to inconsistencies when themes with different
tabSizevalues (e.g., 2-space vs. 4-space) were applied.This change:
TabandShift-Tabkeyboard shortcuts within theCodeBlockPrismextension.getThemeTabSizehelper to extract thetabSizefrom the active code block's theme (e.g.,dracula,oneDark) from@react-email/components.tabSizefor both indenting (Tab) and outdenting (Shift-Tab), supporting both single cursor and multi-line selections.This ensures that the editor's indentation behavior aligns with the visual styling of the chosen code block theme, improving consistency and user experience.
Slack Thread
Summary by cubic
Make Tab and Shift‑Tab indent/outdent in code blocks using the active theme’s tab size, with a 2‑space fallback. Supports single-cursor and multi-line selections with correct cursor handling.
Written for commit 398788e. Summary will update on new commits.