| 1520 | } |
| 1521 | |
| 1522 | void DebuggerPlugin::onRegisterDocument( TextDocument* doc ) { |
| 1523 | registerCommands( doc ); |
| 1524 | |
| 1525 | doc->setCommand( "debugger-breakpoint-toggle", [doc, this] { |
| 1526 | if ( setBreakpoint( doc, doc->getSelection().start().line() + 1 ) ) |
| 1527 | getUISceneNode()->getRoot()->invalidateDraw(); |
| 1528 | } ); |
| 1529 | |
| 1530 | doc->setCommand( "debugger-breakpoint-enable-toggle", [this, doc] { |
| 1531 | if ( breakpointToggleEnabled( doc, doc->getSelection().start().line() + 1 ) ) |
| 1532 | getUISceneNode()->getRoot()->invalidateDraw(); |
| 1533 | } ); |
| 1534 | |
| 1535 | Lock l( mClientsMutex ); |
| 1536 | mClients[doc] = std::make_unique<DebuggerPluginClient>( this, doc ); |
| 1537 | doc->registerClient( mClients[doc].get() ); |
| 1538 | } |
| 1539 | |
| 1540 | void DebuggerPlugin::onUnregisterDocument( TextDocument* doc ) { |
| 1541 | Lock l( mClientsMutex ); |
nothing calls this directly
no test coverage detected