Skip to content

Commit d0b420e

Browse files
committed
How to obtain NPP bookmark ID #258
added getBookMarkID
1 parent 7bbc09d commit d0b420e

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

PythonScript/src/NotepadPlusWrapper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,12 @@ boost::python::str NotepadPlusWrapper::getSettingsOnCloudPath()
475475
return boost::python::str(const_cast<const char *>(WcharMbcsConverter::tchar2char(result).get()));
476476
}
477477

478+
479+
intptr_t NotepadPlusWrapper::getBookMarkID()
480+
{
481+
return callNotepad(NPPM_GETBOOKMARKID, 0, 0);
482+
}
483+
478484
void NotepadPlusWrapper::menuCommand(int commandID)
479485
{
480486
callNotepad(NPPM_MENUCOMMAND, 0, commandID);

PythonScript/src/NotepadPlusWrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,8 @@ class NotepadPlusWrapper
687687

688688
boost::python::str getSettingsOnCloudPath();
689689

690+
intptr_t getBookMarkID();
691+
690692
void menuCommand(int commandID);
691693

692694
boost::python::tuple getVersion();

PythonScript/src/NotepadPython.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ void export_notepad()
4545
.def("getPluginConfigDir", &NotepadPlusWrapper::getPluginConfigDir, "Gets the plugin config directory")
4646
.def("getPluginHomePath", &NotepadPlusWrapper::getPluginHomePath, "Gets the plugin home directory path")
4747
.def("getSettingsOnCloudPath", &NotepadPlusWrapper::getSettingsOnCloudPath, "Gets the settings on cloud path")
48+
.def("getBookMarkID", &NotepadPlusWrapper::getBookMarkID, "Get the bookmark ID")
4849
.def("menuCommand", &NotepadPlusWrapper::menuCommand, boost::python::args("commandID"), "Runs a Notepad++ menu command - just pass the commandID (from the nativeLang file, or a MENUCOMMAND constant)")
4950
.def("getVersion", &NotepadPlusWrapper::getVersion, "Gets the Notepad++ version as a tuple - e.g. 5.6.8 becomes (5,6,8)")
5051
.def("hideTabBar", &NotepadPlusWrapper::hideTabBar, "Hides the Tab bar")

0 commit comments

Comments
 (0)