From 49e5a17377bad383f6855f21cefa8e6a73b33022 Mon Sep 17 00:00:00 2001 From: Anklebitter Date: Fri, 7 Oct 2022 16:05:36 -0700 Subject: [PATCH] Enhance "Go To" dialog: update line/position data dynamically Fix #12284, close #12302 --- PowerEditor/src/Notepad_plus.cpp | 5 +++++ PowerEditor/src/ScintillaComponent/GoToLineDlg.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 946906295..414fe33f4 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3873,6 +3873,11 @@ void Notepad_plus::updateStatusBar() _statusBar.setText(strLnColSel, STATUSBAR_CUR_POS); _statusBar.setText(_pEditView->execute(SCI_GETOVERTYPE) ? TEXT("OVR") : TEXT("INS"), STATUSBAR_TYPING_MODE); + + if (_goToLineDlg.isCreated() && _goToLineDlg.isVisible()) + { + _goToLineDlg.updateLinesNumbers(); + } } void Notepad_plus::dropFiles(HDROP hdrop) diff --git a/PowerEditor/src/ScintillaComponent/GoToLineDlg.h b/PowerEditor/src/ScintillaComponent/GoToLineDlg.h index 1a93f8ade..1d6847a79 100644 --- a/PowerEditor/src/ScintillaComponent/GoToLineDlg.h +++ b/PowerEditor/src/ScintillaComponent/GoToLineDlg.h @@ -46,6 +46,8 @@ public : if (toShow) ::SetFocus(::GetDlgItem(_hSelf, ID_GOLINE_EDIT)); }; + + void updateLinesNumbers() const; protected : enum mode {go2line, go2offsset}; @@ -55,8 +57,6 @@ protected : private : ScintillaEditView **_ppEditView = nullptr; - void updateLinesNumbers() const; - void cleanLineEdit() const { ::SetDlgItemText(_hSelf, ID_GOLINE_EDIT, TEXT("")); };