Code: Select all
m_stc->SetLexer(wxSTC_LEX_CPP);
m_stc->StyleSetForeground(wxSTC_C_DEFAULT, wxColour(20, 20, 200));
m_stc->StyleSetForeground(wxSTC_C_COMMENT, wxColour(150, 150, 150));
m_stc->SetKeyWords(0,
wxT(
"alignas alignof and and_eq asm atomic_cancel atomic_commit "
)
);
…
m_stc->Connect(wxEVT_STC_MODIFIED,
wxStyledTextEventHandler(MainWindow::onStcModified), NULL, this
);
…
void onStcModified(wxStyledTextEvent& event)
{
m_stc->SetLexer(wxSTC_LEX_CPP);
uint64_t start_pos = m_stc->GetEndStyled(); // <- this is always zero too
uint64_t end_pos = m_stc->GetLineEndPosition(m_stc->LineFromPosition(m_stc->GetCurrentPos()));
m_stc->Colourise(0, end_pos);
auto lex = m_stc->GetLexer();
}
Have I missed out on a vital config option or something?