After unsuccessfully trying for hours upon hours to get a INDIC_ROUNDBOX indicator to go away when the user selects a new language (using default build messages) and checking on the Scintilla interest group to see if there was an 'accepted' method I propose that the current Buffer doNotify routine should be reflected in the Notepad_plus_msgs NPPN output.
The goal would be to beNotified of a buffer language change prior to the buffer actually switching to the new language lexer so that cleanup routines would have an chance to be processed.
Indicators are extremely powerful, and IMO, vastly underused within lexers when compared to fixed style changes. Granted the styles are truly fixed as they could be adjusted while lexing, you can look at the interest level of tag highlighting, smart highlighting and the like to see that indicators are useful.
Hopefully some people can add their two-cents worth to this before a request is made to see if I am truly out of my mind, or if this is a good, and doable, idea.
Thanks,
Thell
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For anyone that is using a lexer that has indicators that remain behind when choosing a new language the below code will fix it, you'll need to rebuild the SciLexer.dll and replace the one in the Notepad++ directory.
// replace the ClearDocumentStyle at line 3499 in Editor.cxx
void Editor::ClearDocumentStyle() {
for (int i =0; i <= 7; i++) {
vs.indicators[i].style = 0;
pdoc->decorations.SetCurrentIndicator(i);
pdoc->decorations.SetCurrentValue(0);
pdoc->DecorationFillRange(0, 0, pdoc->Length());
}
pdoc->StartStyling(0, '\377');
pdoc->SetStyleFor(pdoc->Length(), 0);
cs.ShowAll();
pdoc->ClearLevels();
}
That sort of negates the reason for wanting a NPPN_BufferChangeLanguage message too. :)
Thell
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After unsuccessfully trying for hours upon hours to get a INDIC_ROUNDBOX indicator to go away when the user selects a new language (using default build messages) and checking on the Scintilla interest group to see if there was an 'accepted' method I propose that the current Buffer doNotify routine should be reflected in the Notepad_plus_msgs NPPN output.
The goal would be to beNotified of a buffer language change prior to the buffer actually switching to the new language lexer so that cleanup routines would have an chance to be processed.
Indicators are extremely powerful, and IMO, vastly underused within lexers when compared to fixed style changes. Granted the styles are truly fixed as they could be adjusted while lexing, you can look at the interest level of tag highlighting, smart highlighting and the like to see that indicators are useful.
Hopefully some people can add their two-cents worth to this before a request is made to see if I am truly out of my mind, or if this is a good, and doable, idea.
Thanks,
Thell
For anyone that is using a lexer that has indicators that remain behind when choosing a new language the below code will fix it, you'll need to rebuild the SciLexer.dll and replace the one in the Notepad++ directory.
// replace the ClearDocumentStyle at line 3499 in Editor.cxx
void Editor::ClearDocumentStyle() {
for (int i =0; i <= 7; i++) {
vs.indicators[i].style = 0;
pdoc->decorations.SetCurrentIndicator(i);
pdoc->decorations.SetCurrentValue(0);
pdoc->DecorationFillRange(0, 0, pdoc->Length());
}
pdoc->StartStyling(0, '\377');
pdoc->SetStyleFor(pdoc->Length(), 0);
cs.ShowAll();
pdoc->ClearLevels();
}
That sort of negates the reason for wanting a NPPN_BufferChangeLanguage message too. :)
Thell