Skip to content

Commit 2b89775

Browse files
authored
Merge pull request #62 from ClaudiaFrank/feature_56
provides feature request 56 functionality
2 parents cec4d36 + 7a9fa32 commit 2b89775

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

PythonScript/src/NotepadPlusWrapper.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,13 @@ void NotepadPlusWrapper::disableAutoUpdate()
10791079
callNotepad(NPPM_DISABLEAUTOUPDATE, 0, 0);
10801080
}
10811081

1082+
bool NotepadPlusWrapper::isSingleView()
1083+
{
1084+
HWND splitter_hwnd = FindWindowEx(m_nppHandle, NULL, L"splitterContainer", NULL);
1085+
return !IsWindowVisible(splitter_hwnd);
1086+
}
1087+
1088+
10821089
void NotepadPlusWrapper::notAllowedInScintillaCallback(const char *message)
10831090
{
10841091
DWORD currentThreadID = ::GetCurrentThreadId();

PythonScript/src/NotepadPlusWrapper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ class NotepadPlusWrapper
739739

740740
boost::python::str getPluginVersion();
741741

742+
bool isSingleView();
742743

743744
protected:
744745
LRESULT callNotepad(UINT message, WPARAM wParam = 0, LPARAM lParam = 0)

PythonScript/src/NotepadPython.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ void export_notepad()
5656
.def("getEncoding", &NotepadPlusWrapper::getEncoding, "Gets the encoding of the current buffer. Pass a buffer ID to get the encoding of a specific buffer.")
5757
.def("getEncoding", &NotepadPlusWrapper::getBufferEncoding, "Gets the encoding of the current buffer. Pass a buffer ID to get the encoding of a specific buffer.")
5858
.def("setEncoding", &NotepadPlusWrapper::setEncoding, boost::python::args("encoding"), "Sets the encoding of the current buffer. Use the BUFFERENCODING constants")
59-
.def("setEncoding", &NotepadPlusWrapper::setBufferEncoding, boost::python::args("encoding", "bufferID"), "Sets the encoding of the given bufferID. Use the BUFFERENCODING constants to specify the encoding")
59+
.def("setEncoding", &NotepadPlusWrapper::setBufferEncoding, boost::python::args("encoding", "bufferID"), "Sets the encoding of the given bufferID. Use the BUFFERENCODING constants to specify the encoding")
6060
.def("getFormatType", &NotepadPlusWrapper::getFormatType, "Gets the format type (i.e. Windows, Unix or Mac) of the current buffer. Pass a buffer ID to get the format type of a specific buffer.")
6161
.def("getFormatType", &NotepadPlusWrapper::getBufferFormatType, boost::python::args("bufferID"), "Gets the format type (i.e. Windows, Unix or Mac) of the given bufferID")
62-
.def("setFormatType", &NotepadPlusWrapper::setFormatType, boost::python::args("formatType"),"Sets the format type (i.e. Windows, Unix or Mac) of the current buffer - use the FORMATTYPE enum.")
62+
.def("setFormatType", &NotepadPlusWrapper::setFormatType, boost::python::args("formatType"), "Sets the format type (i.e. Windows, Unix or Mac) of the current buffer - use the FORMATTYPE enum.")
6363
.def("setFormatType", &NotepadPlusWrapper::setBufferFormatType, boost::python::args("formatType", "bufferID"), "Sets the format type (i.e. Windows, Unix or Mac) of the given buffer - use the FORMATTYPE enum.")
6464
.def("callback", &NotepadPlusWrapper::addCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback function for a notification. Arguments are (function, [list of NOTIFICATION IDs])")
6565
.def("activateFile", &NotepadPlusWrapper::activateFileString, boost::python::args("filename"), "Activates the document with the given filename")
@@ -90,7 +90,7 @@ void export_notepad()
9090
.def("allocateMarker", &NotepadPlusWrapper::allocateMarker, "allocateMarker(numberRequested) -> int\nAllocates a marker number for Scintilla. Use this to stop marker number collisions with other plugins / scripts.")
9191
.def("getPluginVersion", &NotepadPlusWrapper::getPluginVersion, "getPluginVersion() -> str\nGets the version number of the PythonScript plugin, in the format '0.9.0.1'")
9292
.def("outputDebugString", &NotepadPlusWrapper::outputDebugString, "Outputs a debug string using the Windows OutputDebugString API call - used primarily for debugging PythonScript itself")
93-
93+
9494
.def("getMenuHandle", &NotepadPlusWrapper::getMenuHandle, boost::python::args("menu"), "Gets the handle for the main or plugins menu.")
9595
.def("isTabBarHidden", &NotepadPlusWrapper::isTabBarHidden, "Returns True if tabbar is hidden else False")
9696
.def("hideToolBar", &NotepadPlusWrapper::hideToolBar, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown")
@@ -119,8 +119,8 @@ void export_notepad()
119119
.def("makeCurrentBufferDirty", &NotepadPlusWrapper::makeCurrentBufferDirty, "Makes current document dirty")
120120
.def("getEnableThemeTextureFunc", &NotepadPlusWrapper::getEnableThemeTextureFunc, "TODO")
121121
.def("triggerTabbarContextMenu", &NotepadPlusWrapper::triggerTabbarContextMenu, boost::python::args("view, index2Activate"), "Activates the context menu for provided view and tab index")
122-
.def("disableAutoUpdate", &NotepadPlusWrapper::disableAutoUpdate, "Disables notepad++ auto update functionality");
123-
122+
.def("disableAutoUpdate", &NotepadPlusWrapper::disableAutoUpdate, "Disables notepad++ auto update functionality")
123+
.def("isSingleView", &NotepadPlusWrapper::isSingleView, "True if only one view is used, False otherwise");
124124

125125
boost::python::enum_<LangType>("LANGTYPE")
126126
.value("TXT", L_TEXT)

0 commit comments

Comments
 (0)