You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Editor callback function does not get cleared if used as bound method in a class bruderstein#153
- replaced the implementation of ScintillaWrapper with the one from NotepadPlusWrapper
- fixed issue by usage of boost::python::object instead of PyObject*
- fixed NotepadPlusWrapper::clearCallbackFunction()
- added parameter annotation in ScintillaPython.cpp
.def("write", &ScintillaWrapper::AddText, "Add text to the document at current position (alias for addText).")
32
-
.def("callbackSync", &ScintillaWrapper::addSyncCallback, "Registers a callback to a Python function when a Scintilla event occurs. See also callback() to register an asynchronous callback. Callbacks are called synchronously with the event, so try not to perform too much work in the event handler.\nCertain operations cannot be performed in a synchronous callback. setDocPointer, searchInTarget or findText calls are examples. Scintilla doesn't allow recursively modifying the text, so you can't modify the text in a SCINTILLANOTIFICATION.MODIFIED callback - use a standard Asynchronous callback to do this.\ne.g. editor.callbackSync(my_function, [SCINTILLANOTIFICATION.CHARADDED])")
33
-
.def("callback", &ScintillaWrapper::addAsyncCallback, "Registers a callback to call a Python function synchronously when a Scintilla event occurs. Events are queued up, and run in the order they arrive, one after the other, but asynchronously with the main GUI. See editor.callbackSync() to register a synchronous callback. e.g. editor.callback(my_function, [SCINTILLANOTIFICATION.CHARADDED])")
32
+
.def("callbackSync", &ScintillaWrapper::addSyncCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback to a Python function when a Scintilla event occurs. See also callback() to register an asynchronous callback. Callbacks are called synchronously with the event, so try not to perform too much work in the event handler.\nCertain operations cannot be performed in a synchronous callback. setDocPointer, searchInTarget or findText calls are examples. Scintilla doesn't allow recursively modifying the text, so you can't modify the text in a SCINTILLANOTIFICATION.MODIFIED callback - use a standard Asynchronous callback to do this.\ne.g. editor.callbackSync(my_function, [SCINTILLANOTIFICATION.CHARADDED])")
33
+
.def("callback", &ScintillaWrapper::addAsyncCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback to call a Python function synchronously when a Scintilla event occurs. Events are queued up, and run in the order they arrive, one after the other, but asynchronously with the main GUI. See editor.callbackSync() to register a synchronous callback. e.g. editor.callback(my_function, [SCINTILLANOTIFICATION.CHARADDED])")
34
34
.def("__getitem__", &ScintillaWrapper::GetLine, "Gets a line from the given (zero based) index")
35
35
.def("__len__", &ScintillaWrapper::GetLength, "Gets the length (number of bytes) in the document")
36
36
.def("forEachLine", &ScintillaWrapper::forEachLine, "Runs the function passed for each line in the current document. The function gets passed 3 arguments, the contents of the line, the line number (starting from zero), and the total number of lines. If the function returns a number, that number is added to the current line number for the next iteration.\nThat way, if you delete the current line, you should return 0, so as to stay on the current physical line.\n\nUnder normal circumstances, you do not need to return anything from the function (i.e. None)\n(Helper function)")
@@ -41,9 +41,9 @@ BOOST_PYTHON_MODULE(Npp)
41
41
.def("getUserLineSelection", &ScintillaWrapper::getUserLineSelection, "Gets the start and end (zero indexed) line numbers of the user selection, or the whole document if nothing is selected. (Helper function)")
42
42
.def("getUserCharSelection", &ScintillaWrapper::getUserCharSelection, "Gets the start and end (zero indexed) byte numbers of the user selection, or the whole document if nothing is selected. (Helper function)")
43
43
.def("clearCallbacks", &ScintillaWrapper::clearAllCallbacks, "Clears all callbacks")
44
-
.def("clearCallbacks", &ScintillaWrapper::clearCallbackFunction, "Clears all callbacks for a given function")
45
-
.def("clearCallbacks", &ScintillaWrapper::clearCallbackEvents, "Clears all callbacks for the given list of events")
46
-
.def("clearCallbacks", &ScintillaWrapper::clearCallback, "Clears the callback for the given callback function for the list of events")
44
+
.def("clearCallbacks", &ScintillaWrapper::clearCallbackFunction, boost::python::args("callable"), "Clears all callbacks for a given function")
45
+
.def("clearCallbacks", &ScintillaWrapper::clearCallbackEvents, boost::python::args("notificationList"), "Clears all callbacks for the given list of events")
46
+
.def("clearCallbacks", &ScintillaWrapper::clearCallback, boost::python::args("callable", "notificationList"), "Clears the callback for the given callback function for the list of events")
47
47
.def("flash", &ScintillaWrapper::flash, "Flash the editor by reversing the foreground and background colours briefly")
48
48
.def("flash", &ScintillaWrapper::flashMilliseconds, boost::python::args("milliseconds"), "Flash the editor by reversing the foreground and background colours briefly")
0 commit comments