void cbDebuggerPlugin::OnEditorOpened(CodeBlocksEvent& event) { // when an editor opens, look if we have breakpoints for it // and notify it... EditorBase* ed = event.GetEditor(); if (ed) { ed->RefreshBreakpointMarkers(); if (IsRunning()) { wxString filename; int line; GetCurrentPosition(filename, line); wxFileName edFileName(ed->GetFilename()); edFileName.Normalize(); wxFileName dbgFileName(filename); dbgFileName.Normalize(); if (dbgFileName.GetFullPath().IsSameAs(edFileName.GetFullPath()) && line != -1) { ed->SetDebugLine(line - 1); } } } event.Skip(); // must do }
inline void RefreshBreakpoints(cb_unused const cbDebuggerPlugin* plugin) { EditorManager *editorManager = Manager::Get()->GetEditorManager(); int count = editorManager->GetEditorsCount(); for (int ii = 0; ii < count; ++ii) { EditorBase *editor = editorManager->GetEditor(ii); if (!editor->IsBuiltinEditor()) continue; editor->RefreshBreakpointMarkers(); } }