Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions PythonScript/src/ConsoleDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ INT_PTR CALLBACK ConsoleDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM
//MessageBox(NULL, _T("Command") , _T("Python Command"), 0);
return FALSE;
}
else if (LOWORD(wParam) == IDCANCEL)
{
::SetFocus(getCurrScintilla());
return FALSE;
}
break;

case WM_SETFOCUS:
Expand Down
7 changes: 7 additions & 0 deletions PythonScript/src/PythonScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,3 +718,10 @@ static void previousScript()
runScript(g_previousScript.c_str(), false);
previousScript_clicked = false;
}

HWND getCurrScintilla()
{
int which = -1;
::SendMessage( nppData._nppHandle, NPPM_GETCURRENTSCINTILLA, 0, ( LPARAM )&which );
return ( which == 0 ) ? nppData._scintillaMainHandle : nppData._scintillaSecondHandle;
}
4 changes: 4 additions & 0 deletions PythonScript/src/PythonScript.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@
// The first scintilla notification - this is 2000
#define SCN_FIRST_NOTIFICATION SCN_STYLENEEDED

#include <windows.h>

HWND getCurrScintilla();

#endif