From 33b4abab4bebc674026680eea277f2dc11b59606 Mon Sep 17 00:00:00 2001 From: BDisp Date: Wed, 12 Jul 2023 16:45:40 +0100 Subject: [PATCH] Fixes #2739. UICatalog Text Editor Column / Row not be updated when cursor moving. (#2741) --- UICatalog/Scenarios/Editor.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/UICatalog/Scenarios/Editor.cs b/UICatalog/Scenarios/Editor.cs index cae88a11b..20552e119 100644 --- a/UICatalog/Scenarios/Editor.cs +++ b/UICatalog/Scenarios/Editor.cs @@ -60,12 +60,6 @@ namespace UICatalog.Scenarios { CreateDemoFile (_fileName); - var siCursorPosition = new StatusItem (Key.Null, "", null); - - _textView.UnwrappedCursorPosition += (s, e) => { - siCursorPosition.Title = $"Ln {e.Point.Y + 1}, Col {e.Point.X + 1}"; - }; - LoadFile (); Win.Add (_textView); @@ -119,6 +113,8 @@ namespace UICatalog.Scenarios { Application.Top.Add (menu); + var siCursorPosition = new StatusItem (Key.Null, "", null); + var statusBar = new StatusBar (new StatusItem [] { siCursorPosition, new StatusItem(Key.F2, "~F2~ Open", () => Open()), @@ -127,6 +123,12 @@ namespace UICatalog.Scenarios { new StatusItem(Application.QuitKey, $"{Application.QuitKey} to Quit", () => Quit()), new StatusItem(Key.Null, $"OS Clipboard IsSupported : {Clipboard.IsSupported}", null) }); + + _textView.UnwrappedCursorPosition += (s, e) => { + siCursorPosition.Title = $"Ln {e.Point.Y + 1}, Col {e.Point.X + 1}"; + statusBar.SetNeedsDisplay (); + }; + Application.Top.Add (statusBar); _scrollBar = new ScrollBarView (_textView, true);