refactor: new way to update caret column

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2026-02-13 17:34:18 +08:00
parent 8322c436f0
commit 4df6574656

View File

@@ -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);
}