From 26c300852577c6cc22a91d21a1c92540a7e6025a Mon Sep 17 00:00:00 2001 From: Don Ho Date: Mon, 13 Jan 2025 09:54:16 +0100 Subject: [PATCH] Make current line/position copiable in Go to line dialog Fix #15950 --- PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h | 4 ++-- PowerEditor/src/Notepad_plus.rc | 5 ++++- PowerEditor/src/ScintillaComponent/GoToLineDlg.cpp | 2 +- PowerEditor/src/resource.h | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index ee1e6a333..4eb990ff8 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -111,7 +111,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // return value: The number of files in XML session file #define NPPM_GETSESSIONFILES (NPPMSG + 14) - // NPPM_GETSESSIONFILES (wchar_t** sessionFileArray, wchar_t* sessionFileName) + // BOOL NPPM_GETSESSIONFILES (wchar_t** sessionFileArray, wchar_t* sessionFileName) // the files' full path name from a session file. // wParam[out]: sessionFileArray is the array in which the files' full path of the same group are written. To allocate the array with the proper size, send message NPPM_GETNBSESSIONFILES. // lParam[in]: sessionFileName is XML session full path @@ -974,7 +974,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Note: there's no symetric command NPPM_SETTABCOLORID. Plugins can use NPPM_MENUCOMMAND to set current tab color with the desired tab color ID. #define NPPM_SETUNTITLEDNAME (NPPMSG + 115) - // int NPPM_SETUNTITLEDNAME(BufferID id, const wchar_t* newName) + // BOOL NPPM_SETUNTITLEDNAME(BufferID id, const wchar_t* newName) // Rename the tab name for an untitled tab. // wParam[in]: id - BufferID of the tab. -1 for currently active tab // lParam[in]: newName - the desired new name of the tab diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index 9bebd32aa..79abde309 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -1431,7 +1431,10 @@ BEGIN CONTROL "&Line",IDC_RADIO_GOTOLINE,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,8,5,80,10 CONTROL "&Offset",IDC_RADIO_GOTOOFFSET,"Button",BS_AUTORADIOBUTTON,98,5,80,10 LTEXT "You are here:",ID_URHERE_STATIC,8,25,95,8 - LTEXT "0123456789",ID_CURRLINE,106,25,45,8 + + //LTEXT "0123456789",ID_CURRLINE,106,25,45,8 + EDITTEXT ID_CURRLINE_EDIT,104,24,71,12,ES_NUMBER | ES_READONLY + LTEXT "You want to &go to:",ID_UGO_STATIC,8,40,95,8 EDITTEXT ID_GOLINE_EDIT,104,38,71,12,ES_NUMBER LTEXT "You can't go further than:",ID_NOMORETHAN_STATIC,8,55,95,8 diff --git a/PowerEditor/src/ScintillaComponent/GoToLineDlg.cpp b/PowerEditor/src/ScintillaComponent/GoToLineDlg.cpp index 2a8b7a27c..24ed1502e 100644 --- a/PowerEditor/src/ScintillaComponent/GoToLineDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/GoToLineDlg.cpp @@ -171,6 +171,6 @@ void GoToLineDlg::updateLinesNumbers() const limit = (currentDocLength > 0 ? currentDocLength - 1 : 0); } - ::SetDlgItemTextA(_hSelf, ID_CURRLINE, std::to_string(current).c_str()); + ::SetDlgItemTextA(_hSelf, ID_CURRLINE_EDIT, std::to_string(current).c_str()); ::SetDlgItemTextA(_hSelf, ID_LASTLINE, std::to_string(limit).c_str()); } diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index 5b044c9b5..b0f57fe07 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -558,7 +558,7 @@ #define IDD_GOLINE 2000 #define ID_GOLINE_EDIT (IDD_GOLINE + 1) -#define ID_CURRLINE (IDD_GOLINE + 2) +#define ID_CURRLINE_EDIT (IDD_GOLINE + 2) #define ID_LASTLINE (IDD_GOLINE + 3) #define ID_URHERE_STATIC (IDD_GOLINE + 4) #define ID_UGO_STATIC (IDD_GOLINE + 5)