MCPcopy Create free account
hub / github.com/christophhart/HISE / handleBreakpointClick

Method handleBreakpointClick

hi_scripting/scripting/ScriptProcessor.cpp:1091–1116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1089}
1090
1091void JavascriptProcessor::handleBreakpointClick(const Identifier& codeFile, CodeEditorComponent& ed, const MouseEvent& e)
1092{
1093#if ENABLE_SCRIPTING_BREAKPOINTS
1094 if (e.mods.isShiftDown())
1095 {
1096 removeAllBreakpoints();
1097 ed.repaint();
1098 }
1099 else if (e.mods.isCommandDown())
1100 {
1101 int lineNumber = e.y / ed.getLineHeight() + ed.getFirstLineOnScreen();
1102 CodeDocument::Position start(ed.getDocument(), lineNumber, 0);
1103
1104 int charNumber = start.getPosition();
1105
1106 const String content = ed.getDocument().getAllContent().substring(charNumber);
1107
1108 const int offsetToFirstToken = JavascriptCodeEditor::Helpers::getOffsetToFirstToken(content);
1109
1110 CodeDocument::Position tokenStart(ed.getDocument(), charNumber + offsetToFirstToken);
1111
1112 toggleBreakpoint(codeFile, tokenStart.getLineNumber(), tokenStart.getPosition());
1113 ed.repaint();
1114 }
1115#endif
1116}
1117
1118
1119void JavascriptProcessor::jumpToDefinition(const String& token, const String& namespaceId)

Callers

nothing calls this directly

Calls 7

getFirstLineOnScreenMethod · 0.80
getAllContentMethod · 0.80
repaintMethod · 0.45
getDocumentMethod · 0.45
getPositionMethod · 0.45
substringMethod · 0.45
getLineNumberMethod · 0.45

Tested by

no test coverage detected