Changing to a different lexer in the same window

Andrew Truckle <[email protected]>
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
I did some research and it implies this does not matter. But I want to be 
sure.

At the moment I have:

int CScintillaHelper::OnScintillaCreate()
{
#pragma warning(suppress: 26429)
m_pCLexer = theApp.m_pCreateLexer("xml");
// If I want to re-create the lexer with html ("hypertext") or json 
("json"),
// will I need to delete this one and create again? 

return 0;
}

I have a situation where I need to toggle between CSS and XML in the same 
window. Do I just re-create? Eg:

int CScintillaHelper::OnScintillaCreate(const CString lexer)
{
    if(lexer == L"xml")
    {
#pragma warning(suppress: 26429)
m_pCLexer = theApp.m_pCreateLexer("xml");
    }
    if(lexer == L"css")
    {
#pragma warning(suppress: 26429)
m_pCLexer = theApp.m_pCreateLexer("css");
    }
return 0;
}

And then repeatedly call OnScintillaCreate as needed?

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scintilla-interest/eb74f8fe-a7ce-426b-a980-10ec28064172n%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.