-
Notifications
You must be signed in to change notification settings - Fork 7
Labels
action scriptsOfficial action scripts or action scripts featuresOfficial action scripts or action scripts features
Milestone
Description
Feature Summary
Introduce an "Auto Indent" action that automatically adjusts the indentation of selected lines or the entire document by modes.
Motivation
Manual indentation is error-prone and time-consuming, especially in code-heavy documents or structured formats like YAML, Python, or Markdown. An auto-indent feature improves readability, enforces consistency, and reduces cognitive load during editing. We had this feature before, but it has become Auto Format, so the implementation will be similar.
Proposed Design
- Add keyboard shortcut for "Auto Indent". (menu item is in
Edit > Indention > Auto Indent) - If no selection is made, apply to the entire document.
- If lines are selected, apply only to the selection.
- Allow configuration of tab size and spaces vs tabs.
Acceptance Criteria
- Users can trigger "Auto Indent" via shortcut or command palette.
- Indentation is applied correctly by current mode.
- No content is lost or corrupted during indentation.
- Works with both single-line and multi-line selections.
- Respects user preferences for tab width and indentation style.
Related Issues / Discussions
Nothing
Implementation Notes (Optional)
- Consider fallback strategies for unknown file types (e.g., consistent leading whitespace).
- Integrate with undo stack for safe experimentation.
Localization & Accessibility
- Localize command name and tooltip.
- Ensure keyboard shortcut is customizable and accessible.
Community Feedback (Optional)
Nothing
Metadata
Metadata
Assignees
Labels
action scriptsOfficial action scripts or action scripts featuresOfficial action scripts or action scripts features
Type
Projects
Status
Completed