@@ -66,7 +66,7 @@ BOOL ConsoleDialog::run_dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
6666 MoveWindow (m_hInput, 30 , HIWORD (lParam)-30 , LOWORD (lParam) - 85 , 25 , TRUE );
6767 MoveWindow (::GetDlgItem (_hSelf, IDC_RUN), LOWORD (lParam) - 50 , HIWORD (lParam) - 30 , 50 , 25 , TRUE );
6868 // ::SendMessage(m_scintilla, WM_SIZE, 0, MAKEWORD(LOWORD(lParam) - 10, HIWORD(lParam) - 30));
69- return TRUE ;
69+ return FALSE ;
7070
7171 case WM_COMMAND:
7272 if (LOWORD (wParam) == IDC_RUN)
@@ -80,8 +80,10 @@ BOOL ConsoleDialog::run_dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
8080 m_console->stopStatement ();
8181 }
8282 // MessageBox(NULL, _T("Command") , _T("Python Command"), 0);
83- return TRUE ;
83+ return FALSE ;
8484 }
85+ break ;
86+
8587 case WM_NOTIFY:
8688 {
8789 LPNMHDR nmhdr = reinterpret_cast <LPNMHDR>(lParam);
@@ -98,13 +100,15 @@ BOOL ConsoleDialog::run_dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
98100 return FALSE ;
99101 }
100102 }
101- return TRUE ;
103+ break ;
102104 }
103105 default :
104- return DockingDlgInterface::run_dlgProc (message, wParam, lParam) ;
106+ break ;
105107
106108 }
107109
110+ return DockingDlgInterface::run_dlgProc (message, wParam, lParam);
111+
108112}
109113
110114
@@ -433,10 +437,14 @@ void ConsoleDialog::onStyleNeeded(SCNotification* notification)
433437 {
434438 int startPos = callScintilla (SCI_POSITIONFROMLINE, lineNumber);
435439
436- callScintilla (SCI_STARTSTYLING, startPos + lineDetails.filenameStart , 0x02 );
437- callScintilla (SCI_SETSTYLING, lineDetails.filenameEnd - lineDetails.filenameStart , 0x02 );
438- callScintilla (SCI_STARTSTYLING, startPos + lineDetails.filenameEnd , 0x02 );
439- callScintilla (SCI_SETSTYLING, lineDetails.lineLength - lineDetails.filenameEnd , 0x00 );
440+ // Check that it's not just a file called '<console>'
441+ if (strncmp (lineDetails.line + lineDetails.filenameStart , " <console>" , lineDetails.filenameEnd - lineDetails.filenameStart ))
442+ {
443+ callScintilla (SCI_STARTSTYLING, startPos + lineDetails.filenameStart , 0x02 );
444+ callScintilla (SCI_SETSTYLING, lineDetails.filenameEnd - lineDetails.filenameStart , 0x02 );
445+ callScintilla (SCI_STARTSTYLING, startPos + lineDetails.filenameEnd , 0x02 );
446+ callScintilla (SCI_SETSTYLING, lineDetails.lineLength - lineDetails.filenameEnd , 0x00 );
447+ }
440448 }
441449
442450 delete[] lineDetails.line ;
@@ -580,7 +588,7 @@ bool ConsoleDialog::parsePythonErrorLine(LineDetails *lineDetails)
580588 }
581589 else
582590 {
583- lineDetails->filenameEnd = pos;
591+ lineDetails->filenameEnd = pos;
584592 retVal = true ;
585593 styleState = SS_EXPECTLINE;
586594 }
0 commit comments