feat: lift IIndentationStrategy and wire auto-indent on Enter#95
Merged
Conversation
…t on Enter Lift IIndentationStrategy and DefaultIndentationStrategy from AvaloniaEdit (commit d7a6b63) into src/Terminal.Gui.Editor/Indentation/ with namespace Terminal.Gui.Text.Indentation. The default strategy copies leading whitespace from the previous line when Enter is pressed. - Add Editor.IndentationStrategy property (defaults to DefaultIndentationStrategy) - Wire Command.NewLine to call IndentLine on the new line after insertion - Add Auto Indent toggle to ted's Options menu (first-class consumer) - Add unit tests for DefaultIndentationStrategy and Editor auto-indent integration - Update UPSTREAM.md with Indentation/ lift and modification log - Skip CSharp/ subfolder (language-specific strategies are out of scope) Closes #TBD Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e79ef10 to
70a1e4a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70a1e4aa56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The newline insertion and IndentLine call are now inside a single RunUpdate scope so Ctrl+Z undoes both in one step, matching the pre-auto-indent Enter behavior. Addresses PR #95 review feedback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Lifts \IIndentationStrategy\ and \DefaultIndentationStrategy\ from AvaloniaEdit (commit \d7a6b63) into \src/Terminal.Gui.Editor/Indentation/\ (namespace \Terminal.Gui.Text.Indentation). Wires the strategy into the Editor so pressing Enter auto-indents by copying leading whitespace from the previous line.
Implements the \specs/indentation/spec.md\ specification.
Changes
Lifted from AvaloniaEdit
Editor integration
ull\ to disable auto-indent
ted (first-class consumer)
ull\
Tests
UPSTREAM.md
Test results
All 336 tests pass (0 errors, 0 failures).