66#include " PythonHandler.h"
77#include " ProcessExecute.h"
88#include " PluginInterface.h"
9+ #include " ScintillaWrapper.h"
910#include " Notepad_plus_msgs.h"
1011#include " PythonScript/NppPythonScript.h"
1112
@@ -20,9 +21,11 @@ using namespace NppPythonScript;
2021PythonConsole::PythonConsole (HWND hNotepad) :
2122 PyProducerConsumer<const char *>(),
2223 m_consumerStarted(false ),
23- m_hNotepad(hNotepad)
24+ m_hNotepad(hNotepad),
25+ mp_scintillaWrapper(NULL )
2426{
2527 mp_consoleDlg = new ConsoleDialog ();
28+
2629 m_statementRunning = CreateEvent (NULL , FALSE , TRUE , NULL );
2730
2831}
@@ -37,6 +40,7 @@ void PythonConsole::init(HINSTANCE hInst, NppData nppData)
3740{
3841 mp_consoleDlg->init (hInst, nppData, this );
3942 m_nppData = nppData;
43+ mp_scintillaWrapper.setHandle (mp_consoleDlg->getScintillaHwnd ());
4044
4145}
4246
@@ -226,8 +230,8 @@ void export_console()
226230 .def (" hide" , &PythonConsole::hideDialog, " Hides the console" )
227231 .def (" run" , &PythonConsole::runCommand, " Runs a command on the console" )
228232 .def (" run" , &PythonConsole::runCommandNoStderr, " Runs a command on the console" )
229- .def (" run" , &PythonConsole::runCommandNoStdout, " Runs a command on the console" );
230-
233+ .def (" run" , &PythonConsole::runCommandNoStdout, " Runs a command on the console" )
234+ . def_readonly ( " editor " , &PythonConsole::mp_scintillaWrapper, " Gets an Editor object for the console window " );
231235
232236}
233237
0 commit comments