From 4df6574656bb2ad5b0043aaf1346b8c84b844c91 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 13 Feb 2026 17:34:18 +0800 Subject: [PATCH] refactor: new way to update caret column Signed-off-by: leo --- src/Views/CommitMessageToolBox.axaml.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Views/CommitMessageToolBox.axaml.cs b/src/Views/CommitMessageToolBox.axaml.cs index 5b2ae629..75850d22 100644 --- a/src/Views/CommitMessageToolBox.axaml.cs +++ b/src/Views/CommitMessageToolBox.axaml.cs @@ -309,7 +309,7 @@ namespace SourceGit.Views if (_completionWnd == null) { _completionWnd = new CompletionWindow(TextArea); - _completionWnd.Closed += (_, __) => _completionWnd = null; + _completionWnd.Closed += (_, _) => _completionWnd = null; _completionWnd.Show(); } @@ -373,8 +373,7 @@ namespace SourceGit.Views private void OnCaretPositionChanged(object sender, EventArgs e) { - var line = TextArea.Document.GetLineByOffset(CaretOffset); - var col = line != null ? (CaretOffset - line.Offset + 1) : 1; + var col = TextArea.Caret.Column; SetCurrentValue(ColumnProperty, col); }