Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LexR] Change for loop to while loop to fix escape sequence highlighting, issue #206 #207

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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