Skip to content

Commit

Permalink
How to obtain NPP bookmark ID #258
Browse files Browse the repository at this point in the history
added getBookMarkID
  • Loading branch information
chcg committed Nov 20, 2022
1 parent 7bbc09d commit d0b420e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions PythonScript/src/NotepadPlusWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,12 @@ boost::python::str NotepadPlusWrapper::getSettingsOnCloudPath()
return boost::python::str(const_cast<const char *>(WcharMbcsConverter::tchar2char(result).get()));
}


intptr_t NotepadPlusWrapper::getBookMarkID()
{
return callNotepad(NPPM_GETBOOKMARKID, 0, 0);
}

void NotepadPlusWrapper::menuCommand(int commandID)
{
callNotepad(NPPM_MENUCOMMAND, 0, commandID);
Expand Down
2 changes: 2 additions & 0 deletions PythonScript/src/NotepadPlusWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ class NotepadPlusWrapper

boost::python::str getSettingsOnCloudPath();

intptr_t getBookMarkID();

void menuCommand(int commandID);

boost::python::tuple getVersion();
Expand Down
1 change: 1 addition & 0 deletions PythonScript/src/NotepadPython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void export_notepad()
.def("getPluginConfigDir", &NotepadPlusWrapper::getPluginConfigDir, "Gets the plugin config directory")
.def("getPluginHomePath", &NotepadPlusWrapper::getPluginHomePath, "Gets the plugin home directory path")
.def("getSettingsOnCloudPath", &NotepadPlusWrapper::getSettingsOnCloudPath, "Gets the settings on cloud path")
.def("getBookMarkID", &NotepadPlusWrapper::getBookMarkID, "Get the bookmark ID")
.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)")
.def("getVersion", &NotepadPlusWrapper::getVersion, "Gets the Notepad++ version as a tuple - e.g. 5.6.8 becomes (5,6,8)")
.def("hideTabBar", &NotepadPlusWrapper::hideTabBar, "Hides the Tab bar")
Expand Down

0 comments on commit d0b420e

Please sign in to comment.