Пример #1
0
void FileEditorWnd::OnTextChanged(wxStyledTextEvent& event)
{
	int flags = event.GetModificationType();
	if ((flags&wxSTC_MOD_INSERTTEXT) == wxSTC_MOD_INSERTTEXT ||
		(flags&wxSTC_MOD_DELETETEXT) == wxSTC_MOD_DELETETEXT)
	{
		if (!m_isLoading)
			gWorkspace->setFileDirty(m_file->id, true);
		gFileEditorGroupWnd->setPageTitle(m_file);

		gWorkspace->iterateBreakpoints(m_file->id, [&](const Breakpoint* brk)
		{
			if (brk->markerHandle != -1)
				gWorkspace->setBreakpointPos(brk, FROM_TXTLINE(m_textCtrl->MarkerLineFromHandle(brk->markerHandle)), brk->markerHandle);
		});
	}
}
Пример #2
0
/**
 * source is modified
 */
void FbEditor::onModified(wxStyledTextEvent & event)
{
    // not directly modifying text?
    auto flags = event.GetModificationType();
    if ((flags & (wxSTC_MOD_INSERTTEXT | wxSTC_MOD_DELETETEXT)) == 0) return;

    // set input buffer
    m_srcCtx->setBuffer(GetCharacterPointer());

    // get modified line & line length
    int line     = LineFromPosition(event.GetPosition());
    int pos      = PositionFromLine(line);
    int length   = this->GetLineLength(line);

    // analyze the source
    m_srcCtx->analyze(line, pos, length);
}