From d0f71d10169f5e6e982c3570a20aef49aedc528a Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 23 May 2026 16:28:24 -0600 Subject: [PATCH 01/10] refactor!: move all namespaces under Terminal.Gui.Editor (#231) BREAKING CHANGE: All namespaces in the Editor assembly are now rooted under Terminal.Gui.Editor.*: - Terminal.Gui.Document -> Terminal.Gui.Editor.Document - Terminal.Gui.Document.Folding -> Terminal.Gui.Editor.Document.Folding - Terminal.Gui.Document.Search -> Terminal.Gui.Editor.Document.Search - Terminal.Gui.Document.Utils -> Terminal.Gui.Editor.Document.Utils - Terminal.Gui.Highlighting -> Terminal.Gui.Editor.Highlighting - Terminal.Gui.Highlighting.Xshd -> Terminal.Gui.Editor.Highlighting.Xshd - Terminal.Gui.Text.Indentation -> Terminal.Gui.Editor.Indentation Consumers must update using directives when upgrading. Closes #231 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CLAUDE.md | 4 ++-- .../DocumentAccessBenchmarks.cs | 2 +- .../Terminal.Gui.Editor.Benchmarks/EditorHarness.cs | 2 +- .../Terminal.Gui.Editor.Benchmarks/FindBenchmarks.cs | 4 ++-- benchmarks/Terminal.Gui.Editor.Benchmarks/Program.cs | 4 ++-- .../Terminal.Gui.Editor.Benchmarks/ScrollingBenchmarks.cs | 2 +- .../VisualLineBuildBenchmarks.cs | 2 +- examples/prompt/Program.cs | 2 +- examples/ted/TedApp.FileOperations.cs | 4 ++-- examples/ted/TedApp.cs | 6 +++--- examples/ted/WordCompletionProvider.cs | 2 +- .../Completion/IEditorCompletionProvider.cs | 2 +- .../Document/DocumentChangeEventArgs.cs | 2 +- .../Document/DocumentChangeOperation.cs | 2 +- .../Document/DocumentChangedEventArgs.cs | 2 +- src/Terminal.Gui.Editor/Document/DocumentLine.LineNode.cs | 2 +- src/Terminal.Gui.Editor/Document/DocumentLine.cs | 2 +- src/Terminal.Gui.Editor/Document/DocumentLineTree.cs | 2 +- src/Terminal.Gui.Editor/Document/DocumentTextWriter.cs | 2 +- src/Terminal.Gui.Editor/Document/IDocument.cs | 2 +- src/Terminal.Gui.Editor/Document/ILineTracker.cs | 2 +- src/Terminal.Gui.Editor/Document/ITextAnchor.cs | 2 +- src/Terminal.Gui.Editor/Document/ITextSource.cs | 2 +- src/Terminal.Gui.Editor/Document/IUndoableOperation.cs | 2 +- src/Terminal.Gui.Editor/Document/LineManager.cs | 2 +- src/Terminal.Gui.Editor/Document/NewLineFinder.cs | 2 +- src/Terminal.Gui.Editor/Document/OffsetChangeMap.cs | 4 ++-- src/Terminal.Gui.Editor/Document/RopeTextSource.cs | 4 ++-- src/Terminal.Gui.Editor/Document/SimpleSegment.cs | 4 ++-- src/Terminal.Gui.Editor/Document/TextAnchor.cs | 4 ++-- src/Terminal.Gui.Editor/Document/TextAnchorNode.cs | 2 +- src/Terminal.Gui.Editor/Document/TextAnchorTree.cs | 4 ++-- src/Terminal.Gui.Editor/Document/TextDocument.cs | 4 ++-- src/Terminal.Gui.Editor/Document/TextDocumentProgress.cs | 2 +- .../Document/TextDocumentWeakEventManager.cs | 4 ++-- src/Terminal.Gui.Editor/Document/TextLocation.cs | 2 +- src/Terminal.Gui.Editor/Document/TextSegment.cs | 2 +- src/Terminal.Gui.Editor/Document/TextSegmentCollection.cs | 4 ++-- .../Document/TextSourceVersionProvider.cs | 2 +- src/Terminal.Gui.Editor/Document/TextUtilities.cs | 2 +- src/Terminal.Gui.Editor/Document/UndoOperationGroup.cs | 4 ++-- src/Terminal.Gui.Editor/Document/UndoStack.cs | 4 ++-- src/Terminal.Gui.Editor/Document/WeakLineTracker.cs | 2 +- src/Terminal.Gui.Editor/Editor.Commands.cs | 4 ++-- src/Terminal.Gui.Editor/Editor.Designable.cs | 4 ++-- src/Terminal.Gui.Editor/Editor.Drawing.cs | 6 +++--- src/Terminal.Gui.Editor/Editor.FileIO.cs | 2 +- src/Terminal.Gui.Editor/Editor.FindReplace.cs | 2 +- src/Terminal.Gui.Editor/Editor.Folding.cs | 4 ++-- src/Terminal.Gui.Editor/Editor.Indentation.cs | 2 +- src/Terminal.Gui.Editor/Editor.Mouse.cs | 2 +- src/Terminal.Gui.Editor/Editor.MultiCaret.cs | 2 +- src/Terminal.Gui.Editor/Editor.Selection.cs | 2 +- src/Terminal.Gui.Editor/Editor.cs | 8 ++++---- src/Terminal.Gui.Editor/EditorStatusBar.cs | 2 +- src/Terminal.Gui.Editor/EditorTabSettingsTab.cs | 2 +- .../Extensions/ImmutableStackExtensions.cs | 2 +- src/Terminal.Gui.Editor/FindReplaceDialog.cs | 2 +- src/Terminal.Gui.Editor/Folding/BraceFoldingStrategy.cs | 2 +- src/Terminal.Gui.Editor/Folding/FoldingManager.cs | 2 +- src/Terminal.Gui.Editor/Folding/FoldingSection.cs | 2 +- src/Terminal.Gui.Editor/Folding/IFoldingStrategy.cs | 2 +- src/Terminal.Gui.Editor/Folding/NewFolding.cs | 2 +- src/Terminal.Gui.Editor/Folding/XmlFoldingStrategy.cs | 2 +- src/Terminal.Gui.Editor/FoldingGutter.cs | 4 ++-- .../Highlighting/DocumentHighlighter.cs | 8 ++++---- src/Terminal.Gui.Editor/Highlighting/HighlightedLine.cs | 6 +++--- .../Highlighting/HighlightedSection.cs | 4 ++-- src/Terminal.Gui.Editor/Highlighting/HighlightingBrush.cs | 2 +- src/Terminal.Gui.Editor/Highlighting/HighlightingColor.cs | 4 ++-- .../HighlightingDefinitionInvalidException.cs | 2 +- .../Highlighting/HighlightingEngine.cs | 6 +++--- .../Highlighting/HighlightingManager.cs | 6 +++--- src/Terminal.Gui.Editor/Highlighting/HighlightingRule.cs | 2 +- .../Highlighting/HighlightingRuleSet.cs | 4 ++-- src/Terminal.Gui.Editor/Highlighting/HighlightingSpan.cs | 2 +- src/Terminal.Gui.Editor/Highlighting/IHighlighter.cs | 4 ++-- .../Highlighting/IHighlightingDefinition.cs | 2 +- .../IHighlightingDefinitionReferenceResolver.cs | 2 +- .../Highlighting/Resources/Resources.cs | 2 +- .../Highlighting/Xshd/HighlightingLoader.cs | 2 +- src/Terminal.Gui.Editor/Highlighting/Xshd/IXshdVisitor.cs | 2 +- .../Highlighting/Xshd/SaveXshdVisitor.cs | 2 +- src/Terminal.Gui.Editor/Highlighting/Xshd/V2Loader.cs | 2 +- .../Highlighting/Xshd/XmlHighlightingDefinition.cs | 2 +- src/Terminal.Gui.Editor/Highlighting/Xshd/XshdColor.cs | 2 +- src/Terminal.Gui.Editor/Highlighting/Xshd/XshdElement.cs | 2 +- src/Terminal.Gui.Editor/Highlighting/Xshd/XshdImport.cs | 2 +- src/Terminal.Gui.Editor/Highlighting/Xshd/XshdKeywords.cs | 4 ++-- src/Terminal.Gui.Editor/Highlighting/Xshd/XshdProperty.cs | 2 +- .../Highlighting/Xshd/XshdReference.cs | 2 +- src/Terminal.Gui.Editor/Highlighting/Xshd/XshdRule.cs | 2 +- src/Terminal.Gui.Editor/Highlighting/Xshd/XshdRuleSet.cs | 4 ++-- src/Terminal.Gui.Editor/Highlighting/Xshd/XshdSpan.cs | 2 +- .../Highlighting/Xshd/XshdSyntaxDefinition.cs | 4 ++-- src/Terminal.Gui.Editor/Highlighting/XshdRoleMap.cs | 2 +- .../Indentation/DefaultIndentationStrategy.cs | 4 ++-- .../Indentation/IIndentationStrategy.cs | 4 ++-- src/Terminal.Gui.Editor/LineNumberGutter.cs | 2 +- src/Terminal.Gui.Editor/Rendering/CellVisualLine.cs | 2 +- src/Terminal.Gui.Editor/Rendering/FoldingTransformer.cs | 4 ++-- .../Rendering/HighlightingColorizer.cs | 2 +- src/Terminal.Gui.Editor/Rendering/SearchHitRenderer.cs | 4 ++-- .../Rendering/VisualLineBuildContext.cs | 2 +- src/Terminal.Gui.Editor/Rendering/VisualLineBuilder.cs | 2 +- src/Terminal.Gui.Editor/Search/ISearchStrategy.cs | 4 ++-- src/Terminal.Gui.Editor/Search/RegexSearchStrategy.cs | 4 ++-- src/Terminal.Gui.Editor/Search/SearchStrategyFactory.cs | 2 +- src/Terminal.Gui.Editor/Utils/BusyManager.cs | 2 +- src/Terminal.Gui.Editor/Utils/CallbackOnDispose.cs | 2 +- src/Terminal.Gui.Editor/Utils/CharRope.cs | 2 +- src/Terminal.Gui.Editor/Utils/CompressingTreeList.cs | 2 +- src/Terminal.Gui.Editor/Utils/Constants.cs | 2 +- src/Terminal.Gui.Editor/Utils/DelayedEvents.cs | 2 +- src/Terminal.Gui.Editor/Utils/Deque.cs | 2 +- src/Terminal.Gui.Editor/Utils/FileReader.cs | 2 +- src/Terminal.Gui.Editor/Utils/IFreezable.cs | 2 +- src/Terminal.Gui.Editor/Utils/IServiceContainer.cs | 2 +- src/Terminal.Gui.Editor/Utils/NullSafeCollection.cs | 2 +- .../Utils/PropertyChangedWeakEventManager.cs | 2 +- src/Terminal.Gui.Editor/Utils/Rope.cs | 2 +- src/Terminal.Gui.Editor/Utils/RopeNode.cs | 2 +- src/Terminal.Gui.Editor/Utils/RopeTextReader.cs | 2 +- src/Terminal.Gui.Editor/Utils/StringSegment.cs | 2 +- src/Terminal.Gui.Editor/Utils/ThrowUtil.cs | 2 +- .../Utils/ValueStringBuilder.AppendSpanFormattable.cs | 2 +- src/Terminal.Gui.Editor/Utils/ValueStringBuilder.cs | 2 +- src/Terminal.Gui.Editor/Utils/ValueStringBuilder_1.cs | 2 +- src/Terminal.Gui.Editor/Utils/WeakEventManagerBase.cs | 2 +- .../EditorCompletionIntegrationTests.cs | 2 +- .../EditorDisposalTests.cs | 2 +- .../EditorFoldingMouseTests.cs | 4 ++-- .../EditorKeyBindingTests.cs | 4 ++-- .../EditorKillRingTests.cs | 2 +- .../EditorRenderingTests.cs | 2 +- .../EditorSearchHitTests.cs | 2 +- .../EditorSelectionTests.cs | 2 +- .../EditorSingleLineTests.cs | 2 +- .../EditorSnapshotTests.cs | 2 +- tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs | 2 +- .../Testing/EditorTestHost.cs | 2 +- .../LargeDocumentLoadPerformanceTests.cs | 2 +- .../PerformanceSmokeTests.cs | 2 +- .../StreamingLoadPerformanceTests.cs | 2 +- .../Document/ChangeTrackingTest.cs | 2 +- .../Document/LineManagerTests.cs | 2 +- .../Terminal.Gui.Editor.Tests/Document/TextAnchorTest.cs | 2 +- .../Document/TextSegmentTreeTest.cs | 2 +- .../Document/TextUtilitiesTests.cs | 2 +- .../Terminal.Gui.Editor.Tests/Document/UndoStackTests.cs | 2 +- tests/Terminal.Gui.Editor.Tests/EditorCompletionTests.cs | 2 +- tests/Terminal.Gui.Editor.Tests/EditorFindReplaceTests.cs | 4 ++-- .../EditorGraphemeNavigationTests.cs | 2 +- tests/Terminal.Gui.Editor.Tests/EditorIsModifiedTests.cs | 2 +- tests/Terminal.Gui.Editor.Tests/EditorLogicTests.cs | 6 +++--- tests/Terminal.Gui.Editor.Tests/EditorMultiCaretTests.cs | 4 ++-- .../EditorSelectionLogicTests.cs | 2 +- tests/Terminal.Gui.Editor.Tests/EditorStatusBarTests.cs | 2 +- .../EditorVisualLineCacheTests.cs | 2 +- .../EditorWordNavigationTests.cs | 2 +- .../Folding/AutomaticFoldingTests.cs | 4 ++-- .../Folding/BraceFoldingStrategyTests.cs | 4 ++-- .../Folding/EditorFoldingNavigationTests.cs | 4 ++-- .../Folding/FoldingManagerTests.cs | 4 ++-- .../Folding/FoldingTransformerTests.cs | 4 ++-- tests/Terminal.Gui.Editor.Tests/GutterTests.cs | 4 ++-- tests/Terminal.Gui.Editor.Tests/HighlightingTests.cs | 6 +++--- .../Indentation/DefaultIndentationStrategyTests.cs | 4 ++-- .../Indentation/EditorAutoIndentTests.cs | 4 ++-- .../Terminal.Gui.Editor.Tests/MaxWidthEstimationTests.cs | 2 +- .../Rendering/VisualLineBuilderTests.cs | 2 +- .../Search/SearchStrategyTests.cs | 4 ++-- tests/Terminal.Gui.Editor.Tests/SearchHitRendererTests.cs | 4 ++-- .../TextDocumentStreamingTests.cs | 2 +- .../TextDocumentTextChangedTests.cs | 2 +- .../Utils/CompressingTreeListTests.cs | 2 +- tests/Terminal.Gui.Editor.Tests/Utils/DequeTests.cs | 2 +- tests/Terminal.Gui.Editor.Tests/Utils/RopeTests.cs | 2 +- .../Utils/ValueStringBuilderTests.cs | 2 +- 179 files changed, 244 insertions(+), 244 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 078bedf5..e9bb4917 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -71,7 +71,7 @@ ordering, `*.ans` must stay `binary` in `.gitattributes`, keep viewports small, Two NuGet packages with a strict dependency direction: - **`src/Terminal.Gui.Editor`** — UI-framework-independent document model. Namespace `Terminal.Gui.Editor` and subnamespaces. **Must not reference Terminal.Gui.** Holds the rope-backed `TextDocument`, `DocumentLine`, `TextAnchor`, `UndoStack`, `ITextSource`, `TextSegment`, the `Rope`, and supporting utility types. Lifted from AvaloniaEdit (see fork policy below) — `Document/` and `Utils/` are landed; `Folding/`, `Search/`, `Indentation/`, `Highlighting/` are follow-up phases per `specs/00-plan.md`. -- **`src/Terminal.Gui.Editor`** — the `Editor : View` and cell-grid rendering pipeline. Namespace `Terminal.Gui.Views` (matches Terminal.Gui convention, deliberately not `Terminal.Gui.Editor`). References `Terminal.Gui` (version pinned via `$(TerminalGuiVersion)` in `Directory.Build.props`) and `Terminal.Gui.Editor`. Split into partials: `Editor.cs` (core: `Document`, `CaretOffset`, edit-tracking arithmetic, content-size + scroll), `Editor.Drawing.cs` (`OnDrawingContent` + cursor positioning), `Editor.Keyboard.cs` (`OnKeyDown` switch — navigation / editing / undo+redo). No selection / folding / highlighting / multi-caret yet. +- **`src/Terminal.Gui.Editor`** — the `Editor : View` and cell-grid rendering pipeline. Namespace `Terminal.Gui.Editor` (all public types in the assembly live under `Terminal.Gui.Editor.*`). References `Terminal.Gui` (version pinned via `$(TerminalGuiVersion)` in `Directory.Build.props`). Split into partials: `Editor.cs` (core: `Document`, `CaretOffset`, edit-tracking arithmetic, content-size + scroll), `Editor.Drawing.cs` (`OnDrawingContent` + cursor positioning), `Editor.Keyboard.cs` (`OnKeyDown` switch — navigation / editing / undo+redo). Subnamespaces: `Terminal.Gui.Editor.Document`, `Terminal.Gui.Editor.Rendering`, `Terminal.Gui.Editor.Highlighting`, `Terminal.Gui.Editor.Indentation`, `Terminal.Gui.Editor.Completion`. - **`examples/ted`** — standalone TG demo app exercising `Editor`. Not packed; not a NuGet artifact. Has a File menu, the `Editor` View, and a status bar; grows with the View. Run via `dotnet run --project examples/ted`. The boundary matters: anything that takes a dependency on `Terminal.Gui` types belongs in `Terminal.Gui.Editor`, never in `Terminal.Gui.Editor`. @@ -205,7 +205,7 @@ private void ExtendCaretBy (int delta) - **One public or internal type per file.** No nested types except inside the file that owns the outer type, and only when the nested type is a private implementation detail (`DocumentLine.LineNode`-style). If a nested type grows interesting, promote it to its own file. - **No file longer than 1000 lines.** When a file approaches that, split — by partial class (`Editor.Drawing.cs`, `Editor.Mouse.cs`), by helper extraction, or by genuinely splitting the type. The cleanup hook does not enforce this; the reviewer does. - **C# 14 `extension` blocks**: prefer extension blocks over a static class full of `this`-prefixed extension methods when the extensions form a coherent group on a single receiver type. -- **Namespace per folder.** `src/Terminal.Gui.Editor/Document/` ⇒ `Terminal.Gui.Document`; `src/Terminal.Gui.Editor/Rendering/` ⇒ `Terminal.Gui.Views.Rendering`. Don't put unrelated types in the same namespace just because they share a folder. +- **Namespace per folder.** `src/Terminal.Gui.Editor/Document/` ⇒ `Terminal.Gui.Editor.Document`; `src/Terminal.Gui.Editor/Rendering/` ⇒ `Terminal.Gui.Editor.Rendering`. All namespaces in the Editor assembly are rooted under `Terminal.Gui.Editor`. Don't put unrelated types in the same namespace just because they share a folder. - **No static members on `View`-derived types.** A class that derives from `Terminal.Gui.View` (e.g. `Editor`) must not declare `static` members — not fields, not properties, not events, not even "harmless" caches or lookup tables. Terminal.Gui's `Application` lifetime is per-instance (see "Testing tiers"); static state on a View is process-global, survives across `IApplication` instances, and silently couples otherwise-independent windows and parallel tests (the canonical cause of parallel-test hangs). Shared/lookup data lives in a dedicated non-View type (e.g. `XshdRoleMap`), exposed read-only (`private` + `FrozenDictionary`/`IReadOnlyXxx`), and is injected or queried — never hung off the View. `const` is the only exception (it is not state). This is a hard rule; a reviewer blocks on it. ### Testing convention diff --git a/benchmarks/Terminal.Gui.Editor.Benchmarks/DocumentAccessBenchmarks.cs b/benchmarks/Terminal.Gui.Editor.Benchmarks/DocumentAccessBenchmarks.cs index d9460574..aba2de6a 100644 --- a/benchmarks/Terminal.Gui.Editor.Benchmarks/DocumentAccessBenchmarks.cs +++ b/benchmarks/Terminal.Gui.Editor.Benchmarks/DocumentAccessBenchmarks.cs @@ -1,5 +1,5 @@ using BenchmarkDotNet.Attributes; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; namespace Terminal.Gui.Editor.Benchmarks; diff --git a/benchmarks/Terminal.Gui.Editor.Benchmarks/EditorHarness.cs b/benchmarks/Terminal.Gui.Editor.Benchmarks/EditorHarness.cs index 53bd5ce9..e4577903 100644 --- a/benchmarks/Terminal.Gui.Editor.Benchmarks/EditorHarness.cs +++ b/benchmarks/Terminal.Gui.Editor.Benchmarks/EditorHarness.cs @@ -1,5 +1,5 @@ using Terminal.Gui.App; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; using Terminal.Gui.Drivers; using Terminal.Gui.Testing; diff --git a/benchmarks/Terminal.Gui.Editor.Benchmarks/FindBenchmarks.cs b/benchmarks/Terminal.Gui.Editor.Benchmarks/FindBenchmarks.cs index 3c9e086e..f88fec2a 100644 --- a/benchmarks/Terminal.Gui.Editor.Benchmarks/FindBenchmarks.cs +++ b/benchmarks/Terminal.Gui.Editor.Benchmarks/FindBenchmarks.cs @@ -1,6 +1,6 @@ using BenchmarkDotNet.Attributes; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Search; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Search; namespace Terminal.Gui.Editor.Benchmarks; diff --git a/benchmarks/Terminal.Gui.Editor.Benchmarks/Program.cs b/benchmarks/Terminal.Gui.Editor.Benchmarks/Program.cs index 2225bdba..a3e312eb 100644 --- a/benchmarks/Terminal.Gui.Editor.Benchmarks/Program.cs +++ b/benchmarks/Terminal.Gui.Editor.Benchmarks/Program.cs @@ -1,8 +1,8 @@ using System.Diagnostics; using System.Text.RegularExpressions; using BenchmarkDotNet.Running; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Search; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Search; if (args.Length > 0 && args[0] == "--quick-find") { diff --git a/benchmarks/Terminal.Gui.Editor.Benchmarks/ScrollingBenchmarks.cs b/benchmarks/Terminal.Gui.Editor.Benchmarks/ScrollingBenchmarks.cs index f1694740..ea2f57aa 100644 --- a/benchmarks/Terminal.Gui.Editor.Benchmarks/ScrollingBenchmarks.cs +++ b/benchmarks/Terminal.Gui.Editor.Benchmarks/ScrollingBenchmarks.cs @@ -1,5 +1,5 @@ using BenchmarkDotNet.Attributes; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Rendering; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/benchmarks/Terminal.Gui.Editor.Benchmarks/VisualLineBuildBenchmarks.cs b/benchmarks/Terminal.Gui.Editor.Benchmarks/VisualLineBuildBenchmarks.cs index 2b1db6df..84537726 100644 --- a/benchmarks/Terminal.Gui.Editor.Benchmarks/VisualLineBuildBenchmarks.cs +++ b/benchmarks/Terminal.Gui.Editor.Benchmarks/VisualLineBuildBenchmarks.cs @@ -1,5 +1,5 @@ using BenchmarkDotNet.Attributes; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Rendering; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/examples/prompt/Program.cs b/examples/prompt/Program.cs index 1a65c9fd..98929044 100644 --- a/examples/prompt/Program.cs +++ b/examples/prompt/Program.cs @@ -2,7 +2,7 @@ // outputs to stdout on Enter, exits silently on Esc. using Terminal.Gui.App; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor; using Terminal.Gui.Input; using Terminal.Gui.ViewBase; diff --git a/examples/ted/TedApp.FileOperations.cs b/examples/ted/TedApp.FileOperations.cs index 43a6f64b..7983ad97 100644 --- a/examples/ted/TedApp.FileOperations.cs +++ b/examples/ted/TedApp.FileOperations.cs @@ -1,6 +1,6 @@ using System.Text; -using Terminal.Gui.Document; -using Terminal.Gui.Highlighting; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Highlighting; using Terminal.Gui.Resources; using Terminal.Gui.Views; diff --git a/examples/ted/TedApp.cs b/examples/ted/TedApp.cs index be027719..31dcf6fe 100644 --- a/examples/ted/TedApp.cs +++ b/examples/ted/TedApp.cs @@ -3,13 +3,13 @@ using System.Text; using Terminal.Gui.App; using Terminal.Gui.Configuration; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Drawing; using Terminal.Gui.Editor; using Terminal.Gui.Input; using Terminal.Gui.Resources; -using Terminal.Gui.Text.Indentation; +using Terminal.Gui.Editor.Indentation; using Terminal.Gui.ViewBase; using Terminal.Gui.Views; diff --git a/examples/ted/WordCompletionProvider.cs b/examples/ted/WordCompletionProvider.cs index d3e8476a..6b4a367f 100644 --- a/examples/ted/WordCompletionProvider.cs +++ b/examples/ted/WordCompletionProvider.cs @@ -1,4 +1,4 @@ -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Completion; using Terminal.Gui.Input; diff --git a/src/Terminal.Gui.Editor/Completion/IEditorCompletionProvider.cs b/src/Terminal.Gui.Editor/Completion/IEditorCompletionProvider.cs index 0eb58965..261a0d0c 100644 --- a/src/Terminal.Gui.Editor/Completion/IEditorCompletionProvider.cs +++ b/src/Terminal.Gui.Editor/Completion/IEditorCompletionProvider.cs @@ -1,4 +1,4 @@ -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Input; namespace Terminal.Gui.Editor.Completion; diff --git a/src/Terminal.Gui.Editor/Document/DocumentChangeEventArgs.cs b/src/Terminal.Gui.Editor/Document/DocumentChangeEventArgs.cs index 934f13c5..917b4ef8 100644 --- a/src/Terminal.Gui.Editor/Document/DocumentChangeEventArgs.cs +++ b/src/Terminal.Gui.Editor/Document/DocumentChangeEventArgs.cs @@ -19,7 +19,7 @@ using System; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Describes a change of the document text. diff --git a/src/Terminal.Gui.Editor/Document/DocumentChangeOperation.cs b/src/Terminal.Gui.Editor/Document/DocumentChangeOperation.cs index ec286677..5bf6220a 100644 --- a/src/Terminal.Gui.Editor/Document/DocumentChangeOperation.cs +++ b/src/Terminal.Gui.Editor/Document/DocumentChangeOperation.cs @@ -19,7 +19,7 @@ using System.Diagnostics; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Describes a change to a TextDocument. diff --git a/src/Terminal.Gui.Editor/Document/DocumentChangedEventArgs.cs b/src/Terminal.Gui.Editor/Document/DocumentChangedEventArgs.cs index 1d0a7439..cdb95212 100644 --- a/src/Terminal.Gui.Editor/Document/DocumentChangedEventArgs.cs +++ b/src/Terminal.Gui.Editor/Document/DocumentChangedEventArgs.cs @@ -1,6 +1,6 @@ // Adapted for Terminal.Gui from AvaloniaEdit d7a6b63 -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { public class DocumentChangedEventArgs : EventArgs { diff --git a/src/Terminal.Gui.Editor/Document/DocumentLine.LineNode.cs b/src/Terminal.Gui.Editor/Document/DocumentLine.LineNode.cs index ce355812..bec406f9 100644 --- a/src/Terminal.Gui.Editor/Document/DocumentLine.LineNode.cs +++ b/src/Terminal.Gui.Editor/Document/DocumentLine.LineNode.cs @@ -17,7 +17,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { // A tree node in the document line tree. // For the purpose of the invariants, "children", "descendents", "siblings" etc. include the DocumentLine object, diff --git a/src/Terminal.Gui.Editor/Document/DocumentLine.cs b/src/Terminal.Gui.Editor/Document/DocumentLine.cs index 77915374..8b8d09da 100644 --- a/src/Terminal.Gui.Editor/Document/DocumentLine.cs +++ b/src/Terminal.Gui.Editor/Document/DocumentLine.cs @@ -21,7 +21,7 @@ using System.Diagnostics; using System.Globalization; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Represents a line inside a . diff --git a/src/Terminal.Gui.Editor/Document/DocumentLineTree.cs b/src/Terminal.Gui.Editor/Document/DocumentLineTree.cs index a1e0adbf..28632d21 100644 --- a/src/Terminal.Gui.Editor/Document/DocumentLineTree.cs +++ b/src/Terminal.Gui.Editor/Document/DocumentLineTree.cs @@ -23,7 +23,7 @@ using System.Diagnostics.CodeAnalysis; using System.Text; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Data structure for efficient management of the document lines (most operations are O(lg n)). diff --git a/src/Terminal.Gui.Editor/Document/DocumentTextWriter.cs b/src/Terminal.Gui.Editor/Document/DocumentTextWriter.cs index be64a5fb..8afed0d2 100644 --- a/src/Terminal.Gui.Editor/Document/DocumentTextWriter.cs +++ b/src/Terminal.Gui.Editor/Document/DocumentTextWriter.cs @@ -21,7 +21,7 @@ using System.IO; using System.Text; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// A TextWriter implementation that directly inserts into a document. diff --git a/src/Terminal.Gui.Editor/Document/IDocument.cs b/src/Terminal.Gui.Editor/Document/IDocument.cs index 5556818f..366942b2 100644 --- a/src/Terminal.Gui.Editor/Document/IDocument.cs +++ b/src/Terminal.Gui.Editor/Document/IDocument.cs @@ -19,7 +19,7 @@ using System; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// A document representing a source code file for refactoring. diff --git a/src/Terminal.Gui.Editor/Document/ILineTracker.cs b/src/Terminal.Gui.Editor/Document/ILineTracker.cs index 3eb03ae7..6163d8e4 100644 --- a/src/Terminal.Gui.Editor/Document/ILineTracker.cs +++ b/src/Terminal.Gui.Editor/Document/ILineTracker.cs @@ -17,7 +17,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Allows for low-level line tracking. diff --git a/src/Terminal.Gui.Editor/Document/ITextAnchor.cs b/src/Terminal.Gui.Editor/Document/ITextAnchor.cs index 0fccbb4c..3ed186fb 100644 --- a/src/Terminal.Gui.Editor/Document/ITextAnchor.cs +++ b/src/Terminal.Gui.Editor/Document/ITextAnchor.cs @@ -19,7 +19,7 @@ using System; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// The TextAnchor class references an offset (a position between two characters). diff --git a/src/Terminal.Gui.Editor/Document/ITextSource.cs b/src/Terminal.Gui.Editor/Document/ITextSource.cs index fb7a8b95..85e81a4a 100644 --- a/src/Terminal.Gui.Editor/Document/ITextSource.cs +++ b/src/Terminal.Gui.Editor/Document/ITextSource.cs @@ -22,7 +22,7 @@ using System.Diagnostics.CodeAnalysis; using System.IO; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// A read-only view on a (potentially mutable) text source. diff --git a/src/Terminal.Gui.Editor/Document/IUndoableOperation.cs b/src/Terminal.Gui.Editor/Document/IUndoableOperation.cs index 1b84dd3e..12368ef1 100644 --- a/src/Terminal.Gui.Editor/Document/IUndoableOperation.cs +++ b/src/Terminal.Gui.Editor/Document/IUndoableOperation.cs @@ -17,7 +17,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// This Interface describes a the basic Undo/Redo operation diff --git a/src/Terminal.Gui.Editor/Document/LineManager.cs b/src/Terminal.Gui.Editor/Document/LineManager.cs index 0760bfdb..bf89aa01 100644 --- a/src/Terminal.Gui.Editor/Document/LineManager.cs +++ b/src/Terminal.Gui.Editor/Document/LineManager.cs @@ -21,7 +21,7 @@ using System.Diagnostics; using System.Linq; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Creates/Deletes lines when text is inserted/removed. diff --git a/src/Terminal.Gui.Editor/Document/NewLineFinder.cs b/src/Terminal.Gui.Editor/Document/NewLineFinder.cs index 46244f30..58d95a11 100644 --- a/src/Terminal.Gui.Editor/Document/NewLineFinder.cs +++ b/src/Terminal.Gui.Editor/Document/NewLineFinder.cs @@ -20,7 +20,7 @@ using System; using System.Text; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { internal static class NewLineFinder { diff --git a/src/Terminal.Gui.Editor/Document/OffsetChangeMap.cs b/src/Terminal.Gui.Editor/Document/OffsetChangeMap.cs index 2d5358d6..73d1686b 100644 --- a/src/Terminal.Gui.Editor/Document/OffsetChangeMap.cs +++ b/src/Terminal.Gui.Editor/Document/OffsetChangeMap.cs @@ -21,9 +21,9 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Contains predefined offset change mapping types. diff --git a/src/Terminal.Gui.Editor/Document/RopeTextSource.cs b/src/Terminal.Gui.Editor/Document/RopeTextSource.cs index 67b0a1ba..7a5d30a1 100644 --- a/src/Terminal.Gui.Editor/Document/RopeTextSource.cs +++ b/src/Terminal.Gui.Editor/Document/RopeTextSource.cs @@ -20,9 +20,9 @@ using System; using System.Diagnostics.CodeAnalysis; using System.IO; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Implements the ITextSource interface using a rope. diff --git a/src/Terminal.Gui.Editor/Document/SimpleSegment.cs b/src/Terminal.Gui.Editor/Document/SimpleSegment.cs index 6c26a3db..21f164a2 100644 --- a/src/Terminal.Gui.Editor/Document/SimpleSegment.cs +++ b/src/Terminal.Gui.Editor/Document/SimpleSegment.cs @@ -20,9 +20,9 @@ using System; using System.Diagnostics; using System.Globalization; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Represents a simple segment (Offset,Length pair) that is not automatically updated diff --git a/src/Terminal.Gui.Editor/Document/TextAnchor.cs b/src/Terminal.Gui.Editor/Document/TextAnchor.cs index 7bc94f0e..cf55c919 100644 --- a/src/Terminal.Gui.Editor/Document/TextAnchor.cs +++ b/src/Terminal.Gui.Editor/Document/TextAnchor.cs @@ -17,11 +17,11 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; using System; using System.Globalization; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// The TextAnchor class references an offset (a position between two characters). diff --git a/src/Terminal.Gui.Editor/Document/TextAnchorNode.cs b/src/Terminal.Gui.Editor/Document/TextAnchorNode.cs index 18da421e..c3a79503 100644 --- a/src/Terminal.Gui.Editor/Document/TextAnchorNode.cs +++ b/src/Terminal.Gui.Editor/Document/TextAnchorNode.cs @@ -20,7 +20,7 @@ using System; using System.Globalization; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// A TextAnchorNode is placed in the TextAnchorTree. diff --git a/src/Terminal.Gui.Editor/Document/TextAnchorTree.cs b/src/Terminal.Gui.Editor/Document/TextAnchorTree.cs index 0fb68c24..74b6fdcf 100644 --- a/src/Terminal.Gui.Editor/Document/TextAnchorTree.cs +++ b/src/Terminal.Gui.Editor/Document/TextAnchorTree.cs @@ -21,9 +21,9 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Text; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// A tree of TextAnchorNodes. diff --git a/src/Terminal.Gui.Editor/Document/TextDocument.cs b/src/Terminal.Gui.Editor/Document/TextDocument.cs index bc9271ca..21eb8688 100644 --- a/src/Terminal.Gui.Editor/Document/TextDocument.cs +++ b/src/Terminal.Gui.Editor/Document/TextDocument.cs @@ -26,11 +26,11 @@ using System.Globalization; using System.IO; using System.Text; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; using System.Threading; using System.Threading.Tasks; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// This class is the main class of the text model. Basically, it is a with events. diff --git a/src/Terminal.Gui.Editor/Document/TextDocumentProgress.cs b/src/Terminal.Gui.Editor/Document/TextDocumentProgress.cs index 52dd3f45..600313a3 100644 --- a/src/Terminal.Gui.Editor/Document/TextDocumentProgress.cs +++ b/src/Terminal.Gui.Editor/Document/TextDocumentProgress.cs @@ -1,4 +1,4 @@ -namespace Terminal.Gui.Document; +namespace Terminal.Gui.Editor.Document; /// Reports streaming document I/O progress. /// The number of decoded characters loaded or saved so far. diff --git a/src/Terminal.Gui.Editor/Document/TextDocumentWeakEventManager.cs b/src/Terminal.Gui.Editor/Document/TextDocumentWeakEventManager.cs index 0e5809fd..c5485ca7 100644 --- a/src/Terminal.Gui.Editor/Document/TextDocumentWeakEventManager.cs +++ b/src/Terminal.Gui.Editor/Document/TextDocumentWeakEventManager.cs @@ -18,9 +18,9 @@ // DEALINGS IN THE SOFTWARE. using System; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Contains weak event managers for the TextDocument events. diff --git a/src/Terminal.Gui.Editor/Document/TextLocation.cs b/src/Terminal.Gui.Editor/Document/TextLocation.cs index 4cc3dee1..61222ae3 100644 --- a/src/Terminal.Gui.Editor/Document/TextLocation.cs +++ b/src/Terminal.Gui.Editor/Document/TextLocation.cs @@ -21,7 +21,7 @@ using System.ComponentModel; using System.Globalization; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// A line/column position. diff --git a/src/Terminal.Gui.Editor/Document/TextSegment.cs b/src/Terminal.Gui.Editor/Document/TextSegment.cs index 0b7c3eaf..757ef010 100644 --- a/src/Terminal.Gui.Editor/Document/TextSegment.cs +++ b/src/Terminal.Gui.Editor/Document/TextSegment.cs @@ -21,7 +21,7 @@ using System.Diagnostics; using System.Globalization; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// A segment that can be put into a . diff --git a/src/Terminal.Gui.Editor/Document/TextSegmentCollection.cs b/src/Terminal.Gui.Editor/Document/TextSegmentCollection.cs index 8b0660cf..abd0ac9a 100644 --- a/src/Terminal.Gui.Editor/Document/TextSegmentCollection.cs +++ b/src/Terminal.Gui.Editor/Document/TextSegmentCollection.cs @@ -24,9 +24,9 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Interface to allow TextSegments to access the TextSegmentCollection - we cannot use a direct reference diff --git a/src/Terminal.Gui.Editor/Document/TextSourceVersionProvider.cs b/src/Terminal.Gui.Editor/Document/TextSourceVersionProvider.cs index 5eb591aa..c42e90e4 100644 --- a/src/Terminal.Gui.Editor/Document/TextSourceVersionProvider.cs +++ b/src/Terminal.Gui.Editor/Document/TextSourceVersionProvider.cs @@ -22,7 +22,7 @@ using System.Diagnostics; using System.Linq; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Provides ITextSourceVersion instances. diff --git a/src/Terminal.Gui.Editor/Document/TextUtilities.cs b/src/Terminal.Gui.Editor/Document/TextUtilities.cs index d96c0700..d72add77 100644 --- a/src/Terminal.Gui.Editor/Document/TextUtilities.cs +++ b/src/Terminal.Gui.Editor/Document/TextUtilities.cs @@ -21,7 +21,7 @@ using System.Globalization; using System.Reflection; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { public enum LogicalDirection { diff --git a/src/Terminal.Gui.Editor/Document/UndoOperationGroup.cs b/src/Terminal.Gui.Editor/Document/UndoOperationGroup.cs index 63a4612e..c290575b 100644 --- a/src/Terminal.Gui.Editor/Document/UndoOperationGroup.cs +++ b/src/Terminal.Gui.Editor/Document/UndoOperationGroup.cs @@ -19,9 +19,9 @@ using System; using System.Diagnostics; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// This class stacks the last x operations from the undostack and makes diff --git a/src/Terminal.Gui.Editor/Document/UndoStack.cs b/src/Terminal.Gui.Editor/Document/UndoStack.cs index b68768d2..e596b9d0 100644 --- a/src/Terminal.Gui.Editor/Document/UndoStack.cs +++ b/src/Terminal.Gui.Editor/Document/UndoStack.cs @@ -21,9 +21,9 @@ using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Undo stack implementation. diff --git a/src/Terminal.Gui.Editor/Document/WeakLineTracker.cs b/src/Terminal.Gui.Editor/Document/WeakLineTracker.cs index e95feba1..656904b6 100644 --- a/src/Terminal.Gui.Editor/Document/WeakLineTracker.cs +++ b/src/Terminal.Gui.Editor/Document/WeakLineTracker.cs @@ -19,7 +19,7 @@ using System; -namespace Terminal.Gui.Document +namespace Terminal.Gui.Editor.Document { /// /// Allows registering a line tracker on a TextDocument using a weak reference from the document to the line tracker. diff --git a/src/Terminal.Gui.Editor/Editor.Commands.cs b/src/Terminal.Gui.Editor/Editor.Commands.cs index 6ec33c48..1dd00cf2 100644 --- a/src/Terminal.Gui.Editor/Editor.Commands.cs +++ b/src/Terminal.Gui.Editor/Editor.Commands.cs @@ -1,8 +1,8 @@ using System.Globalization; using Terminal.Gui.App; using Terminal.Gui.Configuration; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Input; using Terminal.Gui.ViewBase; diff --git a/src/Terminal.Gui.Editor/Editor.Designable.cs b/src/Terminal.Gui.Editor/Editor.Designable.cs index 823478bd..bff3dbe2 100644 --- a/src/Terminal.Gui.Editor/Editor.Designable.cs +++ b/src/Terminal.Gui.Editor/Editor.Designable.cs @@ -1,5 +1,5 @@ -using Terminal.Gui.Document; -using Terminal.Gui.Highlighting; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Highlighting; using Terminal.Gui.ViewBase; namespace Terminal.Gui.Editor; diff --git a/src/Terminal.Gui.Editor/Editor.Drawing.cs b/src/Terminal.Gui.Editor/Editor.Drawing.cs index 5dd493ba..6a093d20 100644 --- a/src/Terminal.Gui.Editor/Editor.Drawing.cs +++ b/src/Terminal.Gui.Editor/Editor.Drawing.cs @@ -1,10 +1,10 @@ using System.Drawing; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Drawing; using Terminal.Gui.Drivers; using Terminal.Gui.Editor.Rendering; -using Terminal.Gui.Highlighting; +using Terminal.Gui.Editor.Highlighting; using Terminal.Gui.ViewBase; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/src/Terminal.Gui.Editor/Editor.FileIO.cs b/src/Terminal.Gui.Editor/Editor.FileIO.cs index 0adfd6aa..ee40e17b 100644 --- a/src/Terminal.Gui.Editor/Editor.FileIO.cs +++ b/src/Terminal.Gui.Editor/Editor.FileIO.cs @@ -1,5 +1,5 @@ using System.Text; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; namespace Terminal.Gui.Editor; diff --git a/src/Terminal.Gui.Editor/Editor.FindReplace.cs b/src/Terminal.Gui.Editor/Editor.FindReplace.cs index 4e19ae65..4059b0f2 100644 --- a/src/Terminal.Gui.Editor/Editor.FindReplace.cs +++ b/src/Terminal.Gui.Editor/Editor.FindReplace.cs @@ -1,4 +1,4 @@ -using Terminal.Gui.Document.Search; +using Terminal.Gui.Editor.Document.Search; using Terminal.Gui.Editor.Rendering; namespace Terminal.Gui.Editor; diff --git a/src/Terminal.Gui.Editor/Editor.Folding.cs b/src/Terminal.Gui.Editor/Editor.Folding.cs index 7bb61f04..1ca1f7ae 100644 --- a/src/Terminal.Gui.Editor/Editor.Folding.cs +++ b/src/Terminal.Gui.Editor/Editor.Folding.cs @@ -1,5 +1,5 @@ -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; namespace Terminal.Gui.Editor; diff --git a/src/Terminal.Gui.Editor/Editor.Indentation.cs b/src/Terminal.Gui.Editor/Editor.Indentation.cs index 9c3d82f0..0faa2563 100644 --- a/src/Terminal.Gui.Editor/Editor.Indentation.cs +++ b/src/Terminal.Gui.Editor/Editor.Indentation.cs @@ -1,4 +1,4 @@ -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Rendering; namespace Terminal.Gui.Editor; diff --git a/src/Terminal.Gui.Editor/Editor.Mouse.cs b/src/Terminal.Gui.Editor/Editor.Mouse.cs index 785df3cc..4813cb7d 100644 --- a/src/Terminal.Gui.Editor/Editor.Mouse.cs +++ b/src/Terminal.Gui.Editor/Editor.Mouse.cs @@ -1,5 +1,5 @@ using System.Drawing; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; using Terminal.Gui.Editor.Rendering; using Terminal.Gui.Input; diff --git a/src/Terminal.Gui.Editor/Editor.MultiCaret.cs b/src/Terminal.Gui.Editor/Editor.MultiCaret.cs index 95b25cd9..5c090b59 100644 --- a/src/Terminal.Gui.Editor/Editor.MultiCaret.cs +++ b/src/Terminal.Gui.Editor/Editor.MultiCaret.cs @@ -1,6 +1,6 @@ using System.Drawing; using System.Text; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; namespace Terminal.Gui.Editor; diff --git a/src/Terminal.Gui.Editor/Editor.Selection.cs b/src/Terminal.Gui.Editor/Editor.Selection.cs index 1dd5910a..bbb3aef3 100644 --- a/src/Terminal.Gui.Editor/Editor.Selection.cs +++ b/src/Terminal.Gui.Editor/Editor.Selection.cs @@ -1,4 +1,4 @@ -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Input; namespace Terminal.Gui.Editor; diff --git a/src/Terminal.Gui.Editor/Editor.cs b/src/Terminal.Gui.Editor/Editor.cs index 28a00f66..06474f82 100644 --- a/src/Terminal.Gui.Editor/Editor.cs +++ b/src/Terminal.Gui.Editor/Editor.cs @@ -2,14 +2,14 @@ using System.Drawing; using Terminal.Gui.App; using Terminal.Gui.Configuration; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Drawing; using Terminal.Gui.Editor.Rendering; -using Terminal.Gui.Highlighting; +using Terminal.Gui.Editor.Highlighting; using Terminal.Gui.Input; using Terminal.Gui.Text; -using Terminal.Gui.Text.Indentation; +using Terminal.Gui.Editor.Indentation; using Terminal.Gui.ViewBase; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/src/Terminal.Gui.Editor/EditorStatusBar.cs b/src/Terminal.Gui.Editor/EditorStatusBar.cs index 3a8edff2..084ddc01 100644 --- a/src/Terminal.Gui.Editor/EditorStatusBar.cs +++ b/src/Terminal.Gui.Editor/EditorStatusBar.cs @@ -1,7 +1,7 @@ using System.Collections.Immutable; using System.Collections.ObjectModel; using Terminal.Gui.Configuration; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Input; using Terminal.Gui.ViewBase; using Terminal.Gui.Views; diff --git a/src/Terminal.Gui.Editor/EditorTabSettingsTab.cs b/src/Terminal.Gui.Editor/EditorTabSettingsTab.cs index 09538de7..8467a25e 100644 --- a/src/Terminal.Gui.Editor/EditorTabSettingsTab.cs +++ b/src/Terminal.Gui.Editor/EditorTabSettingsTab.cs @@ -1,4 +1,4 @@ -using Terminal.Gui.Text.Indentation; +using Terminal.Gui.Editor.Indentation; using Terminal.Gui.ViewBase; using Terminal.Gui.Views; diff --git a/src/Terminal.Gui.Editor/Extensions/ImmutableStackExtensions.cs b/src/Terminal.Gui.Editor/Extensions/ImmutableStackExtensions.cs index f6837214..76218331 100644 --- a/src/Terminal.Gui.Editor/Extensions/ImmutableStackExtensions.cs +++ b/src/Terminal.Gui.Editor/Extensions/ImmutableStackExtensions.cs @@ -19,7 +19,7 @@ using System.Collections.Immutable; -namespace Terminal.Gui.Document.Utils; +namespace Terminal.Gui.Editor.Document.Utils; /// /// Helpers on that AvaloniaEdit's Rope/CharRope rely on. Lifted diff --git a/src/Terminal.Gui.Editor/FindReplaceDialog.cs b/src/Terminal.Gui.Editor/FindReplaceDialog.cs index f6d8e658..ba07994d 100644 --- a/src/Terminal.Gui.Editor/FindReplaceDialog.cs +++ b/src/Terminal.Gui.Editor/FindReplaceDialog.cs @@ -1,4 +1,4 @@ -using Terminal.Gui.Document.Search; +using Terminal.Gui.Editor.Document.Search; using Terminal.Gui.Resources; using Terminal.Gui.ViewBase; using Terminal.Gui.Views; diff --git a/src/Terminal.Gui.Editor/Folding/BraceFoldingStrategy.cs b/src/Terminal.Gui.Editor/Folding/BraceFoldingStrategy.cs index a83e907f..f60bce66 100644 --- a/src/Terminal.Gui.Editor/Folding/BraceFoldingStrategy.cs +++ b/src/Terminal.Gui.Editor/Folding/BraceFoldingStrategy.cs @@ -1,4 +1,4 @@ -namespace Terminal.Gui.Document.Folding; +namespace Terminal.Gui.Editor.Document.Folding; /// /// Detects foldable regions based on matching brace pairs ({}). Useful as a diff --git a/src/Terminal.Gui.Editor/Folding/FoldingManager.cs b/src/Terminal.Gui.Editor/Folding/FoldingManager.cs index 83492233..71b232ae 100644 --- a/src/Terminal.Gui.Editor/Folding/FoldingManager.cs +++ b/src/Terminal.Gui.Editor/Folding/FoldingManager.cs @@ -19,7 +19,7 @@ using System.Collections.ObjectModel; -namespace Terminal.Gui.Document.Folding; +namespace Terminal.Gui.Editor.Document.Folding; /// /// Stores a list of foldings for a specific TextDocument. diff --git a/src/Terminal.Gui.Editor/Folding/FoldingSection.cs b/src/Terminal.Gui.Editor/Folding/FoldingSection.cs index 88b76d16..e41f07e9 100644 --- a/src/Terminal.Gui.Editor/Folding/FoldingSection.cs +++ b/src/Terminal.Gui.Editor/Folding/FoldingSection.cs @@ -19,7 +19,7 @@ using System.Diagnostics; -namespace Terminal.Gui.Document.Folding; +namespace Terminal.Gui.Editor.Document.Folding; /// /// A section that can be folded. diff --git a/src/Terminal.Gui.Editor/Folding/IFoldingStrategy.cs b/src/Terminal.Gui.Editor/Folding/IFoldingStrategy.cs index b1b03ba9..fe465a40 100644 --- a/src/Terminal.Gui.Editor/Folding/IFoldingStrategy.cs +++ b/src/Terminal.Gui.Editor/Folding/IFoldingStrategy.cs @@ -1,4 +1,4 @@ -namespace Terminal.Gui.Document.Folding; +namespace Terminal.Gui.Editor.Document.Folding; /// /// Strategy for computing folding regions and determining whether a document diff --git a/src/Terminal.Gui.Editor/Folding/NewFolding.cs b/src/Terminal.Gui.Editor/Folding/NewFolding.cs index fce6370c..11d4a589 100644 --- a/src/Terminal.Gui.Editor/Folding/NewFolding.cs +++ b/src/Terminal.Gui.Editor/Folding/NewFolding.cs @@ -17,7 +17,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Document.Folding; +namespace Terminal.Gui.Editor.Document.Folding; /// /// Helper class used for . diff --git a/src/Terminal.Gui.Editor/Folding/XmlFoldingStrategy.cs b/src/Terminal.Gui.Editor/Folding/XmlFoldingStrategy.cs index 316e2b9c..43e1a294 100644 --- a/src/Terminal.Gui.Editor/Folding/XmlFoldingStrategy.cs +++ b/src/Terminal.Gui.Editor/Folding/XmlFoldingStrategy.cs @@ -20,7 +20,7 @@ using System.Text; using System.Xml; -namespace Terminal.Gui.Document.Folding; +namespace Terminal.Gui.Editor.Document.Folding; /// /// Holds information about the start of a fold in an xml string. diff --git a/src/Terminal.Gui.Editor/FoldingGutter.cs b/src/Terminal.Gui.Editor/FoldingGutter.cs index e86c9c33..748236a9 100644 --- a/src/Terminal.Gui.Editor/FoldingGutter.cs +++ b/src/Terminal.Gui.Editor/FoldingGutter.cs @@ -1,6 +1,6 @@ using System.Drawing; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Input; using Terminal.Gui.ViewBase; diff --git a/src/Terminal.Gui.Editor/Highlighting/DocumentHighlighter.cs b/src/Terminal.Gui.Editor/Highlighting/DocumentHighlighter.cs index f00f88a4..e54273ab 100644 --- a/src/Terminal.Gui.Editor/Highlighting/DocumentHighlighter.cs +++ b/src/Terminal.Gui.Editor/Highlighting/DocumentHighlighter.cs @@ -20,11 +20,11 @@ // DEALINGS IN THE SOFTWARE. using System.Diagnostics; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Utils; -using SpanStack = System.Collections.Immutable.ImmutableStack; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Utils; +using SpanStack = System.Collections.Immutable.ImmutableStack; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// This class can syntax-highlight a document. diff --git a/src/Terminal.Gui.Editor/Highlighting/HighlightedLine.cs b/src/Terminal.Gui.Editor/Highlighting/HighlightedLine.cs index 1e0611dd..c561fb54 100644 --- a/src/Terminal.Gui.Editor/Highlighting/HighlightedLine.cs +++ b/src/Terminal.Gui.Editor/Highlighting/HighlightedLine.cs @@ -20,10 +20,10 @@ // DEALINGS IN THE SOFTWARE. using System.Globalization; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// Represents a highlighted document line. diff --git a/src/Terminal.Gui.Editor/Highlighting/HighlightedSection.cs b/src/Terminal.Gui.Editor/Highlighting/HighlightedSection.cs index 8940d123..6c284eee 100644 --- a/src/Terminal.Gui.Editor/Highlighting/HighlightedSection.cs +++ b/src/Terminal.Gui.Editor/Highlighting/HighlightedSection.cs @@ -20,9 +20,9 @@ // DEALINGS IN THE SOFTWARE. using System.Globalization; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// A text section with syntax highlighting information. diff --git a/src/Terminal.Gui.Editor/Highlighting/HighlightingBrush.cs b/src/Terminal.Gui.Editor/Highlighting/HighlightingBrush.cs index aa897fcc..7682dad3 100644 --- a/src/Terminal.Gui.Editor/Highlighting/HighlightingBrush.cs +++ b/src/Terminal.Gui.Editor/Highlighting/HighlightingBrush.cs @@ -21,7 +21,7 @@ using Terminal.Gui.Drawing; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// A brush used for syntax highlighting. In Terminal.Gui, this wraps a simple . diff --git a/src/Terminal.Gui.Editor/Highlighting/HighlightingColor.cs b/src/Terminal.Gui.Editor/Highlighting/HighlightingColor.cs index 46c58b5c..2d4d5783 100644 --- a/src/Terminal.Gui.Editor/Highlighting/HighlightingColor.cs +++ b/src/Terminal.Gui.Editor/Highlighting/HighlightingColor.cs @@ -22,10 +22,10 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Text; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; using Terminal.Gui.Drawing; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// A highlighting color is a set of font properties and foreground and background color. diff --git a/src/Terminal.Gui.Editor/Highlighting/HighlightingDefinitionInvalidException.cs b/src/Terminal.Gui.Editor/Highlighting/HighlightingDefinitionInvalidException.cs index cf928d16..f6b7f2f2 100644 --- a/src/Terminal.Gui.Editor/Highlighting/HighlightingDefinitionInvalidException.cs +++ b/src/Terminal.Gui.Editor/Highlighting/HighlightingDefinitionInvalidException.cs @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// Indicates that the highlighting definition that was tried to load was invalid. diff --git a/src/Terminal.Gui.Editor/Highlighting/HighlightingEngine.cs b/src/Terminal.Gui.Editor/Highlighting/HighlightingEngine.cs index f982b49b..60eb56bf 100644 --- a/src/Terminal.Gui.Editor/Highlighting/HighlightingEngine.cs +++ b/src/Terminal.Gui.Editor/Highlighting/HighlightingEngine.cs @@ -21,10 +21,10 @@ using System.Diagnostics; using System.Text.RegularExpressions; -using Terminal.Gui.Document; -using SpanStack = System.Collections.Immutable.ImmutableStack; +using Terminal.Gui.Editor.Document; +using SpanStack = System.Collections.Immutable.ImmutableStack; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// Regex-based highlighting engine. diff --git a/src/Terminal.Gui.Editor/Highlighting/HighlightingManager.cs b/src/Terminal.Gui.Editor/Highlighting/HighlightingManager.cs index 1c035003..940cf136 100644 --- a/src/Terminal.Gui.Editor/Highlighting/HighlightingManager.cs +++ b/src/Terminal.Gui.Editor/Highlighting/HighlightingManager.cs @@ -22,10 +22,10 @@ using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; using System.Xml; -using Terminal.Gui.Document.Utils; -using Terminal.Gui.Highlighting.Xshd; +using Terminal.Gui.Editor.Document.Utils; +using Terminal.Gui.Editor.Highlighting.Xshd; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// Manages a list of syntax highlighting definitions. diff --git a/src/Terminal.Gui.Editor/Highlighting/HighlightingRule.cs b/src/Terminal.Gui.Editor/Highlighting/HighlightingRule.cs index 591022dd..fe422439 100644 --- a/src/Terminal.Gui.Editor/Highlighting/HighlightingRule.cs +++ b/src/Terminal.Gui.Editor/Highlighting/HighlightingRule.cs @@ -22,7 +22,7 @@ using System.Globalization; using System.Text.RegularExpressions; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// A highlighting rule. diff --git a/src/Terminal.Gui.Editor/Highlighting/HighlightingRuleSet.cs b/src/Terminal.Gui.Editor/Highlighting/HighlightingRuleSet.cs index 2b8fdb06..cdcde71e 100644 --- a/src/Terminal.Gui.Editor/Highlighting/HighlightingRuleSet.cs +++ b/src/Terminal.Gui.Editor/Highlighting/HighlightingRuleSet.cs @@ -20,9 +20,9 @@ // DEALINGS IN THE SOFTWARE. using System.Globalization; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// A highlighting rule set describes a set of spans that are valid at a given code location. diff --git a/src/Terminal.Gui.Editor/Highlighting/HighlightingSpan.cs b/src/Terminal.Gui.Editor/Highlighting/HighlightingSpan.cs index 586201a4..00388b1a 100644 --- a/src/Terminal.Gui.Editor/Highlighting/HighlightingSpan.cs +++ b/src/Terminal.Gui.Editor/Highlighting/HighlightingSpan.cs @@ -22,7 +22,7 @@ using System.Globalization; using System.Text.RegularExpressions; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// A highlighting span is a region with start+end expression that has a different RuleSet inside diff --git a/src/Terminal.Gui.Editor/Highlighting/IHighlighter.cs b/src/Terminal.Gui.Editor/Highlighting/IHighlighter.cs index b51b516b..43329089 100644 --- a/src/Terminal.Gui.Editor/Highlighting/IHighlighter.cs +++ b/src/Terminal.Gui.Editor/Highlighting/IHighlighter.cs @@ -19,9 +19,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// Represents a highlighted document. diff --git a/src/Terminal.Gui.Editor/Highlighting/IHighlightingDefinition.cs b/src/Terminal.Gui.Editor/Highlighting/IHighlightingDefinition.cs index 38df3948..f9b6f2f4 100644 --- a/src/Terminal.Gui.Editor/Highlighting/IHighlightingDefinition.cs +++ b/src/Terminal.Gui.Editor/Highlighting/IHighlightingDefinition.cs @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// A highlighting definition. diff --git a/src/Terminal.Gui.Editor/Highlighting/IHighlightingDefinitionReferenceResolver.cs b/src/Terminal.Gui.Editor/Highlighting/IHighlightingDefinitionReferenceResolver.cs index eae9565a..84fc09f3 100644 --- a/src/Terminal.Gui.Editor/Highlighting/IHighlightingDefinitionReferenceResolver.cs +++ b/src/Terminal.Gui.Editor/Highlighting/IHighlightingDefinitionReferenceResolver.cs @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// Interface for resolvers that can solve cross-definition references. diff --git a/src/Terminal.Gui.Editor/Highlighting/Resources/Resources.cs b/src/Terminal.Gui.Editor/Highlighting/Resources/Resources.cs index 4dab05eb..498bad71 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Resources/Resources.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Resources/Resources.cs @@ -22,7 +22,7 @@ using System.Reflection; // ReSharper disable once CheckNamespace -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; internal static class Resources { diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/HighlightingLoader.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/HighlightingLoader.cs index e7648586..74e1640f 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/HighlightingLoader.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/HighlightingLoader.cs @@ -21,7 +21,7 @@ using System.Xml; -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// Static class with helper methods to load XSHD highlighting files. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/IXshdVisitor.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/IXshdVisitor.cs index decc87d3..c1c32486 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/IXshdVisitor.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/IXshdVisitor.cs @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// A visitor over the XSHD element tree. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/SaveXshdVisitor.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/SaveXshdVisitor.cs index 3802392c..260b0f50 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/SaveXshdVisitor.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/SaveXshdVisitor.cs @@ -22,7 +22,7 @@ using System.Diagnostics.CodeAnalysis; using System.Xml; -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// Xshd visitor implementation that saves an .xshd file as XML. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/V2Loader.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/V2Loader.cs index 2e009d87..134418e1 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/V2Loader.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/V2Loader.cs @@ -24,7 +24,7 @@ using System.Xml; using Terminal.Gui.Drawing; -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// Loads .xshd files, version 2.0. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XmlHighlightingDefinition.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XmlHighlightingDefinition.cs index de6d8130..56ca5b49 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XmlHighlightingDefinition.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XmlHighlightingDefinition.cs @@ -23,7 +23,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; internal sealed class XmlHighlightingDefinition : IHighlightingDefinition { diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdColor.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdColor.cs index ae010aec..f3e31930 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdColor.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdColor.cs @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// A color in an Xshd file. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdElement.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdElement.cs index a1c8d16b..b89ccbac 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdElement.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdElement.cs @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// An element in a XSHD rule set. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdImport.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdImport.cs index 947e55d5..1661e58b 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdImport.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdImport.cs @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// <Import> element. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdKeywords.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdKeywords.cs index 547d25a4..8e6858b5 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdKeywords.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdKeywords.cs @@ -19,9 +19,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// A list of keywords. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdProperty.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdProperty.cs index aab5b7be..faf2872e 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdProperty.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdProperty.cs @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// A property in an Xshd file. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdReference.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdReference.cs index de9da9a8..19629f5d 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdReference.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdReference.cs @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// A reference to an xshd color, or an inline xshd color. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdRule.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdRule.cs index fa661a88..9758cc4c 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdRule.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdRule.cs @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// <Rule> element. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdRuleSet.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdRuleSet.cs index b1050b2f..c13d7ca4 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdRuleSet.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdRuleSet.cs @@ -19,9 +19,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// A rule set in a XSHD file. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdSpan.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdSpan.cs index d60b4029..4b46c0dc 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdSpan.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdSpan.cs @@ -21,7 +21,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// Specifies the type of the regex. diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdSyntaxDefinition.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdSyntaxDefinition.cs index 12473ce4..a277bc71 100644 --- a/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdSyntaxDefinition.cs +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/XshdSyntaxDefinition.cs @@ -19,9 +19,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; -namespace Terminal.Gui.Highlighting.Xshd; +namespace Terminal.Gui.Editor.Highlighting.Xshd; /// /// A <SyntaxDefinition> element. diff --git a/src/Terminal.Gui.Editor/Highlighting/XshdRoleMap.cs b/src/Terminal.Gui.Editor/Highlighting/XshdRoleMap.cs index 8c9bb29f..cb3cbd9e 100644 --- a/src/Terminal.Gui.Editor/Highlighting/XshdRoleMap.cs +++ b/src/Terminal.Gui.Editor/Highlighting/XshdRoleMap.cs @@ -1,7 +1,7 @@ using System.Collections.Frozen; using Terminal.Gui.Drawing; -namespace Terminal.Gui.Highlighting; +namespace Terminal.Gui.Editor.Highlighting; /// /// Bridges xshd <Color name="..."> names to Terminal.Gui code-token diff --git a/src/Terminal.Gui.Editor/Indentation/DefaultIndentationStrategy.cs b/src/Terminal.Gui.Editor/Indentation/DefaultIndentationStrategy.cs index 23d20988..372f77bb 100644 --- a/src/Terminal.Gui.Editor/Indentation/DefaultIndentationStrategy.cs +++ b/src/Terminal.Gui.Editor/Indentation/DefaultIndentationStrategy.cs @@ -17,9 +17,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; -namespace Terminal.Gui.Text.Indentation; +namespace Terminal.Gui.Editor.Indentation; /// /// Handles indentation by copying the indentation from the previous line. diff --git a/src/Terminal.Gui.Editor/Indentation/IIndentationStrategy.cs b/src/Terminal.Gui.Editor/Indentation/IIndentationStrategy.cs index f64aff28..7658de36 100644 --- a/src/Terminal.Gui.Editor/Indentation/IIndentationStrategy.cs +++ b/src/Terminal.Gui.Editor/Indentation/IIndentationStrategy.cs @@ -17,9 +17,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; -namespace Terminal.Gui.Text.Indentation; +namespace Terminal.Gui.Editor.Indentation; /// /// Strategy how the text editor handles indentation when new lines are inserted. diff --git a/src/Terminal.Gui.Editor/LineNumberGutter.cs b/src/Terminal.Gui.Editor/LineNumberGutter.cs index 47a4df5d..94fe3b3f 100644 --- a/src/Terminal.Gui.Editor/LineNumberGutter.cs +++ b/src/Terminal.Gui.Editor/LineNumberGutter.cs @@ -1,5 +1,5 @@ using System.Drawing; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Input; using Terminal.Gui.ViewBase; diff --git a/src/Terminal.Gui.Editor/Rendering/CellVisualLine.cs b/src/Terminal.Gui.Editor/Rendering/CellVisualLine.cs index e40699be..88bb374b 100644 --- a/src/Terminal.Gui.Editor/Rendering/CellVisualLine.cs +++ b/src/Terminal.Gui.Editor/Rendering/CellVisualLine.cs @@ -1,4 +1,4 @@ -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; namespace Terminal.Gui.Editor.Rendering; diff --git a/src/Terminal.Gui.Editor/Rendering/FoldingTransformer.cs b/src/Terminal.Gui.Editor/Rendering/FoldingTransformer.cs index 897bce77..27aa47c8 100644 --- a/src/Terminal.Gui.Editor/Rendering/FoldingTransformer.cs +++ b/src/Terminal.Gui.Editor/Rendering/FoldingTransformer.cs @@ -1,5 +1,5 @@ -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; namespace Terminal.Gui.Editor.Rendering; diff --git a/src/Terminal.Gui.Editor/Rendering/HighlightingColorizer.cs b/src/Terminal.Gui.Editor/Rendering/HighlightingColorizer.cs index b6301ada..e94a9882 100644 --- a/src/Terminal.Gui.Editor/Rendering/HighlightingColorizer.cs +++ b/src/Terminal.Gui.Editor/Rendering/HighlightingColorizer.cs @@ -1,5 +1,5 @@ using Terminal.Gui.Drawing; -using Terminal.Gui.Highlighting; +using Terminal.Gui.Editor.Highlighting; using Attribute = Terminal.Gui.Drawing.Attribute; namespace Terminal.Gui.Editor.Rendering; diff --git a/src/Terminal.Gui.Editor/Rendering/SearchHitRenderer.cs b/src/Terminal.Gui.Editor/Rendering/SearchHitRenderer.cs index e649b6b5..4b553a4c 100644 --- a/src/Terminal.Gui.Editor/Rendering/SearchHitRenderer.cs +++ b/src/Terminal.Gui.Editor/Rendering/SearchHitRenderer.cs @@ -1,6 +1,6 @@ using System.Drawing; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Search; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Search; using Terminal.Gui.Drawing; using Terminal.Gui.ViewBase; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/src/Terminal.Gui.Editor/Rendering/VisualLineBuildContext.cs b/src/Terminal.Gui.Editor/Rendering/VisualLineBuildContext.cs index 93e11e98..ba1d026c 100644 --- a/src/Terminal.Gui.Editor/Rendering/VisualLineBuildContext.cs +++ b/src/Terminal.Gui.Editor/Rendering/VisualLineBuildContext.cs @@ -1,4 +1,4 @@ -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/src/Terminal.Gui.Editor/Rendering/VisualLineBuilder.cs b/src/Terminal.Gui.Editor/Rendering/VisualLineBuilder.cs index 222c1027..bf004071 100644 --- a/src/Terminal.Gui.Editor/Rendering/VisualLineBuilder.cs +++ b/src/Terminal.Gui.Editor/Rendering/VisualLineBuilder.cs @@ -1,4 +1,4 @@ -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/src/Terminal.Gui.Editor/Search/ISearchStrategy.cs b/src/Terminal.Gui.Editor/Search/ISearchStrategy.cs index ea8c9286..56e7c9a2 100644 --- a/src/Terminal.Gui.Editor/Search/ISearchStrategy.cs +++ b/src/Terminal.Gui.Editor/Search/ISearchStrategy.cs @@ -19,9 +19,9 @@ using System; using System.Collections.Generic; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; -namespace Terminal.Gui.Document.Search +namespace Terminal.Gui.Editor.Document.Search { /// /// Basic interface for search algorithms. diff --git a/src/Terminal.Gui.Editor/Search/RegexSearchStrategy.cs b/src/Terminal.Gui.Editor/Search/RegexSearchStrategy.cs index 52cd0077..45729b1f 100644 --- a/src/Terminal.Gui.Editor/Search/RegexSearchStrategy.cs +++ b/src/Terminal.Gui.Editor/Search/RegexSearchStrategy.cs @@ -22,9 +22,9 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; -namespace Terminal.Gui.Document.Search +namespace Terminal.Gui.Editor.Document.Search { internal class RegexSearchStrategy : ISearchStrategy { diff --git a/src/Terminal.Gui.Editor/Search/SearchStrategyFactory.cs b/src/Terminal.Gui.Editor/Search/SearchStrategyFactory.cs index 87e5d742..09ec0651 100644 --- a/src/Terminal.Gui.Editor/Search/SearchStrategyFactory.cs +++ b/src/Terminal.Gui.Editor/Search/SearchStrategyFactory.cs @@ -21,7 +21,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace Terminal.Gui.Document.Search +namespace Terminal.Gui.Editor.Document.Search { /// /// Provides factory methods for ISearchStrategies. diff --git a/src/Terminal.Gui.Editor/Utils/BusyManager.cs b/src/Terminal.Gui.Editor/Utils/BusyManager.cs index fdd86fb3..f4aed3ce 100644 --- a/src/Terminal.Gui.Editor/Utils/BusyManager.cs +++ b/src/Terminal.Gui.Editor/Utils/BusyManager.cs @@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// This class is used to prevent stack overflows by representing a 'busy' flag diff --git a/src/Terminal.Gui.Editor/Utils/CallbackOnDispose.cs b/src/Terminal.Gui.Editor/Utils/CallbackOnDispose.cs index 65e30e09..5fa91071 100644 --- a/src/Terminal.Gui.Editor/Utils/CallbackOnDispose.cs +++ b/src/Terminal.Gui.Editor/Utils/CallbackOnDispose.cs @@ -20,7 +20,7 @@ using System; using System.Threading; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// Invokes an action when it is disposed. diff --git a/src/Terminal.Gui.Editor/Utils/CharRope.cs b/src/Terminal.Gui.Editor/Utils/CharRope.cs index a6497e02..543b1cd3 100644 --- a/src/Terminal.Gui.Editor/Utils/CharRope.cs +++ b/src/Terminal.Gui.Editor/Utils/CharRope.cs @@ -20,7 +20,7 @@ using System; using System.IO; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// Poor man's template specialization: extension methods for Rope<char>. diff --git a/src/Terminal.Gui.Editor/Utils/CompressingTreeList.cs b/src/Terminal.Gui.Editor/Utils/CompressingTreeList.cs index 95934d7d..0b97e12d 100644 --- a/src/Terminal.Gui.Editor/Utils/CompressingTreeList.cs +++ b/src/Terminal.Gui.Editor/Utils/CompressingTreeList.cs @@ -25,7 +25,7 @@ using System.Globalization; using System.Text; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// A IList{T} implementation that has efficient insertion and removal (in O(lg n) time) diff --git a/src/Terminal.Gui.Editor/Utils/Constants.cs b/src/Terminal.Gui.Editor/Utils/Constants.cs index 0929dfe2..682c0b0d 100644 --- a/src/Terminal.Gui.Editor/Utils/Constants.cs +++ b/src/Terminal.Gui.Editor/Utils/Constants.cs @@ -17,7 +17,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { internal static class Constants { diff --git a/src/Terminal.Gui.Editor/Utils/DelayedEvents.cs b/src/Terminal.Gui.Editor/Utils/DelayedEvents.cs index 87013f97..346c1f87 100644 --- a/src/Terminal.Gui.Editor/Utils/DelayedEvents.cs +++ b/src/Terminal.Gui.Editor/Utils/DelayedEvents.cs @@ -20,7 +20,7 @@ using System; using System.Collections.Generic; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// Maintains a list of delayed events to raise. diff --git a/src/Terminal.Gui.Editor/Utils/Deque.cs b/src/Terminal.Gui.Editor/Utils/Deque.cs index 7b3641c9..8844e7b8 100644 --- a/src/Terminal.Gui.Editor/Utils/Deque.cs +++ b/src/Terminal.Gui.Editor/Utils/Deque.cs @@ -20,7 +20,7 @@ using System; using System.Collections.Generic; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// Double-ended queue. diff --git a/src/Terminal.Gui.Editor/Utils/FileReader.cs b/src/Terminal.Gui.Editor/Utils/FileReader.cs index 5e41572d..ef148d66 100644 --- a/src/Terminal.Gui.Editor/Utils/FileReader.cs +++ b/src/Terminal.Gui.Editor/Utils/FileReader.cs @@ -21,7 +21,7 @@ using System.IO; using System.Text; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// Class that can open text files with auto-detection of the encoding. diff --git a/src/Terminal.Gui.Editor/Utils/IFreezable.cs b/src/Terminal.Gui.Editor/Utils/IFreezable.cs index 3a22f5d8..2b12218b 100644 --- a/src/Terminal.Gui.Editor/Utils/IFreezable.cs +++ b/src/Terminal.Gui.Editor/Utils/IFreezable.cs @@ -22,7 +22,7 @@ using System.Collections.ObjectModel; using System.Linq; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { internal interface IFreezable { diff --git a/src/Terminal.Gui.Editor/Utils/IServiceContainer.cs b/src/Terminal.Gui.Editor/Utils/IServiceContainer.cs index b96e9754..65290d75 100644 --- a/src/Terminal.Gui.Editor/Utils/IServiceContainer.cs +++ b/src/Terminal.Gui.Editor/Utils/IServiceContainer.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { public interface IServiceContainer : IServiceProvider { diff --git a/src/Terminal.Gui.Editor/Utils/NullSafeCollection.cs b/src/Terminal.Gui.Editor/Utils/NullSafeCollection.cs index 42d2e390..abcfaea2 100644 --- a/src/Terminal.Gui.Editor/Utils/NullSafeCollection.cs +++ b/src/Terminal.Gui.Editor/Utils/NullSafeCollection.cs @@ -20,7 +20,7 @@ using System; using System.Collections.ObjectModel; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// A collection that cannot contain null values. diff --git a/src/Terminal.Gui.Editor/Utils/PropertyChangedWeakEventManager.cs b/src/Terminal.Gui.Editor/Utils/PropertyChangedWeakEventManager.cs index d8cf6367..fef1b7d4 100644 --- a/src/Terminal.Gui.Editor/Utils/PropertyChangedWeakEventManager.cs +++ b/src/Terminal.Gui.Editor/Utils/PropertyChangedWeakEventManager.cs @@ -19,7 +19,7 @@ using System.ComponentModel; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// WeakEventManager for INotifyPropertyChanged.PropertyChanged. diff --git a/src/Terminal.Gui.Editor/Utils/Rope.cs b/src/Terminal.Gui.Editor/Utils/Rope.cs index f0d4f3f2..85774186 100644 --- a/src/Terminal.Gui.Editor/Utils/Rope.cs +++ b/src/Terminal.Gui.Editor/Utils/Rope.cs @@ -27,7 +27,7 @@ using System.Linq; using System.Text; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// A kind of List<T>, but more efficient for random insertions/removal. diff --git a/src/Terminal.Gui.Editor/Utils/RopeNode.cs b/src/Terminal.Gui.Editor/Utils/RopeNode.cs index 2f422708..cb868b66 100644 --- a/src/Terminal.Gui.Editor/Utils/RopeNode.cs +++ b/src/Terminal.Gui.Editor/Utils/RopeNode.cs @@ -22,7 +22,7 @@ using System.Globalization; using System.Text; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// Class used to represent a node in the tree. diff --git a/src/Terminal.Gui.Editor/Utils/RopeTextReader.cs b/src/Terminal.Gui.Editor/Utils/RopeTextReader.cs index f0d2ba57..cb8bf976 100644 --- a/src/Terminal.Gui.Editor/Utils/RopeTextReader.cs +++ b/src/Terminal.Gui.Editor/Utils/RopeTextReader.cs @@ -22,7 +22,7 @@ using System.Diagnostics; using System.IO; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// TextReader implementation that reads text from a rope. diff --git a/src/Terminal.Gui.Editor/Utils/StringSegment.cs b/src/Terminal.Gui.Editor/Utils/StringSegment.cs index 8c9ae059..14620bfb 100644 --- a/src/Terminal.Gui.Editor/Utils/StringSegment.cs +++ b/src/Terminal.Gui.Editor/Utils/StringSegment.cs @@ -19,7 +19,7 @@ using System; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// Represents a string with a segment. diff --git a/src/Terminal.Gui.Editor/Utils/ThrowUtil.cs b/src/Terminal.Gui.Editor/Utils/ThrowUtil.cs index 75602e43..7a9b84fa 100644 --- a/src/Terminal.Gui.Editor/Utils/ThrowUtil.cs +++ b/src/Terminal.Gui.Editor/Utils/ThrowUtil.cs @@ -20,7 +20,7 @@ using System; using System.Globalization; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// Contains exception-throwing helper methods. diff --git a/src/Terminal.Gui.Editor/Utils/ValueStringBuilder.AppendSpanFormattable.cs b/src/Terminal.Gui.Editor/Utils/ValueStringBuilder.AppendSpanFormattable.cs index 68818ae7..49047794 100644 --- a/src/Terminal.Gui.Editor/Utils/ValueStringBuilder.AppendSpanFormattable.cs +++ b/src/Terminal.Gui.Editor/Utils/ValueStringBuilder.AppendSpanFormattable.cs @@ -8,7 +8,7 @@ #nullable enable -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { internal ref partial struct ValueStringBuilder { diff --git a/src/Terminal.Gui.Editor/Utils/ValueStringBuilder.cs b/src/Terminal.Gui.Editor/Utils/ValueStringBuilder.cs index 6688a4e9..d4021b56 100644 --- a/src/Terminal.Gui.Editor/Utils/ValueStringBuilder.cs +++ b/src/Terminal.Gui.Editor/Utils/ValueStringBuilder.cs @@ -12,7 +12,7 @@ #nullable enable -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { // currently the dotnet/runtime version doesn't explicitly implement IDisposable even though it should do so [DebuggerDisplay("{DebuggerDisplay,nq}")] diff --git a/src/Terminal.Gui.Editor/Utils/ValueStringBuilder_1.cs b/src/Terminal.Gui.Editor/Utils/ValueStringBuilder_1.cs index 4d9d0092..63ca3b68 100644 --- a/src/Terminal.Gui.Editor/Utils/ValueStringBuilder_1.cs +++ b/src/Terminal.Gui.Editor/Utils/ValueStringBuilder_1.cs @@ -15,7 +15,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { using System.Text; diff --git a/src/Terminal.Gui.Editor/Utils/WeakEventManagerBase.cs b/src/Terminal.Gui.Editor/Utils/WeakEventManagerBase.cs index 6909769a..1f1f2d49 100644 --- a/src/Terminal.Gui.Editor/Utils/WeakEventManagerBase.cs +++ b/src/Terminal.Gui.Editor/Utils/WeakEventManagerBase.cs @@ -6,7 +6,7 @@ using System.Runtime.CompilerServices; using System.Threading; -namespace Terminal.Gui.Document.Utils +namespace Terminal.Gui.Editor.Document.Utils { /// /// WeakEventManager base class. Inspired by the WPF WeakEventManager class and the code in diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorCompletionIntegrationTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorCompletionIntegrationTests.cs index 85ccd47f..3fe8941c 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorCompletionIntegrationTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorCompletionIntegrationTests.cs @@ -1,6 +1,6 @@ // CoPilot - gpt-4.1 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Completion; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorDisposalTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorDisposalTests.cs index 64f47c3c..57a0a24f 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorDisposalTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorDisposalTests.cs @@ -1,7 +1,7 @@ // Claude - claude-opus-4-6 using System.Drawing; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Completion; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorFoldingMouseTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorFoldingMouseTests.cs index 81277f0b..e4e8ffae 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorFoldingMouseTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorFoldingMouseTests.cs @@ -1,6 +1,6 @@ using System.Drawing; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Drivers; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorKeyBindingTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorKeyBindingTests.cs index 815b7303..85348883 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorKeyBindingTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorKeyBindingTests.cs @@ -1,7 +1,7 @@ // Copilot - gpt-4.1 -using Terminal.Gui.Document; -using Terminal.Gui.Document.Search; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Search; using Terminal.Gui.Drawing; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorKillRingTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorKillRingTests.cs index a7073251..5dd522b7 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorKillRingTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorKillRingTests.cs @@ -1,6 +1,6 @@ // Copilot - gpt-4.1 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Drivers; using Terminal.Gui.Editor.Completion; using Terminal.Gui.Editor.IntegrationTests.Testing; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorRenderingTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorRenderingTests.cs index b8f251f9..9a07d8cc 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorRenderingTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorRenderingTests.cs @@ -4,7 +4,7 @@ using Terminal.Gui.Drawing; using Terminal.Gui.Drivers; using Terminal.Gui.Editor.IntegrationTests.Testing; -using Terminal.Gui.Highlighting; +using Terminal.Gui.Editor.Highlighting; using Terminal.Gui.Input; using Terminal.Gui.Testing; using Terminal.Gui.Text; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSearchHitTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSearchHitTests.cs index 880c4c5b..b8a99a5c 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSearchHitTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSearchHitTests.cs @@ -1,6 +1,6 @@ // Claude - claude-sonnet-4 -using Terminal.Gui.Document.Search; +using Terminal.Gui.Editor.Document.Search; using Terminal.Gui.Drawing; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSelectionTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSelectionTests.cs index d0f0421f..43bc0815 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSelectionTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSelectionTests.cs @@ -1,6 +1,6 @@ // Claude - claude-opus-4-7 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSingleLineTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSingleLineTests.cs index 66d5d2be..a93406ae 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSingleLineTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSingleLineTests.cs @@ -1,7 +1,7 @@ // Copilot - claude-sonnet-4 using System.Drawing; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Drivers; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSnapshotTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSnapshotTests.cs index fab57b68..db11d44f 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSnapshotTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSnapshotTests.cs @@ -2,7 +2,7 @@ using Terminal.Gui.Drawing; using Terminal.Gui.Editor.IntegrationTests.Testing; -using Terminal.Gui.Highlighting; +using Terminal.Gui.Editor.Highlighting; using Terminal.Gui.Input; using Terminal.Gui.Testing; using Xunit; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs index 386bedd4..08eae724 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs @@ -10,7 +10,7 @@ using Terminal.Gui.Input; using Terminal.Gui.Resources; using Terminal.Gui.Testing; -using Terminal.Gui.Text.Indentation; +using Terminal.Gui.Editor.Indentation; using Xunit; namespace Terminal.Gui.Editor.IntegrationTests; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/Testing/EditorTestHost.cs b/tests/Terminal.Gui.Editor.IntegrationTests/Testing/EditorTestHost.cs index f77f71e4..96ebf967 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/Testing/EditorTestHost.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/Testing/EditorTestHost.cs @@ -1,6 +1,6 @@ // Claude - claude-opus-4-7 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; using Terminal.Gui.ViewBase; using Terminal.Gui.Views; diff --git a/tests/Terminal.Gui.Editor.PerformanceTests/LargeDocumentLoadPerformanceTests.cs b/tests/Terminal.Gui.Editor.PerformanceTests/LargeDocumentLoadPerformanceTests.cs index 673af5d5..ed96202e 100644 --- a/tests/Terminal.Gui.Editor.PerformanceTests/LargeDocumentLoadPerformanceTests.cs +++ b/tests/Terminal.Gui.Editor.PerformanceTests/LargeDocumentLoadPerformanceTests.cs @@ -1,6 +1,6 @@ using System.Diagnostics; using System.Text; -using Terminal.Gui.Highlighting; +using Terminal.Gui.Editor.Highlighting; using Xunit; namespace Terminal.Gui.Editor.PerformanceTests; diff --git a/tests/Terminal.Gui.Editor.PerformanceTests/PerformanceSmokeTests.cs b/tests/Terminal.Gui.Editor.PerformanceTests/PerformanceSmokeTests.cs index 79458fa8..1cfb224e 100644 --- a/tests/Terminal.Gui.Editor.PerformanceTests/PerformanceSmokeTests.cs +++ b/tests/Terminal.Gui.Editor.PerformanceTests/PerformanceSmokeTests.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Drawing; using Ted; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Rendering; using Terminal.Gui.Input; using Xunit; diff --git a/tests/Terminal.Gui.Editor.PerformanceTests/StreamingLoadPerformanceTests.cs b/tests/Terminal.Gui.Editor.PerformanceTests/StreamingLoadPerformanceTests.cs index 4f91af73..e865e9ec 100644 --- a/tests/Terminal.Gui.Editor.PerformanceTests/StreamingLoadPerformanceTests.cs +++ b/tests/Terminal.Gui.Editor.PerformanceTests/StreamingLoadPerformanceTests.cs @@ -1,6 +1,6 @@ using System.Diagnostics; using System.Text; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.PerformanceTests; diff --git a/tests/Terminal.Gui.Editor.Tests/Document/ChangeTrackingTest.cs b/tests/Terminal.Gui.Editor.Tests/Document/ChangeTrackingTest.cs index 9854b9fc..3103c456 100644 --- a/tests/Terminal.Gui.Editor.Tests/Document/ChangeTrackingTest.cs +++ b/tests/Terminal.Gui.Editor.Tests/Document/ChangeTrackingTest.cs @@ -18,7 +18,7 @@ // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.Tests.Document; diff --git a/tests/Terminal.Gui.Editor.Tests/Document/LineManagerTests.cs b/tests/Terminal.Gui.Editor.Tests/Document/LineManagerTests.cs index 68a73147..ce7b69cb 100644 --- a/tests/Terminal.Gui.Editor.Tests/Document/LineManagerTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Document/LineManagerTests.cs @@ -18,7 +18,7 @@ // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.Tests.Document; diff --git a/tests/Terminal.Gui.Editor.Tests/Document/TextAnchorTest.cs b/tests/Terminal.Gui.Editor.Tests/Document/TextAnchorTest.cs index 3feb5f50..e27c8cc2 100644 --- a/tests/Terminal.Gui.Editor.Tests/Document/TextAnchorTest.cs +++ b/tests/Terminal.Gui.Editor.Tests/Document/TextAnchorTest.cs @@ -18,7 +18,7 @@ // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.Tests.Document; diff --git a/tests/Terminal.Gui.Editor.Tests/Document/TextSegmentTreeTest.cs b/tests/Terminal.Gui.Editor.Tests/Document/TextSegmentTreeTest.cs index aa123ec7..3473ebbb 100644 --- a/tests/Terminal.Gui.Editor.Tests/Document/TextSegmentTreeTest.cs +++ b/tests/Terminal.Gui.Editor.Tests/Document/TextSegmentTreeTest.cs @@ -18,7 +18,7 @@ // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.Tests.Document; diff --git a/tests/Terminal.Gui.Editor.Tests/Document/TextUtilitiesTests.cs b/tests/Terminal.Gui.Editor.Tests/Document/TextUtilitiesTests.cs index 96e40983..173ffe94 100644 --- a/tests/Terminal.Gui.Editor.Tests/Document/TextUtilitiesTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Document/TextUtilitiesTests.cs @@ -18,7 +18,7 @@ // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.Tests.Document; diff --git a/tests/Terminal.Gui.Editor.Tests/Document/UndoStackTests.cs b/tests/Terminal.Gui.Editor.Tests/Document/UndoStackTests.cs index aa08fdb5..0b197842 100644 --- a/tests/Terminal.Gui.Editor.Tests/Document/UndoStackTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Document/UndoStackTests.cs @@ -18,7 +18,7 @@ // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.Tests.Document; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorCompletionTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorCompletionTests.cs index 4043ee78..3e24310b 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorCompletionTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorCompletionTests.cs @@ -2,7 +2,7 @@ using System.Drawing; using Terminal.Gui.App; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Drivers; using Terminal.Gui.Editor.Completion; using Terminal.Gui.Input; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorFindReplaceTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorFindReplaceTests.cs index c1b2c553..6bf8ea8f 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorFindReplaceTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorFindReplaceTests.cs @@ -1,7 +1,7 @@ // Claude - claude-opus-4-7 -using Terminal.Gui.Document; -using Terminal.Gui.Document.Search; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Search; using Xunit; namespace Terminal.Gui.Editor.Tests; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorGraphemeNavigationTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorGraphemeNavigationTests.cs index 8338219a..123cdbde 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorGraphemeNavigationTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorGraphemeNavigationTests.cs @@ -1,6 +1,6 @@ // Copilot - claude-opus-4.6 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Input; using Xunit; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorIsModifiedTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorIsModifiedTests.cs index 0252defd..1cef0bb9 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorIsModifiedTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorIsModifiedTests.cs @@ -1,6 +1,6 @@ // Copilot - claude-opus-4.6 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.Tests; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorLogicTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorLogicTests.cs index 4fdac58a..47312ad5 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorLogicTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorLogicTests.cs @@ -1,10 +1,10 @@ // Claude - claude-opus-4-7 using System.Drawing; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Editor.Rendering; -using Terminal.Gui.Highlighting; +using Terminal.Gui.Editor.Highlighting; using Xunit; namespace Terminal.Gui.Editor.Tests; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorMultiCaretTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorMultiCaretTests.cs index fa30e840..24566287 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorMultiCaretTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorMultiCaretTests.cs @@ -1,9 +1,9 @@ // Copilot - claude-sonnet-4 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Rendering; using Terminal.Gui.Input; -using Terminal.Gui.Text.Indentation; +using Terminal.Gui.Editor.Indentation; using Xunit; namespace Terminal.Gui.Editor.Tests; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorSelectionLogicTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorSelectionLogicTests.cs index 28a7b967..4ed83998 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorSelectionLogicTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorSelectionLogicTests.cs @@ -1,6 +1,6 @@ // Claude - claude-opus-4-7 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Input; using Xunit; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorStatusBarTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorStatusBarTests.cs index 5248b640..1b6474fd 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorStatusBarTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorStatusBarTests.cs @@ -1,6 +1,6 @@ // Copilot - claude-opus-4.6 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Views; using Xunit; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorVisualLineCacheTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorVisualLineCacheTests.cs index ee4a99ed..83979abb 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorVisualLineCacheTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorVisualLineCacheTests.cs @@ -1,7 +1,7 @@ // Claude - claude-opus-4-7 using System.Reflection; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; using Terminal.Gui.Editor.Rendering; using Xunit; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorWordNavigationTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorWordNavigationTests.cs index cef53063..2828ad1c 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorWordNavigationTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorWordNavigationTests.cs @@ -1,6 +1,6 @@ // CoPilot - claude-sonnet-4.6 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Input; using Xunit; diff --git a/tests/Terminal.Gui.Editor.Tests/Folding/AutomaticFoldingTests.cs b/tests/Terminal.Gui.Editor.Tests/Folding/AutomaticFoldingTests.cs index 9647c3d0..a2f8a80f 100644 --- a/tests/Terminal.Gui.Editor.Tests/Folding/AutomaticFoldingTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Folding/AutomaticFoldingTests.cs @@ -1,8 +1,8 @@ // Copilot - Claude Opus 4.6 using System.Text; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Xunit; namespace Terminal.Gui.Editor.Tests.Folding; diff --git a/tests/Terminal.Gui.Editor.Tests/Folding/BraceFoldingStrategyTests.cs b/tests/Terminal.Gui.Editor.Tests/Folding/BraceFoldingStrategyTests.cs index 4a21c345..f8ed53a0 100644 --- a/tests/Terminal.Gui.Editor.Tests/Folding/BraceFoldingStrategyTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Folding/BraceFoldingStrategyTests.cs @@ -1,7 +1,7 @@ // Copilot - Claude Opus 4.6 -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Xunit; namespace Terminal.Gui.Editor.Tests.Folding; diff --git a/tests/Terminal.Gui.Editor.Tests/Folding/EditorFoldingNavigationTests.cs b/tests/Terminal.Gui.Editor.Tests/Folding/EditorFoldingNavigationTests.cs index b43a8a1d..96e8c342 100644 --- a/tests/Terminal.Gui.Editor.Tests/Folding/EditorFoldingNavigationTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Folding/EditorFoldingNavigationTests.cs @@ -1,7 +1,7 @@ // Copilot - Claude Opus 4.6 -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Input; using Xunit; diff --git a/tests/Terminal.Gui.Editor.Tests/Folding/FoldingManagerTests.cs b/tests/Terminal.Gui.Editor.Tests/Folding/FoldingManagerTests.cs index 76cf8d4b..63719ab7 100644 --- a/tests/Terminal.Gui.Editor.Tests/Folding/FoldingManagerTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Folding/FoldingManagerTests.cs @@ -1,8 +1,8 @@ // Copilot - Claude Opus 4.6 using System.Collections.ObjectModel; -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Xunit; namespace Terminal.Gui.Editor.Tests.Folding; diff --git a/tests/Terminal.Gui.Editor.Tests/Folding/FoldingTransformerTests.cs b/tests/Terminal.Gui.Editor.Tests/Folding/FoldingTransformerTests.cs index be82c1d0..ce71229d 100644 --- a/tests/Terminal.Gui.Editor.Tests/Folding/FoldingTransformerTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Folding/FoldingTransformerTests.cs @@ -1,7 +1,7 @@ // Copilot - Claude Opus 4.6 -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Editor.Rendering; using Xunit; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/tests/Terminal.Gui.Editor.Tests/GutterTests.cs b/tests/Terminal.Gui.Editor.Tests/GutterTests.cs index f8a973b5..b70de044 100644 --- a/tests/Terminal.Gui.Editor.Tests/GutterTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/GutterTests.cs @@ -1,7 +1,7 @@ // Claude - claude-opus-4-7 -using Terminal.Gui.Document; -using Terminal.Gui.Document.Folding; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Input; using Terminal.Gui.ViewBase; using Xunit; diff --git a/tests/Terminal.Gui.Editor.Tests/HighlightingTests.cs b/tests/Terminal.Gui.Editor.Tests/HighlightingTests.cs index 84527f3c..b45f25d1 100644 --- a/tests/Terminal.Gui.Editor.Tests/HighlightingTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/HighlightingTests.cs @@ -1,11 +1,11 @@ // CoPilot - claude-opus-4.6 using System.Xml; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; using Terminal.Gui.Editor.Rendering; -using Terminal.Gui.Highlighting; -using Terminal.Gui.Highlighting.Xshd; +using Terminal.Gui.Editor.Highlighting; +using Terminal.Gui.Editor.Highlighting.Xshd; using Xunit; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/tests/Terminal.Gui.Editor.Tests/Indentation/DefaultIndentationStrategyTests.cs b/tests/Terminal.Gui.Editor.Tests/Indentation/DefaultIndentationStrategyTests.cs index 2647464e..042b889d 100644 --- a/tests/Terminal.Gui.Editor.Tests/Indentation/DefaultIndentationStrategyTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Indentation/DefaultIndentationStrategyTests.cs @@ -1,7 +1,7 @@ // CoPilot - claude-opus-4.6 -using Terminal.Gui.Document; -using Terminal.Gui.Text.Indentation; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Indentation; using Xunit; namespace Terminal.Gui.Editor.Tests.Indentation; diff --git a/tests/Terminal.Gui.Editor.Tests/Indentation/EditorAutoIndentTests.cs b/tests/Terminal.Gui.Editor.Tests/Indentation/EditorAutoIndentTests.cs index 185eb7ba..62d1a9b3 100644 --- a/tests/Terminal.Gui.Editor.Tests/Indentation/EditorAutoIndentTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Indentation/EditorAutoIndentTests.cs @@ -1,7 +1,7 @@ // CoPilot - claude-opus-4.6 -using Terminal.Gui.Document; -using Terminal.Gui.Text.Indentation; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Indentation; using Xunit; namespace Terminal.Gui.Editor.Tests.Indentation; diff --git a/tests/Terminal.Gui.Editor.Tests/MaxWidthEstimationTests.cs b/tests/Terminal.Gui.Editor.Tests/MaxWidthEstimationTests.cs index 721dbd1c..25652a52 100644 --- a/tests/Terminal.Gui.Editor.Tests/MaxWidthEstimationTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/MaxWidthEstimationTests.cs @@ -1,7 +1,7 @@ // Claude - claude-opus-4-7 using System.Text; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.Tests; diff --git a/tests/Terminal.Gui.Editor.Tests/Rendering/VisualLineBuilderTests.cs b/tests/Terminal.Gui.Editor.Tests/Rendering/VisualLineBuilderTests.cs index 7ef9f0d0..56efb8e5 100644 --- a/tests/Terminal.Gui.Editor.Tests/Rendering/VisualLineBuilderTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Rendering/VisualLineBuilderTests.cs @@ -1,6 +1,6 @@ // Codex - GPT-5 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Rendering; using Xunit; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/tests/Terminal.Gui.Editor.Tests/Search/SearchStrategyTests.cs b/tests/Terminal.Gui.Editor.Tests/Search/SearchStrategyTests.cs index a378e531..a1ee95e4 100644 --- a/tests/Terminal.Gui.Editor.Tests/Search/SearchStrategyTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Search/SearchStrategyTests.cs @@ -1,7 +1,7 @@ // Claude - claude-opus-4-7 -using Terminal.Gui.Document; -using Terminal.Gui.Document.Search; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Search; using Xunit; namespace Terminal.Gui.Editor.Tests.Search; diff --git a/tests/Terminal.Gui.Editor.Tests/SearchHitRendererTests.cs b/tests/Terminal.Gui.Editor.Tests/SearchHitRendererTests.cs index 84ce0be2..943a8ff4 100644 --- a/tests/Terminal.Gui.Editor.Tests/SearchHitRendererTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/SearchHitRendererTests.cs @@ -1,7 +1,7 @@ // Claude - claude-sonnet-4 -using Terminal.Gui.Document; -using Terminal.Gui.Document.Search; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Search; using Terminal.Gui.Editor.Rendering; using Xunit; diff --git a/tests/Terminal.Gui.Editor.Tests/TextDocumentStreamingTests.cs b/tests/Terminal.Gui.Editor.Tests/TextDocumentStreamingTests.cs index 56ac0b1a..99c1c87b 100644 --- a/tests/Terminal.Gui.Editor.Tests/TextDocumentStreamingTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/TextDocumentStreamingTests.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Text; -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.Tests; diff --git a/tests/Terminal.Gui.Editor.Tests/TextDocumentTextChangedTests.cs b/tests/Terminal.Gui.Editor.Tests/TextDocumentTextChangedTests.cs index 21a258c3..45e1d2fd 100644 --- a/tests/Terminal.Gui.Editor.Tests/TextDocumentTextChangedTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/TextDocumentTextChangedTests.cs @@ -1,6 +1,6 @@ // CoPilot - gpt-5.5 -using Terminal.Gui.Document; +using Terminal.Gui.Editor.Document; using Xunit; namespace Terminal.Gui.Editor.Tests; diff --git a/tests/Terminal.Gui.Editor.Tests/Utils/CompressingTreeListTests.cs b/tests/Terminal.Gui.Editor.Tests/Utils/CompressingTreeListTests.cs index 49b4109c..57bf30e5 100644 --- a/tests/Terminal.Gui.Editor.Tests/Utils/CompressingTreeListTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Utils/CompressingTreeListTests.cs @@ -18,7 +18,7 @@ // DEALINGS IN THE SOFTWARE. -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; using Xunit; namespace Terminal.Gui.Editor.Tests.Utils; diff --git a/tests/Terminal.Gui.Editor.Tests/Utils/DequeTests.cs b/tests/Terminal.Gui.Editor.Tests/Utils/DequeTests.cs index 9f11605c..6b47465f 100644 --- a/tests/Terminal.Gui.Editor.Tests/Utils/DequeTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Utils/DequeTests.cs @@ -19,7 +19,7 @@ using System.Collections; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; using Xunit; namespace Terminal.Gui.Editor.Tests.Utils; diff --git a/tests/Terminal.Gui.Editor.Tests/Utils/RopeTests.cs b/tests/Terminal.Gui.Editor.Tests/Utils/RopeTests.cs index 637d157b..2280890b 100644 --- a/tests/Terminal.Gui.Editor.Tests/Utils/RopeTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Utils/RopeTests.cs @@ -19,7 +19,7 @@ using System.Text; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; using Xunit; namespace Terminal.Gui.Editor.Tests.Utils; diff --git a/tests/Terminal.Gui.Editor.Tests/Utils/ValueStringBuilderTests.cs b/tests/Terminal.Gui.Editor.Tests/Utils/ValueStringBuilderTests.cs index 49d27132..3abc99ca 100644 --- a/tests/Terminal.Gui.Editor.Tests/Utils/ValueStringBuilderTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/Utils/ValueStringBuilderTests.cs @@ -8,7 +8,7 @@ using System.Diagnostics.CodeAnalysis; using System.Text; -using Terminal.Gui.Document.Utils; +using Terminal.Gui.Editor.Document.Utils; using Xunit; namespace Terminal.Gui.Editor.Tests.Utils; From 3682df0bea48b71f9b5dca4ec4e468b2f0a0399d Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 23 May 2026 16:33:54 -0600 Subject: [PATCH 02/10] style: fix using-directive sort order after namespace rename ReSharper sorts Terminal.Gui.Editor.* after Terminal.Gui.Drawing/Input alphabetically, which changed relative positions after the rename. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- benchmarks/Terminal.Gui.Editor.Benchmarks/EditorHarness.cs | 2 +- examples/prompt/Program.cs | 2 +- examples/ted/TedApp.cs | 6 +++--- examples/ted/WordCompletionProvider.cs | 2 +- src/Terminal.Gui.Editor/Editor.Drawing.cs | 6 +++--- src/Terminal.Gui.Editor/Editor.Mouse.cs | 2 +- src/Terminal.Gui.Editor/Editor.cs | 6 +++--- src/Terminal.Gui.Editor/Rendering/SearchHitRenderer.cs | 2 +- src/Terminal.Gui.Editor/Rendering/VisualLineBuildContext.cs | 2 +- src/Terminal.Gui.Editor/Rendering/VisualLineBuilder.cs | 2 +- .../EditorCompletionIntegrationTests.cs | 2 +- .../EditorDisposalTests.cs | 2 +- .../EditorFoldingMouseTests.cs | 2 +- .../EditorKeyBindingTests.cs | 2 +- .../EditorKillRingTests.cs | 2 +- .../EditorRenderingTests.cs | 2 +- .../EditorSearchHitTests.cs | 2 +- .../EditorSingleLineTests.cs | 2 +- .../EditorSnapshotTests.cs | 2 +- tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs | 2 +- .../Testing/EditorTestHost.cs | 2 +- tests/Terminal.Gui.Editor.Tests/EditorCompletionTests.cs | 2 +- tests/Terminal.Gui.Editor.Tests/EditorLogicTests.cs | 2 +- tests/Terminal.Gui.Editor.Tests/EditorMultiCaretTests.cs | 2 +- .../Terminal.Gui.Editor.Tests/EditorVisualLineCacheTests.cs | 2 +- tests/Terminal.Gui.Editor.Tests/HighlightingTests.cs | 4 ++-- 26 files changed, 33 insertions(+), 33 deletions(-) diff --git a/benchmarks/Terminal.Gui.Editor.Benchmarks/EditorHarness.cs b/benchmarks/Terminal.Gui.Editor.Benchmarks/EditorHarness.cs index e4577903..0c6d36cc 100644 --- a/benchmarks/Terminal.Gui.Editor.Benchmarks/EditorHarness.cs +++ b/benchmarks/Terminal.Gui.Editor.Benchmarks/EditorHarness.cs @@ -1,7 +1,7 @@ using Terminal.Gui.App; -using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; using Terminal.Gui.Drivers; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Testing; using Terminal.Gui.ViewBase; using Terminal.Gui.Views; diff --git a/examples/prompt/Program.cs b/examples/prompt/Program.cs index 98929044..099c2720 100644 --- a/examples/prompt/Program.cs +++ b/examples/prompt/Program.cs @@ -2,8 +2,8 @@ // outputs to stdout on Enter, exits silently on Esc. using Terminal.Gui.App; -using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Input; using Terminal.Gui.ViewBase; using Terminal.Gui.Views; diff --git a/examples/ted/TedApp.cs b/examples/ted/TedApp.cs index 31dcf6fe..306c3696 100644 --- a/examples/ted/TedApp.cs +++ b/examples/ted/TedApp.cs @@ -3,13 +3,13 @@ using System.Text; using Terminal.Gui.App; using Terminal.Gui.Configuration; -using Terminal.Gui.Editor.Document; -using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Drawing; using Terminal.Gui.Editor; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; +using Terminal.Gui.Editor.Indentation; using Terminal.Gui.Input; using Terminal.Gui.Resources; -using Terminal.Gui.Editor.Indentation; using Terminal.Gui.ViewBase; using Terminal.Gui.Views; diff --git a/examples/ted/WordCompletionProvider.cs b/examples/ted/WordCompletionProvider.cs index 6b4a367f..e00d8620 100644 --- a/examples/ted/WordCompletionProvider.cs +++ b/examples/ted/WordCompletionProvider.cs @@ -1,5 +1,5 @@ -using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Completion; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Input; namespace Ted; diff --git a/src/Terminal.Gui.Editor/Editor.Drawing.cs b/src/Terminal.Gui.Editor/Editor.Drawing.cs index 6a093d20..5ebe48b1 100644 --- a/src/Terminal.Gui.Editor/Editor.Drawing.cs +++ b/src/Terminal.Gui.Editor/Editor.Drawing.cs @@ -1,10 +1,10 @@ using System.Drawing; -using Terminal.Gui.Editor.Document; -using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Drawing; using Terminal.Gui.Drivers; -using Terminal.Gui.Editor.Rendering; +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Editor.Highlighting; +using Terminal.Gui.Editor.Rendering; using Terminal.Gui.ViewBase; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/src/Terminal.Gui.Editor/Editor.Mouse.cs b/src/Terminal.Gui.Editor/Editor.Mouse.cs index 4813cb7d..0bd256c5 100644 --- a/src/Terminal.Gui.Editor/Editor.Mouse.cs +++ b/src/Terminal.Gui.Editor/Editor.Mouse.cs @@ -1,6 +1,6 @@ using System.Drawing; -using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Rendering; using Terminal.Gui.Input; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/src/Terminal.Gui.Editor/Editor.cs b/src/Terminal.Gui.Editor/Editor.cs index 06474f82..b6be639f 100644 --- a/src/Terminal.Gui.Editor/Editor.cs +++ b/src/Terminal.Gui.Editor/Editor.cs @@ -2,14 +2,14 @@ using System.Drawing; using Terminal.Gui.App; using Terminal.Gui.Configuration; +using Terminal.Gui.Drawing; using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Document.Folding; -using Terminal.Gui.Drawing; -using Terminal.Gui.Editor.Rendering; using Terminal.Gui.Editor.Highlighting; +using Terminal.Gui.Editor.Indentation; +using Terminal.Gui.Editor.Rendering; using Terminal.Gui.Input; using Terminal.Gui.Text; -using Terminal.Gui.Editor.Indentation; using Terminal.Gui.ViewBase; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/src/Terminal.Gui.Editor/Rendering/SearchHitRenderer.cs b/src/Terminal.Gui.Editor/Rendering/SearchHitRenderer.cs index 4b553a4c..5620443c 100644 --- a/src/Terminal.Gui.Editor/Rendering/SearchHitRenderer.cs +++ b/src/Terminal.Gui.Editor/Rendering/SearchHitRenderer.cs @@ -1,7 +1,7 @@ using System.Drawing; +using Terminal.Gui.Drawing; using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Document.Search; -using Terminal.Gui.Drawing; using Terminal.Gui.ViewBase; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/src/Terminal.Gui.Editor/Rendering/VisualLineBuildContext.cs b/src/Terminal.Gui.Editor/Rendering/VisualLineBuildContext.cs index ba1d026c..c41e80ae 100644 --- a/src/Terminal.Gui.Editor/Rendering/VisualLineBuildContext.cs +++ b/src/Terminal.Gui.Editor/Rendering/VisualLineBuildContext.cs @@ -1,5 +1,5 @@ -using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; +using Terminal.Gui.Editor.Document; using Attribute = Terminal.Gui.Drawing.Attribute; namespace Terminal.Gui.Editor.Rendering; diff --git a/src/Terminal.Gui.Editor/Rendering/VisualLineBuilder.cs b/src/Terminal.Gui.Editor/Rendering/VisualLineBuilder.cs index bf004071..89c4e631 100644 --- a/src/Terminal.Gui.Editor/Rendering/VisualLineBuilder.cs +++ b/src/Terminal.Gui.Editor/Rendering/VisualLineBuilder.cs @@ -1,5 +1,5 @@ -using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; +using Terminal.Gui.Editor.Document; using Attribute = Terminal.Gui.Drawing.Attribute; namespace Terminal.Gui.Editor.Rendering; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorCompletionIntegrationTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorCompletionIntegrationTests.cs index 3fe8941c..87aadb12 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorCompletionIntegrationTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorCompletionIntegrationTests.cs @@ -1,7 +1,7 @@ // CoPilot - gpt-4.1 -using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Completion; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorDisposalTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorDisposalTests.cs index 57a0a24f..34b5712c 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorDisposalTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorDisposalTests.cs @@ -1,8 +1,8 @@ // Claude - claude-opus-4-6 using System.Drawing; -using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Completion; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorFoldingMouseTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorFoldingMouseTests.cs index e4e8ffae..f17dce33 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorFoldingMouseTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorFoldingMouseTests.cs @@ -1,7 +1,7 @@ using System.Drawing; +using Terminal.Gui.Drivers; using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Document.Folding; -using Terminal.Gui.Drivers; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorKeyBindingTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorKeyBindingTests.cs index 85348883..16db2ddf 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorKeyBindingTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorKeyBindingTests.cs @@ -1,8 +1,8 @@ // Copilot - gpt-4.1 +using Terminal.Gui.Drawing; using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Document.Search; -using Terminal.Gui.Drawing; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorKillRingTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorKillRingTests.cs index 5dd522b7..b205ccc0 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorKillRingTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorKillRingTests.cs @@ -1,8 +1,8 @@ // Copilot - gpt-4.1 -using Terminal.Gui.Editor.Document; using Terminal.Gui.Drivers; using Terminal.Gui.Editor.Completion; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorRenderingTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorRenderingTests.cs index 9a07d8cc..8471361f 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorRenderingTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorRenderingTests.cs @@ -3,8 +3,8 @@ using System.Drawing; using Terminal.Gui.Drawing; using Terminal.Gui.Drivers; -using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Editor.Highlighting; +using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; using Terminal.Gui.Text; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSearchHitTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSearchHitTests.cs index b8a99a5c..4fde2712 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSearchHitTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSearchHitTests.cs @@ -1,7 +1,7 @@ // Claude - claude-sonnet-4 -using Terminal.Gui.Editor.Document.Search; using Terminal.Gui.Drawing; +using Terminal.Gui.Editor.Document.Search; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSingleLineTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSingleLineTests.cs index a93406ae..762bc52c 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSingleLineTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSingleLineTests.cs @@ -1,8 +1,8 @@ // Copilot - claude-sonnet-4 using System.Drawing; -using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Drivers; +using Terminal.Gui.Editor.Document.Folding; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSnapshotTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSnapshotTests.cs index db11d44f..9ff6329d 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/EditorSnapshotTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/EditorSnapshotTests.cs @@ -1,8 +1,8 @@ // Claude - claude-opus-4-7 using Terminal.Gui.Drawing; -using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Editor.Highlighting; +using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; using Xunit; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs index 08eae724..2fd30b9d 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs @@ -6,11 +6,11 @@ using System.Text; using Ted; using Terminal.Gui.Configuration; +using Terminal.Gui.Editor.Indentation; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Resources; using Terminal.Gui.Testing; -using Terminal.Gui.Editor.Indentation; using Xunit; namespace Terminal.Gui.Editor.IntegrationTests; diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/Testing/EditorTestHost.cs b/tests/Terminal.Gui.Editor.IntegrationTests/Testing/EditorTestHost.cs index 96ebf967..a8d7732a 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/Testing/EditorTestHost.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/Testing/EditorTestHost.cs @@ -1,7 +1,7 @@ // Claude - claude-opus-4-7 -using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; +using Terminal.Gui.Editor.Document; using Terminal.Gui.ViewBase; using Terminal.Gui.Views; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorCompletionTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorCompletionTests.cs index 3e24310b..e93aa6c4 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorCompletionTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorCompletionTests.cs @@ -2,9 +2,9 @@ using System.Drawing; using Terminal.Gui.App; -using Terminal.Gui.Editor.Document; using Terminal.Gui.Drivers; using Terminal.Gui.Editor.Completion; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Input; using Terminal.Gui.Testing; using Terminal.Gui.ViewBase; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorLogicTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorLogicTests.cs index 47312ad5..2f3a41c8 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorLogicTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorLogicTests.cs @@ -3,8 +3,8 @@ using System.Drawing; using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Document.Folding; -using Terminal.Gui.Editor.Rendering; using Terminal.Gui.Editor.Highlighting; +using Terminal.Gui.Editor.Rendering; using Xunit; namespace Terminal.Gui.Editor.Tests; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorMultiCaretTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorMultiCaretTests.cs index 24566287..9ddac814 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorMultiCaretTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorMultiCaretTests.cs @@ -1,9 +1,9 @@ // Copilot - claude-sonnet-4 using Terminal.Gui.Editor.Document; +using Terminal.Gui.Editor.Indentation; using Terminal.Gui.Editor.Rendering; using Terminal.Gui.Input; -using Terminal.Gui.Editor.Indentation; using Xunit; namespace Terminal.Gui.Editor.Tests; diff --git a/tests/Terminal.Gui.Editor.Tests/EditorVisualLineCacheTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorVisualLineCacheTests.cs index 83979abb..989e038a 100644 --- a/tests/Terminal.Gui.Editor.Tests/EditorVisualLineCacheTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/EditorVisualLineCacheTests.cs @@ -1,8 +1,8 @@ // Claude - claude-opus-4-7 using System.Reflection; -using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Rendering; using Xunit; using Attribute = Terminal.Gui.Drawing.Attribute; diff --git a/tests/Terminal.Gui.Editor.Tests/HighlightingTests.cs b/tests/Terminal.Gui.Editor.Tests/HighlightingTests.cs index b45f25d1..6e826e10 100644 --- a/tests/Terminal.Gui.Editor.Tests/HighlightingTests.cs +++ b/tests/Terminal.Gui.Editor.Tests/HighlightingTests.cs @@ -1,11 +1,11 @@ // CoPilot - claude-opus-4.6 using System.Xml; -using Terminal.Gui.Editor.Document; using Terminal.Gui.Drawing; -using Terminal.Gui.Editor.Rendering; +using Terminal.Gui.Editor.Document; using Terminal.Gui.Editor.Highlighting; using Terminal.Gui.Editor.Highlighting.Xshd; +using Terminal.Gui.Editor.Rendering; using Xunit; using Attribute = Terminal.Gui.Drawing.Attribute; From 2a6f1c7a53b18ba10b8abe67858c18ab8190c088 Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 23 May 2026 16:52:28 -0600 Subject: [PATCH 03/10] feat(ted): highlight current editor line in Markdown preview Add MarkdownPreview subclass of Markdown that: - Highlights the rendered line corresponding to the editor's current source line using a proportional mapping and background color shift - Raises SourceLineClicked when user clicks in the preview, enabling click-to-navigate back to the corresponding source line in the editor Wire up Editor.CaretChanged in TedApp to update the highlight on every caret move, and handle SourceLineClicked to move the editor caret. Closes #229 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- examples/ted/MarkdownPreview.cs | 189 +++++++++++++++++++++++++ examples/ted/TedApp.MarkdownPreview.cs | 45 +++++- 2 files changed, 232 insertions(+), 2 deletions(-) create mode 100644 examples/ted/MarkdownPreview.cs diff --git a/examples/ted/MarkdownPreview.cs b/examples/ted/MarkdownPreview.cs new file mode 100644 index 00000000..ce94dc66 --- /dev/null +++ b/examples/ted/MarkdownPreview.cs @@ -0,0 +1,189 @@ +using System.Drawing; +using Terminal.Gui.Drawing; +using Terminal.Gui.Input; +using Terminal.Gui.ViewBase; +using Terminal.Gui.Views; +using Attribute = Terminal.Gui.Drawing.Attribute; +using Color = Terminal.Gui.Drawing.Color; + +namespace Ted; + +/// +/// A subclass that highlights the rendered line(s) corresponding to a +/// source line in the editor and raises when the user clicks +/// in the preview, enabling click-to-navigate back to the editor. +/// +internal sealed class MarkdownPreview : Markdown +{ + private int _highlightSourceLine = -1; + private int _totalSourceLines; + + /// + /// Gets or sets the 0-based source line number to highlight in the preview. + /// Set to -1 to clear the highlight. + /// + public int HighlightSourceLine + { + get => _highlightSourceLine; + set + { + if (_highlightSourceLine == value) + { + return; + } + + _highlightSourceLine = value; + SetNeedsDraw (); + } + } + + /// + /// Gets or sets the total number of source lines in the document. + /// Used for proportional mapping between source lines and rendered lines. + /// + public int TotalSourceLines + { + get => _totalSourceLines; + set + { + if (_totalSourceLines == value) + { + return; + } + + _totalSourceLines = value; + SetNeedsDraw (); + } + } + + /// + /// Raised when the user clicks in the preview. The event arg carries the estimated 0-based + /// source line number corresponding to the click position. + /// + public event EventHandler? SourceLineClicked; + + /// + /// Maps a 0-based source line number to the corresponding rendered line index using + /// proportional mapping. + /// + private int MapSourceToRendered (int sourceLine) + { + if (_totalSourceLines <= 1 || LineCount <= 0) + { + return 0; + } + + return (int)((long)sourceLine * (LineCount - 1) / (_totalSourceLines - 1)); + } + + /// + /// Maps a rendered line index back to an approximate 0-based source line number. + /// + private int MapRenderedToSource (int renderedLine) + { + if (LineCount <= 1 || _totalSourceLines <= 0) + { + return 0; + } + + return (int)((long)renderedLine * (_totalSourceLines - 1) / (LineCount - 1)); + } + + /// + protected override bool OnDrawingContent (DrawContext? context) + { + var result = base.OnDrawingContent (context); + + DrawHighlightBar (); + + return result; + } + + /// + /// Paints a subtle background highlight on the rendered row corresponding to + /// . + /// + private void DrawHighlightBar () + { + if (_highlightSourceLine < 0 || _totalSourceLines <= 0 || LineCount <= 0) + { + return; + } + + var renderedLine = MapSourceToRendered (_highlightSourceLine); + + // Check if the highlighted line is within the visible viewport. + var drawRow = renderedLine - Viewport.Y; + + if (drawRow < 0 || drawRow >= Viewport.Height) + { + return; + } + + // Compute a highlight attribute: shift the background slightly for contrast. + Attribute normalAttr = GetAttributeForRole (VisualRole.Normal); + Color highlightBg = normalAttr.Background.IsDarkColor () + ? normalAttr.Background.GetDimmerColor (0.25, false) + : normalAttr.Background.GetDimmerColor (0.15, true); + + // Paint the highlight over the full viewport width by reading existing screen content + // and re-drawing with the highlight background. + Cell[,]? contents = ScreenContents; + + if (contents is null) + { + return; + } + + Point screenOrigin = ContentToScreen (new Point (0, renderedLine)); + var screenRow = screenOrigin.Y; + var screenStartCol = screenOrigin.X; + + for (var col = 0; col < Viewport.Width; col++) + { + var sc = screenStartCol + col; + + if (screenRow < 0 || screenRow >= contents.GetLength (0) || sc < 0 || sc >= contents.GetLength (1)) + { + continue; + } + + Cell cell = contents[screenRow, sc]; + var grapheme = string.IsNullOrEmpty (cell.Grapheme) ? " " : cell.Grapheme; + + // Preserve the foreground color from the original cell but apply highlight background. + Attribute cellAttr = (cell.Attribute ?? normalAttr) with { Background = highlightBg }; + SetAttribute (cellAttr); + AddStr (col, drawRow, grapheme); + } + } + + /// + protected override bool OnMouseEvent (Mouse mouse) + { + if (mouse.Flags.HasFlag (MouseFlags.LeftButtonClicked) && mouse.Position is { } pos) + { + var contentRow = Viewport.Y + pos.Y; + + if (contentRow >= 0 && contentRow < LineCount) + { + var sourceLine = MapRenderedToSource (contentRow); + SourceLineClicked?.Invoke (this, new SourceLineClickedEventArgs (sourceLine)); + } + } + + return base.OnMouseEvent (mouse); + } +} + +/// Event args for . +internal sealed class SourceLineClickedEventArgs : EventArgs +{ + public SourceLineClickedEventArgs (int sourceLine) + { + SourceLine = sourceLine; + } + + /// Gets the estimated 0-based source line number that was clicked. + public int SourceLine { get; } +} diff --git a/examples/ted/TedApp.MarkdownPreview.cs b/examples/ted/TedApp.MarkdownPreview.cs index 31dd0eda..31cfbfc5 100644 --- a/examples/ted/TedApp.MarkdownPreview.cs +++ b/examples/ted/TedApp.MarkdownPreview.cs @@ -6,7 +6,7 @@ namespace Ted; public sealed partial class TedApp { - private Markdown? _markdownPreview; + private MarkdownPreview? _markdownPreview; private bool _syncingScroll; /// Toggle state used by the View menu item that shows or hides the Markdown preview pane. @@ -66,13 +66,14 @@ private void ShowMarkdownPreview () return; } - _markdownPreview = new Markdown + _markdownPreview = new MarkdownPreview { X = Pos.Right (Editor), Y = Editor.Y, Width = Dim.Fill (), Height = Editor.Height, Text = Editor.Document?.Text ?? string.Empty, + TotalSourceLines = Editor.Document?.LineCount ?? 1, ViewportSettings = ViewportSettingsFlags.HasScrollBars, SyntaxHighlighter = new TextMateSyntaxHighlighter () }; @@ -91,6 +92,13 @@ private void ShowMarkdownPreview () { Editor.Document.Changed += OnDocumentChangedForPreview; } + + // Track caret movement to highlight the corresponding line in the preview. + Editor.CaretChanged += OnEditorCaretChangedForPreview; + UpdatePreviewHighlight (); + + // Click in preview navigates the editor caret. + _markdownPreview.SourceLineClicked += OnPreviewSourceLineClicked; } private void HideMarkdownPreview () @@ -102,6 +110,8 @@ private void HideMarkdownPreview () Editor.ViewportChanged -= OnEditorViewportChanged; _markdownPreview.ViewportChanged -= OnPreviewViewportChanged; + Editor.CaretChanged -= OnEditorCaretChangedForPreview; + _markdownPreview.SourceLineClicked -= OnPreviewSourceLineClicked; if (Editor.Document is not null) { @@ -190,6 +200,35 @@ private void OnDocumentChangedForPreview (object? sender, EventArgs e) } _markdownPreview.Text = Editor.Document?.Text ?? string.Empty; + _markdownPreview.TotalSourceLines = Editor.Document?.LineCount ?? 1; + } + + private void OnEditorCaretChangedForPreview (object? sender, EventArgs e) + { + UpdatePreviewHighlight (); + } + + private void UpdatePreviewHighlight () + { + if (_markdownPreview is null || Editor.Document is null) + { + return; + } + + int sourceLine = Editor.Document.GetLineByOffset (Editor.CaretOffset).LineNumber - 1; + _markdownPreview.HighlightSourceLine = sourceLine; + } + + private void OnPreviewSourceLineClicked (object? sender, SourceLineClickedEventArgs e) + { + if (Editor.Document is null) + { + return; + } + + int lineNumber = Math.Clamp (e.SourceLine + 1, 1, Editor.Document.LineCount); + Editor.CaretOffset = Editor.Document.GetLineByNumber (lineNumber).Offset; + Editor.SetFocus (); } /// @@ -212,5 +251,7 @@ private void RefreshPreviewDocument () } _markdownPreview.Text = Editor.Document?.Text ?? string.Empty; + _markdownPreview.TotalSourceLines = Editor.Document?.LineCount ?? 1; + UpdatePreviewHighlight (); } } From dffcf8ba1b6770cae18381423234e90dbfa782f2 Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 23 May 2026 16:59:15 -0600 Subject: [PATCH 04/10] refactor(ted): move SourceLineClickedEventArgs to its own file One type per file per CLAUDE.md convention. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- examples/ted/MarkdownPreview.cs | 10 ---------- examples/ted/SourceLineClickedEventArgs.cs | 13 +++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 examples/ted/SourceLineClickedEventArgs.cs diff --git a/examples/ted/MarkdownPreview.cs b/examples/ted/MarkdownPreview.cs index ce94dc66..2777c5a5 100644 --- a/examples/ted/MarkdownPreview.cs +++ b/examples/ted/MarkdownPreview.cs @@ -176,14 +176,4 @@ protected override bool OnMouseEvent (Mouse mouse) } } -/// Event args for . -internal sealed class SourceLineClickedEventArgs : EventArgs -{ - public SourceLineClickedEventArgs (int sourceLine) - { - SourceLine = sourceLine; - } - /// Gets the estimated 0-based source line number that was clicked. - public int SourceLine { get; } -} diff --git a/examples/ted/SourceLineClickedEventArgs.cs b/examples/ted/SourceLineClickedEventArgs.cs new file mode 100644 index 00000000..89ef1edb --- /dev/null +++ b/examples/ted/SourceLineClickedEventArgs.cs @@ -0,0 +1,13 @@ +namespace Ted; + +/// Event args for . +internal sealed class SourceLineClickedEventArgs : EventArgs +{ + public SourceLineClickedEventArgs (int sourceLine) + { + SourceLine = sourceLine; + } + + /// Gets the estimated 0-based source line number that was clicked. + public int SourceLine { get; } +} From ac3839ea7171892ea26b1b8fffbfc9aecd5488dc Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 23 May 2026 17:04:42 -0600 Subject: [PATCH 05/10] Add namespace-level XML documentation for all Terminal.Gui.Editor namespaces Add NamespaceDoc.cs files to each namespace folder so that DocFX generates namespace summaries in the API reference. Documentation content is drawn from README.md descriptions. Namespaces documented: - Terminal.Gui.Editor (root, with hero.gif image) - Terminal.Gui.Editor.Completion - Terminal.Gui.Editor.Document - Terminal.Gui.Editor.Document.Folding - Terminal.Gui.Editor.Document.Search - Terminal.Gui.Editor.Document.Utils - Terminal.Gui.Editor.Highlighting - Terminal.Gui.Editor.Highlighting.Xshd - Terminal.Gui.Editor.Indentation - Terminal.Gui.Editor.Rendering Closes #230 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Completion/NamespaceDoc.cs | 14 +++++++++ .../Document/NamespaceDoc.cs | 22 +++++++++++++ .../Folding/NamespaceDoc.cs | 24 ++++++++++++++ .../Highlighting/NamespaceDoc.cs | 24 ++++++++++++++ .../Highlighting/Xshd/NamespaceDoc.cs | 24 ++++++++++++++ .../Indentation/NamespaceDoc.cs | 20 ++++++++++++ src/Terminal.Gui.Editor/NamespaceDoc.cs | 28 +++++++++++++++++ .../Rendering/NamespaceDoc.cs | 31 +++++++++++++++++++ .../Search/NamespaceDoc.cs | 24 ++++++++++++++ src/Terminal.Gui.Editor/Utils/NamespaceDoc.cs | 25 +++++++++++++++ 10 files changed, 236 insertions(+) create mode 100644 src/Terminal.Gui.Editor/Completion/NamespaceDoc.cs create mode 100644 src/Terminal.Gui.Editor/Document/NamespaceDoc.cs create mode 100644 src/Terminal.Gui.Editor/Folding/NamespaceDoc.cs create mode 100644 src/Terminal.Gui.Editor/Highlighting/NamespaceDoc.cs create mode 100644 src/Terminal.Gui.Editor/Highlighting/Xshd/NamespaceDoc.cs create mode 100644 src/Terminal.Gui.Editor/Indentation/NamespaceDoc.cs create mode 100644 src/Terminal.Gui.Editor/NamespaceDoc.cs create mode 100644 src/Terminal.Gui.Editor/Rendering/NamespaceDoc.cs create mode 100644 src/Terminal.Gui.Editor/Search/NamespaceDoc.cs create mode 100644 src/Terminal.Gui.Editor/Utils/NamespaceDoc.cs diff --git a/src/Terminal.Gui.Editor/Completion/NamespaceDoc.cs b/src/Terminal.Gui.Editor/Completion/NamespaceDoc.cs new file mode 100644 index 00000000..330023fb --- /dev/null +++ b/src/Terminal.Gui.Editor/Completion/NamespaceDoc.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace Terminal.Gui.Editor.Completion; + +/// +/// Provides the completion (auto-complete / IntelliSense-style) infrastructure for the editor. +/// Contains the interface that consumers implement to supply +/// completion candidates, and the type that describes individual suggestions. +/// +[CompilerGenerated] +internal static class NamespaceDoc; diff --git a/src/Terminal.Gui.Editor/Document/NamespaceDoc.cs b/src/Terminal.Gui.Editor/Document/NamespaceDoc.cs new file mode 100644 index 00000000..9eca431a --- /dev/null +++ b/src/Terminal.Gui.Editor/Document/NamespaceDoc.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace Terminal.Gui.Editor.Document; + +/// +/// +/// UI-framework-independent document model. This namespace contains the rope-backed +/// , , , +/// , , , and supporting types +/// that form the core data layer of the editor. +/// +/// +/// The document layer has no dependency on Terminal.Gui and can be used independently for text manipulation, +/// analysis, or testing. It is adapted from +/// AvaloniaEdit's pure-data layers. +/// +/// +[CompilerGenerated] +internal static class NamespaceDoc; diff --git a/src/Terminal.Gui.Editor/Folding/NamespaceDoc.cs b/src/Terminal.Gui.Editor/Folding/NamespaceDoc.cs new file mode 100644 index 00000000..c60632a4 --- /dev/null +++ b/src/Terminal.Gui.Editor/Folding/NamespaceDoc.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace Terminal.Gui.Editor.Document.Folding; + +/// +/// +/// Code-folding infrastructure for collapsing and expanding regions of a document. +/// +/// +/// Contains (manages fold state for a document), +/// (represents a single collapsible region), +/// (pluggable strategy interface), and built-in strategies +/// (, ). +/// +/// +/// Foldings auto-expand when the caret moves inside them. Consumers can implement custom +/// instances for language-specific folding rules. +/// +/// +[CompilerGenerated] +internal static class NamespaceDoc; diff --git a/src/Terminal.Gui.Editor/Highlighting/NamespaceDoc.cs b/src/Terminal.Gui.Editor/Highlighting/NamespaceDoc.cs new file mode 100644 index 00000000..87995edd --- /dev/null +++ b/src/Terminal.Gui.Editor/Highlighting/NamespaceDoc.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace Terminal.Gui.Editor.Highlighting; + +/// +/// +/// Syntax highlighting engine driven by xshd (XML Syntax Highlighting Definition) files. +/// +/// +/// The core types are (describes a language's highlighting rules), +/// (applies rules to a producing +/// s), and (registry of built-in and +/// user-loaded definitions, with lookup by name or file extension). +/// +/// +/// Built-in definitions include C#, C++, Java, JavaScript, Python, PowerShell, TSQL, VB, JSON, HTML, XML, +/// CSS, and Markdown. Highlight colors compose with the active Terminal.Gui color scheme. +/// +/// +[CompilerGenerated] +internal static class NamespaceDoc; diff --git a/src/Terminal.Gui.Editor/Highlighting/Xshd/NamespaceDoc.cs b/src/Terminal.Gui.Editor/Highlighting/Xshd/NamespaceDoc.cs new file mode 100644 index 00000000..cc148f9c --- /dev/null +++ b/src/Terminal.Gui.Editor/Highlighting/Xshd/NamespaceDoc.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace Terminal.Gui.Editor.Highlighting.Xshd; + +/// +/// +/// xshd (XML Syntax Highlighting Definition) file format support: loaders, savers, and AST types. +/// +/// +/// Contains (reads xshd XML into an +/// and compiles it into an ), +/// (serializes definitions back to XML), and the AST node types +/// (, , , +/// , , etc.) that represent the parsed structure. +/// +/// +/// Supports both xshd v1 and v2 formats via and . +/// +/// +[CompilerGenerated] +internal static class NamespaceDoc; diff --git a/src/Terminal.Gui.Editor/Indentation/NamespaceDoc.cs b/src/Terminal.Gui.Editor/Indentation/NamespaceDoc.cs new file mode 100644 index 00000000..2286d491 --- /dev/null +++ b/src/Terminal.Gui.Editor/Indentation/NamespaceDoc.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace Terminal.Gui.Editor.Indentation; + +/// +/// +/// Pluggable indentation strategies that control how the editor auto-indents new lines. +/// +/// +/// Contains the interface and the built-in +/// (copies the previous line's leading whitespace on Enter). +/// Consumers can implement custom strategies for language-aware indentation (e.g., increasing indent +/// after an opening brace). +/// +/// +[CompilerGenerated] +internal static class NamespaceDoc; diff --git a/src/Terminal.Gui.Editor/NamespaceDoc.cs b/src/Terminal.Gui.Editor/NamespaceDoc.cs new file mode 100644 index 00000000..8e333c4e --- /dev/null +++ b/src/Terminal.Gui.Editor/NamespaceDoc.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace Terminal.Gui.Editor; + +/// +/// +/// Terminal.Gui.Editor (ted demo app) +/// +/// +/// A reusable text-editing for Terminal.Gui. Drop it into your TUI app +/// and you get the editing experience users already expect: caret movement, selection, clipboard, undo/redo, +/// search & replace, folding, syntax highlighting, word wrap, multi-caret editing, and more. +/// +/// +/// The class is a View subclass that consumes the +/// through a cell-grid rendering pipeline +/// (, with pluggable +/// s and s). +/// +/// +/// Ships as a single NuGet package: Terminal.Gui.Editor. +/// +/// +[CompilerGenerated] +internal static class NamespaceDoc; diff --git a/src/Terminal.Gui.Editor/Rendering/NamespaceDoc.cs b/src/Terminal.Gui.Editor/Rendering/NamespaceDoc.cs new file mode 100644 index 00000000..0d786fd2 --- /dev/null +++ b/src/Terminal.Gui.Editor/Rendering/NamespaceDoc.cs @@ -0,0 +1,31 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace Terminal.Gui.Editor.Rendering; + +/// +/// +/// Cell-grid rendering pipeline that transforms document lines into visual output. +/// +/// +/// The pipeline flows: (composed of +/// s such as , , +/// , and ). +/// +/// +/// Pluggable extension points: +/// +/// — mutates element attributes (syntax highlighting, fold markers). +/// — paints cell rectangles (selection, current line, search hits). +/// — draws overlays above the text (multi-caret indicators). +/// +/// +/// +/// Visual lines are cached with LRU eviction and selectively invalidated from +/// offset/length ranges. +/// +/// +[CompilerGenerated] +internal static class NamespaceDoc; diff --git a/src/Terminal.Gui.Editor/Search/NamespaceDoc.cs b/src/Terminal.Gui.Editor/Search/NamespaceDoc.cs new file mode 100644 index 00000000..c7ca64a6 --- /dev/null +++ b/src/Terminal.Gui.Editor/Search/NamespaceDoc.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace Terminal.Gui.Editor.Document.Search; + +/// +/// +/// Pluggable search strategies for find and replace operations. +/// +/// +/// Contains (the strategy interface), built-in implementations +/// ( and normal/whole-word string search), and +/// for constructing strategies by mode and options. +/// +/// +/// Search strategies operate on and return +/// match results as offset/length pairs. The editor's find/replace UI and +/// consume these results. +/// +/// +[CompilerGenerated] +internal static class NamespaceDoc; diff --git a/src/Terminal.Gui.Editor/Utils/NamespaceDoc.cs b/src/Terminal.Gui.Editor/Utils/NamespaceDoc.cs new file mode 100644 index 00000000..27f6eb57 --- /dev/null +++ b/src/Terminal.Gui.Editor/Utils/NamespaceDoc.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace Terminal.Gui.Editor.Document.Utils; + +/// +/// +/// Shared utility types used by the document layer and other subsystems. +/// +/// +/// Includes the data structure (a balanced B-tree for efficient insert/delete in large +/// sequences), (double-ended queue), (run-length +/// compressed list), (encoding-detecting file reader), +/// (immutability pattern), and various string/text helpers. +/// +/// +/// These types are adapted from +/// AvaloniaEdit's utility layer and have no +/// dependency on Terminal.Gui. +/// +/// +[CompilerGenerated] +internal static class NamespaceDoc; From c505dab003a7e953fb9ee3e793cbe164668ffd51 Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 23 May 2026 17:06:18 -0600 Subject: [PATCH 06/10] fix(ted): use ViewportToScreen for highlight bar screen reads Fixes incorrect highlight painting when Viewport.X > 0 (horizontal scroll). ContentToScreen gave content-relative screen coords that shifted the read position; ViewportToScreen correctly maps the viewport-relative draw row to screen buffer coordinates. Also fixes CRLF line endings in SourceLineClickedEventArgs.cs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- examples/ted/MarkdownPreview.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/ted/MarkdownPreview.cs b/examples/ted/MarkdownPreview.cs index 2777c5a5..8902da72 100644 --- a/examples/ted/MarkdownPreview.cs +++ b/examples/ted/MarkdownPreview.cs @@ -135,7 +135,9 @@ private void DrawHighlightBar () return; } - Point screenOrigin = ContentToScreen (new Point (0, renderedLine)); + // Map the viewport-relative draw row to screen coordinates so we read the correct + // cells regardless of horizontal scroll position (Viewport.X). + Point screenOrigin = ViewportToScreen (new Point (0, drawRow)); var screenRow = screenOrigin.Y; var screenStartCol = screenOrigin.X; From a87dfac3fbb2fff619fd8fae7339d92465624694 Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 23 May 2026 17:13:55 -0600 Subject: [PATCH 07/10] style: fix ReSharper cleanup drift (var preference, trailing newlines) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- examples/ted/MarkdownPreview.cs | 2 -- examples/ted/TedApp.MarkdownPreview.cs | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/ted/MarkdownPreview.cs b/examples/ted/MarkdownPreview.cs index 8902da72..15db1ed7 100644 --- a/examples/ted/MarkdownPreview.cs +++ b/examples/ted/MarkdownPreview.cs @@ -177,5 +177,3 @@ protected override bool OnMouseEvent (Mouse mouse) return base.OnMouseEvent (mouse); } } - - diff --git a/examples/ted/TedApp.MarkdownPreview.cs b/examples/ted/TedApp.MarkdownPreview.cs index 31cfbfc5..bf040b59 100644 --- a/examples/ted/TedApp.MarkdownPreview.cs +++ b/examples/ted/TedApp.MarkdownPreview.cs @@ -215,7 +215,7 @@ private void UpdatePreviewHighlight () return; } - int sourceLine = Editor.Document.GetLineByOffset (Editor.CaretOffset).LineNumber - 1; + var sourceLine = Editor.Document.GetLineByOffset (Editor.CaretOffset).LineNumber - 1; _markdownPreview.HighlightSourceLine = sourceLine; } @@ -226,7 +226,7 @@ private void OnPreviewSourceLineClicked (object? sender, SourceLineClickedEventA return; } - int lineNumber = Math.Clamp (e.SourceLine + 1, 1, Editor.Document.LineCount); + var lineNumber = Math.Clamp (e.SourceLine + 1, 1, Editor.Document.LineCount); Editor.CaretOffset = Editor.Document.GetLineByNumber (lineNumber).Offset; Editor.SetFocus (); } From 2156c67b16cd0d0d731144c4abc7132058923176 Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 23 May 2026 17:30:12 -0600 Subject: [PATCH 08/10] Fix ReSharper code style: wrap long XML doc lines Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Terminal.Gui.Editor/NamespaceDoc.cs | 3 ++- src/Terminal.Gui.Editor/Rendering/NamespaceDoc.cs | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Terminal.Gui.Editor/NamespaceDoc.cs b/src/Terminal.Gui.Editor/NamespaceDoc.cs index 8e333c4e..1f56c5bf 100644 --- a/src/Terminal.Gui.Editor/NamespaceDoc.cs +++ b/src/Terminal.Gui.Editor/NamespaceDoc.cs @@ -7,7 +7,8 @@ namespace Terminal.Gui.Editor; /// /// -/// Terminal.Gui.Editor (ted demo app) +/// Terminal.Gui.Editor (ted demo app) /// /// /// A reusable text-editing for Terminal.Gui. Drop it into your TUI app diff --git a/src/Terminal.Gui.Editor/Rendering/NamespaceDoc.cs b/src/Terminal.Gui.Editor/Rendering/NamespaceDoc.cs index 0d786fd2..226daa6f 100644 --- a/src/Terminal.Gui.Editor/Rendering/NamespaceDoc.cs +++ b/src/Terminal.Gui.Editor/Rendering/NamespaceDoc.cs @@ -17,7 +17,10 @@ namespace Terminal.Gui.Editor.Rendering; /// /// Pluggable extension points: /// -/// — mutates element attributes (syntax highlighting, fold markers). +/// +/// — mutates element attributes (syntax highlighting, fold +/// markers). +/// /// — paints cell rectangles (selection, current line, search hits). /// — draws overlays above the text (multi-caret indicators). /// From 78cb85c20bd282cc5cbf463b75bed9978f6eada8 Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 24 May 2026 01:05:19 +0100 Subject: [PATCH 09/10] Fixes #235. Bug: CRLF newline requires two keypresses --- src/Terminal.Gui.Editor/Editor.Commands.cs | 50 +++++++++++++++-- src/Terminal.Gui.Editor/Editor.Selection.cs | 56 +++++++++++++++++-- .../StreamingLoadPerformanceTests.cs | 5 +- .../EditorNewlineNavigationTests.cs | 46 +++++++++++++++ 4 files changed, 148 insertions(+), 9 deletions(-) create mode 100644 tests/Terminal.Gui.Editor.Tests/EditorNewlineNavigationTests.cs diff --git a/src/Terminal.Gui.Editor/Editor.Commands.cs b/src/Terminal.Gui.Editor/Editor.Commands.cs index 1dd00cf2..03f02078 100644 --- a/src/Terminal.Gui.Editor/Editor.Commands.cs +++ b/src/Terminal.Gui.Editor/Editor.Commands.cs @@ -507,8 +507,8 @@ private void OverwriteAtOffset (int offset, string text) { var graphemeLen = GetGraphemeLengthBackward (CaretOffset); - // If at start of line (graphemeLen == 0), remove 1 code unit to join with previous line. - var removeLen = graphemeLen > 0 ? graphemeLen : 1; + // If at start of line (graphemeLen == 0), remove the full delimiter to join with previous line (CRLF counts as 2). + var removeLen = graphemeLen > 0 ? graphemeLen : GetDelimiterLengthBackwardAt (CaretOffset); _document!.Remove (CaretOffset - removeLen, removeLen); } @@ -530,14 +530,56 @@ private void OverwriteAtOffset (int offset, string text) { var graphemeLen = GetGraphemeLengthForward (CaretOffset); - // If at end of line (graphemeLen == 0), remove 1 code unit to join with next line. - var removeLen = graphemeLen > 0 ? graphemeLen : 1; + // If at end of line (graphemeLen == 0), remove the full delimiter to join with next line (CRLF counts as 2). + var removeLen = graphemeLen > 0 ? graphemeLen : GetDelimiterLengthForwardAt (CaretOffset); _document!.Remove (CaretOffset, removeLen); } return true; } + private int GetDelimiterLengthForwardAt (int offset) + { + DocumentLine line = _document!.GetLineByOffset (offset); + var delimiterStart = line.Offset + line.Length; + var delimiterLen = line.DelimiterLength; + + if (delimiterLen == 0) + { + return 1; + } + + // If already inside the delimiter (possible with older behavior), delete the remainder. + if (offset > delimiterStart && offset < delimiterStart + delimiterLen) + { + return delimiterStart + delimiterLen - offset; + } + + return delimiterLen; + } + + private int GetDelimiterLengthBackwardAt (int offset) + { + DocumentLine line = _document!.GetLineByOffset (offset); + + // If already inside this line's delimiter, delete back to the end-of-line text. + var lineStart = line.Offset; + + if (offset > lineStart + line.Length && offset <= lineStart + line.TotalLength) + { + return offset - (lineStart + line.Length); + } + + DocumentLine? previous = line.PreviousLine; + + if (previous is null) + { + return 1; + } + + return Math.Max (1, previous.DelimiterLength); + } + private bool? SetCaretAndReturnTrue (int offset) { CaretOffset = offset; diff --git a/src/Terminal.Gui.Editor/Editor.Selection.cs b/src/Terminal.Gui.Editor/Editor.Selection.cs index bbb3aef3..b88fb22c 100644 --- a/src/Terminal.Gui.Editor/Editor.Selection.cs +++ b/src/Terminal.Gui.Editor/Editor.Selection.cs @@ -106,8 +106,8 @@ private void ExtendCaretBy (int delta) ? GetGraphemeLengthForward (CaretOffset) : GetGraphemeLengthBackward (CaretOffset); - // If graphemeDelta is 0, we're at a line boundary — fall back to ±1 to cross the delimiter. - var step = graphemeDelta > 0 ? graphemeDelta : 1; + // If graphemeDelta is 0, we're at a line boundary — cross the full line delimiter (CRLF counts as 2). + var step = graphemeDelta > 0 ? graphemeDelta : GetDelimiterStep (CaretOffset, delta); var newOffset = delta > 0 ? CaretOffset + step : CaretOffset - step; ExtendCaretTo (SnapOffsetPastDelimiter (newOffset, delta)); } @@ -186,12 +186,60 @@ private void MoveCaretByCollapsingSelection (int delta) ? GetGraphemeLengthForward (CaretOffset) : GetGraphemeLengthBackward (CaretOffset); - // If graphemeDelta is 0, we're at a line boundary — fall back to ±1 to cross the delimiter. - var step = graphemeDelta > 0 ? graphemeDelta : 1; + // If graphemeDelta is 0, we're at a line boundary — cross the full line delimiter (CRLF counts as 2). + var step = graphemeDelta > 0 ? graphemeDelta : GetDelimiterStep (CaretOffset, delta); var newOffset = delta > 0 ? CaretOffset + step : CaretOffset - step; CaretOffset = SnapOffsetPastDelimiter (newOffset, delta); } + private int GetDelimiterStep (int offset, int direction) + { + if (_document is null || direction == 0) + { + return 1; + } + + offset = Math.Clamp (offset, 0, _document.TextLength); + DocumentLine line = _document.GetLineByOffset (offset); + + if (direction > 0) + { + var delimiterStart = line.Offset + line.Length; + var delimiterLen = line.DelimiterLength; + + if (delimiterLen == 0) + { + return 1; + } + + // If already inside the delimiter (possible with older behavior), advance to the next line start. + if (offset > delimiterStart && offset < delimiterStart + delimiterLen) + { + return delimiterStart + delimiterLen - offset; + } + + return delimiterLen; + } + + // direction < 0 + var lineStart = line.Offset; + + // If already inside this line's delimiter, step back to the end-of-line text. + if (offset > lineStart + line.Length && offset <= lineStart + line.TotalLength) + { + return offset - (lineStart + line.Length); + } + + DocumentLine? previous = line.PreviousLine; + + if (previous is null) + { + return 1; + } + + return Math.Max (1, previous.DelimiterLength); + } + /// /// In single-line flat mode, prevents the caret from landing inside a multi-char delimiter /// (e.g. CRLF). If is inside a delimiter, snaps forward (to the diff --git a/tests/Terminal.Gui.Editor.PerformanceTests/StreamingLoadPerformanceTests.cs b/tests/Terminal.Gui.Editor.PerformanceTests/StreamingLoadPerformanceTests.cs index e865e9ec..a484a709 100644 --- a/tests/Terminal.Gui.Editor.PerformanceTests/StreamingLoadPerformanceTests.cs +++ b/tests/Terminal.Gui.Editor.PerformanceTests/StreamingLoadPerformanceTests.cs @@ -7,7 +7,10 @@ namespace Terminal.Gui.Editor.PerformanceTests; public class StreamingLoadPerformanceTests { - private static readonly TimeSpan InitialProgressBudget = TimeSpan.FromMilliseconds (500); + private static TimeSpan InitialProgressBudget => + // Windows runners frequently show higher variance for this test due to OS/AV/IO scheduling noise. + // Keep a slightly looser budget so the test stays a regression signal without being flaky. + OperatingSystem.IsWindows () ? TimeSpan.FromMilliseconds (800) : TimeSpan.FromMilliseconds (500); [Fact] public async Task StreamingLoad_10Mb_ReportsInitialProgressWithinBudget () diff --git a/tests/Terminal.Gui.Editor.Tests/EditorNewlineNavigationTests.cs b/tests/Terminal.Gui.Editor.Tests/EditorNewlineNavigationTests.cs new file mode 100644 index 00000000..b3477f25 --- /dev/null +++ b/tests/Terminal.Gui.Editor.Tests/EditorNewlineNavigationTests.cs @@ -0,0 +1,46 @@ +using Terminal.Gui.Editor.Document; +using Terminal.Gui.Input; +using Xunit; + +namespace Terminal.Gui.Editor.Tests; + +public class EditorNewlineNavigationTests +{ + [Fact] + public void CRLF_Is_Treated_As_Single_Newline_For_Navigate_And_Delete () + { + // Use Environment.NewLine so this test exercises CRLF on Windows. + // The contract we want: one Left/Right/DeleteCharLeft/DeleteCharRight crosses/removes the whole newline, + // not half (\r then \n or \n then \r). + var newline = Environment.NewLine; + var text = "a" + newline + "b"; + + Editor editor = new () { Document = new TextDocument (text), Multiline = true }; + + // ── Navigation across newline ───────────────────────────────────── + editor.CaretOffset = 1; // after 'a' + editor.InvokeCommand (Command.Right); + Assert.Equal (1 + newline.Length, editor.CaretOffset); + + editor.InvokeCommand (Command.Left); + Assert.Equal (1, editor.CaretOffset); + + // ── Backspace removes the whole newline ─────────────────────────── + editor.Document.Text = text; + editor.CaretOffset = 1 + newline.Length; // start of 'b' + + editor.InvokeCommand (Command.DeleteCharLeft); + + Assert.Equal ("ab", editor.Document.Text); + Assert.Equal (1, editor.CaretOffset); + + // ── Delete forward removes the whole newline ────────────────────── + editor.Document.Text = text; + editor.CaretOffset = 1; // after 'a' + + editor.InvokeCommand (Command.DeleteCharRight); + + Assert.Equal ("ab", editor.Document.Text); + Assert.Equal (1, editor.CaretOffset); + } +} From 2484e2029432234e075d7ff42704ae5e4569c86a Mon Sep 17 00:00:00 2001 From: Tig Date: Sun, 24 May 2026 13:10:19 -0600 Subject: [PATCH 10/10] style: fix ReSharper cleanup alignment in NamespaceDoc.cs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Terminal.Gui.Editor/NamespaceDoc.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Terminal.Gui.Editor/NamespaceDoc.cs b/src/Terminal.Gui.Editor/NamespaceDoc.cs index 1f56c5bf..b6901b62 100644 --- a/src/Terminal.Gui.Editor/NamespaceDoc.cs +++ b/src/Terminal.Gui.Editor/NamespaceDoc.cs @@ -8,7 +8,7 @@ namespace Terminal.Gui.Editor; /// /// /// Terminal.Gui.Editor (ted demo app) +/// alt="Terminal.Gui.Editor (ted demo app)" /> /// /// /// A reusable text-editing for Terminal.Gui. Drop it into your TUI app