Skip to content

Commit

Permalink
#206 #207 Fix escape sequence highlighting with change of for loop to…
Browse files Browse the repository at this point in the history
… while loop.
  • Loading branch information
zufuliu authored and nyamatongwe committed Sep 24, 2023
1 parent f278d76 commit 8366df6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
13 changes: 13 additions & 0 deletions doc/LexillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,19 @@ <h2>Contributors</h2>
</tr>
</table>
<h2>Releases</h2>
<h3>
<a href="https://www.scintilla.org/lexilla528.zip">Release 5.2.8</a>
</h3>
<ul>
<li>
Released 22 September 2023.
</li>
<li>
R: Fix escape sequence highlighting with change of for loop to while loop.
<a href="https://github.com/ScintillaOrg/lexilla/issues/206">Issue #206</a>,
<a href="https://github.com/ScintillaOrg/lexilla/pull/207">Pull request #207</a>.
</li>
<ul>

This comment has been minimized.

Copy link
@zufuliu

zufuliu Sep 25, 2023

Author Contributor

This is typo for </ul>?
image

This comment has been minimized.

Copy link
@nyamatongwe

nyamatongwe Sep 25, 2023

Member

OK, fixed.

<h3>
<a href="https://www.scintilla.org/lexilla527.zip">Release 5.2.7</a>
</h3>
Expand Down
3 changes: 2 additions & 1 deletion lexers/LexR.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void ColouriseRDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, W
dashCount = lineState >> 8;
}

for (; sc.More(); sc.Forward()) {
while (sc.More()) {
// Determine if the current state should terminate.
switch (sc.state) {
case SCE_R_OPERATOR:
Expand Down Expand Up @@ -272,6 +272,7 @@ void ColouriseRDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, W
const int lineState = matchingDelimiter | (dashCount << 8);
styler.SetLineState(sc.currentLine, lineState);
}
sc.Forward();
}
sc.Complete();
}
Expand Down
3 changes: 3 additions & 0 deletions test/examples/r/AllStyles.r
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ acme
"\n0\r1\t2\b3\a4\f5\\6\'7\"8\`9"
"\1230\x121\u12342\U000123453\u{1234}4\U{00012345}5\
6\ 7"
# issue #206
"\n"
"\r\n"

# Backticks
d$`1st column`
Expand Down
3 changes: 3 additions & 0 deletions test/examples/r/AllStyles.r.folded
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
0 400 400 "\n0\r1\t2\b3\a4\f5\\6\'7\"8\`9"
0 400 400 "\1230\x121\u12342\U000123453\u{1234}4\U{00012345}5\
0 400 400 6\ 7"
0 400 400 # issue #206
0 400 400 "\n"
0 400 400 "\r\n"
1 400 400
0 400 400 # Backticks
0 400 400 d$`1st column`
Expand Down
3 changes: 3 additions & 0 deletions test/examples/r/AllStyles.r.styled
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
{6}"{15}\n{6}0{15}\r{6}1{15}\t{6}2{15}\b{6}3{15}\a{6}4{15}\f{6}5{15}\\{6}6{15}\'{6}7{15}\"{6}8{15}\`{6}9"{0}
{6}"{15}\123{6}0{15}\x12{6}1{15}\u1234{6}2{15}\U00012345{6}3{15}\u{1234}{6}4{15}\U{00012345}{6}5{15}\{6}
6{15}\ {6}7"{0}
{1}# issue #206{0}
{6}"{15}\n{6}"{0}
{6}"{15}\r\n{6}"{0}

{1}# Backticks{0}
{9}d{8}${12}`1st column`{0}
Expand Down

0 comments on commit 8366df6

Please sign in to comment.