mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-01 13:50:36 +00:00
Fix incorrect colorization of lines ending with '_
An underscore in the end of a line was being considered as a multiline indicator even if it was in a comment. That's fixed now.
This commit is contained in:
parent
b17fda7a61
commit
2576cbc7f4
|
@ -7635,29 +7635,34 @@ SUB ideshowtext
|
||||||
idecy_multilinestart = 0
|
idecy_multilinestart = 0
|
||||||
idecy_multilineend = 0
|
idecy_multilineend = 0
|
||||||
a$ = idegetline(idecy)
|
a$ = idegetline(idecy)
|
||||||
IF RIGHT$(a$, 1) = "_" THEN
|
findquotecomment$ = a$: GOSUB FindQuoteComment
|
||||||
|
IF RIGHT$(a$, 1) = "_" AND ideshowtext_comment = 0 THEN
|
||||||
'Find the beginning of the multiline
|
'Find the beginning of the multiline
|
||||||
FOR idecy_i = idecy - 1 TO 1 STEP -1
|
FOR idecy_i = idecy - 1 TO 1 STEP -1
|
||||||
b$ = idegetline(idecy_i)
|
b$ = idegetline(idecy_i)
|
||||||
IF RIGHT$(b$, 1) <> "_" THEN idecy_multilinestart = idecy_i + 1: EXIT FOR
|
findquotecomment$ = b$: GOSUB FindQuoteComment
|
||||||
|
IF RIGHT$(b$, 1) <> "_" OR ideshowtext_comment = -1 THEN idecy_multilinestart = idecy_i + 1: EXIT FOR
|
||||||
NEXT
|
NEXT
|
||||||
IF idecy_multilinestart = 0 THEN idecy_multilinestart = 1
|
IF idecy_multilinestart = 0 THEN idecy_multilinestart = 1
|
||||||
|
|
||||||
'Find the end of the multiline
|
'Find the end of the multiline
|
||||||
FOR idecy_i = idecy + 1 TO iden
|
FOR idecy_i = idecy + 1 TO iden
|
||||||
b$ = idegetline(idecy_i)
|
b$ = idegetline(idecy_i)
|
||||||
IF RIGHT$(b$, 1) <> "_" THEN idecy_multilineend = idecy_i: EXIT FOR
|
findquotecomment$ = b$: GOSUB FindQuoteComment
|
||||||
|
IF RIGHT$(b$, 1) <> "_" OR ideshowtext_comment = -1 THEN idecy_multilineend = idecy_i: EXIT FOR
|
||||||
NEXT
|
NEXT
|
||||||
IF idecy_multilineend = 0 THEN idecy_multilinestart = iden
|
IF idecy_multilineend = 0 THEN idecy_multilinestart = iden
|
||||||
ELSE
|
ELSE
|
||||||
IF idecy > 1 THEN b$ = idegetline(idecy - 1) ELSE b$ = ""
|
IF idecy > 1 THEN b$ = idegetline(idecy - 1) ELSE b$ = ""
|
||||||
IF RIGHT$(b$, 1) = "_" THEN
|
findquotecomment$ = b$: GOSUB FindQuoteComment
|
||||||
|
IF RIGHT$(b$, 1) = "_" AND ideshowtext_comment = 0 THEN
|
||||||
idecy_multilineend = idecy
|
idecy_multilineend = idecy
|
||||||
|
|
||||||
'Find the beginning of the multiline
|
'Find the beginning of the multiline
|
||||||
FOR idecy_i = idecy - 1 TO 1 STEP -1
|
FOR idecy_i = idecy - 1 TO 1 STEP -1
|
||||||
b$ = idegetline(idecy_i)
|
b$ = idegetline(idecy_i)
|
||||||
IF RIGHT$(b$, 1) <> "_" THEN idecy_multilinestart = idecy_i + 1: EXIT FOR
|
findquotecomment$ = b$: GOSUB FindQuoteComment
|
||||||
|
IF RIGHT$(b$, 1) <> "_" OR ideshowtext_comment = -1 THEN idecy_multilinestart = idecy_i + 1: EXIT FOR
|
||||||
NEXT
|
NEXT
|
||||||
IF idecy_multilinestart = 0 THEN idecy_multilinestart = 1
|
IF idecy_multilinestart = 0 THEN idecy_multilinestart = 1
|
||||||
END IF
|
END IF
|
||||||
|
@ -7689,16 +7694,9 @@ SUB ideshowtext
|
||||||
|
|
||||||
'Check if the cursor is positioned inside a comment or
|
'Check if the cursor is positioned inside a comment or
|
||||||
'quotation marks:
|
'quotation marks:
|
||||||
idecx_comment = 0
|
findquotecomment$ = LEFT$(a$, idecx): GOSUB FindQuoteComment
|
||||||
idecx_quote = 0
|
idecx_comment = ideshowtext_comment
|
||||||
FOR k = 1 TO idecx
|
idecx_quote = ideshowtext_quote
|
||||||
SELECT CASE MID$(a$, k, 1)
|
|
||||||
CASE CHR$(34)
|
|
||||||
idecx_quote = NOT idecx_quote
|
|
||||||
CASE "'"
|
|
||||||
IF idecx_quote = 0 THEN idecx_comment = -1: EXIT FOR
|
|
||||||
END SELECT
|
|
||||||
NEXT k
|
|
||||||
|
|
||||||
'Check if we're on a bracket, to highlight it and its match
|
'Check if we're on a bracket, to highlight it and its match
|
||||||
brackets = 0
|
brackets = 0
|
||||||
|
@ -7925,6 +7923,16 @@ SUB ideshowtext
|
||||||
|
|
||||||
SCREEN , , 0, 0: LOCATE idecy - idesy + 3, idecx - idesx + 2: SCREEN , , 3, 0
|
SCREEN , , 0, 0: LOCATE idecy - idesy + 3, idecx - idesx + 2: SCREEN , , 3, 0
|
||||||
|
|
||||||
|
EXIT SUB
|
||||||
|
FindQuoteComment:
|
||||||
|
ideshowtext_comment = 0: ideshowtext_quote = 0
|
||||||
|
FOR ideshowtext_k = 1 TO LEN(findquotecomment$)
|
||||||
|
SELECT CASE MID$(findquotecomment$, ideshowtext_k, 1)
|
||||||
|
CASE CHR$(34): ideshowtext_quote = NOT ideshowtext_quote
|
||||||
|
CASE "'": IF ideshowtext_quote = 0 THEN ideshowtext_comment = -1: EXIT FOR
|
||||||
|
END SELECT
|
||||||
|
NEXT ideshowtext_k
|
||||||
|
RETURN
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
FUNCTION idesubs$
|
FUNCTION idesubs$
|
||||||
|
|
Loading…
Reference in a new issue