Skip to content

Commit daad094

Browse files
committed
Bugfix with Console.editor
This used to be a normal member variable, but is now a pointer. This affected the way boost::python converted the ScintillaWrapper class. Now defined differently, with a getter method.
1 parent 9a86e5b commit daad094

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

PythonScript/src/PythonConsole.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ void export_console()
290290
.def("run", &PythonConsole::runCommand, "Runs a command on the console")
291291
.def("run", &PythonConsole::runCommandNoStderr, "Runs a command on the console")
292292
.def("run", &PythonConsole::runCommandNoStdout, "Runs a command on the console")
293-
.def_readonly("editor", &PythonConsole::mp_scintillaWrapper, "Gets an Editor object for the console window");
293+
.add_property("editor", boost::python::make_function(&PythonConsole::getScintillaWrapper, boost::python::return_internal_reference<>()));
294294
//lint +e1793
295295
}
296296

PythonScript/src/PythonConsole.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class PythonConsole : public NppPythonScript::PyProducerConsumer<std::string>, p
6363

6464
HWND getScintillaHwnd();
6565

66+
ScintillaWrapper& getScintillaWrapper() { return *mp_scintillaWrapper; }
6667

6768
ScintillaWrapper* mp_scintillaWrapper;
6869
protected:

0 commit comments

Comments
 (0)