Skip to content

Commit

Permalink
#191 Fix incremental styling of multi-line ASP.NET directive.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu authored and nyamatongwe committed Jul 22, 2023
1 parent 7b442de commit 8923e36
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions doc/LexillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,10 @@ <h3>
<a href="https://github.com/ScintillaOrg/lexilla/issues/191">Issue #191</a>.
</li>
<li>
HTML: fix incremental styling of multi-line ASP.NET directive.
<a href="https://github.com/ScintillaOrg/lexilla/issues/191">Issue #191</a>.
</li>
<li>
Matlab: improve arguments blocks.
Add support for multiple arguments blocks.
Prevent "arguments" from being keyword in function declaration line.
Expand Down
6 changes: 3 additions & 3 deletions lexers/LexHTML.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ int PrintScriptingIndicatorOffset(Accessor &styler, Sci_PositionU start, Sci_Pos
script_type ScriptOfState(int state) {
if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) {
return eScriptPython;
} else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) {
} else if ((state >= SCE_HB_START && state <= SCE_HB_STRINGEOL) || (state == SCE_H_ASPAT || state == SCE_H_XCCOMMENT)) {
return eScriptVBS;
} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) {
return eScriptJS;
} else if ((state >= SCE_HPHP_DEFAULT) && (state <= SCE_HPHP_COMMENTLINE)) {
} else if ((state >= SCE_HPHP_DEFAULT && state <= SCE_HPHP_COMMENTLINE) || (state == SCE_HPHP_COMPLEX_VARIABLE)) {
return eScriptPHP;
} else if ((state >= SCE_H_SGML_DEFAULT) && (state < SCE_H_SGML_BLOCK_DEFAULT)) {
return eScriptSGML;
Expand Down Expand Up @@ -231,7 +231,7 @@ inline bool stateAllowsTermination(int state) {

inline bool isPreProcessorEndTag(int state, int ch) {
const script_type type = ScriptOfState(state);
if (AnyOf(state, SCE_H_ASP, SCE_H_ASPAT, SCE_H_XCCOMMENT) || AnyOf(type, eScriptVBS, eScriptJS, eScriptPython)) {
if (state == SCE_H_ASP || AnyOf(type, eScriptVBS, eScriptJS, eScriptPython)) {
return ch == '%';
}
if (type == eScriptPHP) {
Expand Down
3 changes: 3 additions & 0 deletions test/examples/hypertext/ServerBasic.aspx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<%@ register tagprefix="uc1"
tagname="CalendarUserControl"
src="~/CalendarUserControl.ascx" %>
<!DOCTYPE html>
<html>
<%@language=VBScript%>
Expand Down
3 changes: 3 additions & 0 deletions test/examples/hypertext/ServerBasic.aspx.folded
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2 400 0 + <%@ register tagprefix="uc1"
0 401 0 | tagname="CalendarUserControl"
0 401 0 | src="~/CalendarUserControl.ascx" %>
0 400 0 <!DOCTYPE html>
2 400 0 + <html>
0 401 0 | <%@language=VBScript%>
Expand Down
3 changes: 3 additions & 0 deletions test/examples/hypertext/ServerBasic.aspx.styled
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{15}<%@{16} register tagprefix="uc1"
tagname="CalendarUserControl"
src="~/CalendarUserControl.ascx" {15}%>{0}
{21}<!{26}DOCTYPE html{21}>{0}
{1}<html>{0}
{15}<%@{16}language=VBScript{15}%>{0}
Expand Down

0 comments on commit 8923e36

Please sign in to comment.