Page 1 of 1

Wrong Syntax Highlighting in 6.20

Posted: Sun Mar 02, 2025 8:45 am
by Cyllceaux
The "not" is not right:

Code: Select all

If Not InitSprite() Or
   NOT InitMouse() Or 
   NOT InitKeyboard()
	MessageRequester("Error","Error Init Librarys",#PB_MessageRequester_Error)
	End
EndIf
Image

// Moved from "Bugs - IDE" to "General Discussion" (Kiffi)

Re: Wrong Syntax Highlighting in 6.20

Posted: Sun Mar 02, 2025 8:56 am
by STARGÅTE
Can't confirm. Highlighting is correct here with PB 6.20
Image

Do you have custom keywords?

Re: Wrong Syntax Highlighting in 6.20

Posted: Sun Mar 02, 2025 9:09 am
by Cyllceaux
Your highlight is wrong, too...
Maybe the word "highlight" is wrong.

It's formating and highlighting

The first "not" is right, the second and third one is wrong. "Not" => "NOT"

and no... no custom keywords, macros, procedures or something else.

Re: Wrong Syntax Highlighting in 6.20

Posted: Sun Mar 02, 2025 9:36 am
by STARGÅTE
Why is it wrong? PureBasic is not case sensitive.
You have written "NOT" in your source code, and the IDE keep "NOT" in the editor.
If you want auto-case-correction, you have to enable it in the settings: Editor -> Editing -> Enable Case correction

Re: Wrong Syntax Highlighting in 6.20

Posted: Sun Mar 02, 2025 9:43 am
by Cyllceaux
It is activatet.

OK... I understand that for you it is not a bug. OK.
For me, it is. So I wrote this post.

so:
- wrong highlighting
- wrong case correction

In your case, it is a wrong case correction. I know PB is not case sensitive. But just because I can write things like this:

Code: Select all

pRoCeDuRe tEsT()
 pRoCeDuReReTuRn #FaLsE
EnDpRoCeDuRe
doesn't make it feel right.

Re: Wrong Syntax Highlighting in 6.20

Posted: Sun Mar 02, 2025 9:59 am
by STARGÅTE
It is a bug, if the "NOT" string is not highlighted as keyword like in your screenshot, but as a function.
However, I cannot confirm this miss coloring, even if I disable the auto-correction.

If you have enabled the auto case-correction, then it is not possible to write "pRoCeDuRe" in the IDE.
It will immediately corrected to "Procedure".
If you have disabled auto case-correction, then "pRoCeDuRe" remains as it is, but is (correctly) highlighted as a PureBasic keyword.

Re: Wrong Syntax Highlighting in 6.20

Posted: Sun Mar 02, 2025 10:03 am
by Cyllceaux
the procedure was just an example to prove my point.

the not is corrected and colored right if it is not the first word.

Re: Wrong Syntax Highlighting in 6.20

Posted: Sun Mar 02, 2025 11:29 am
by Caronte3D
I also notice weird behavior of syntax highlight, sometimes the colors changes randomly and the only way to come back to the correct ones, is to use the menu: Compile > Restart Compiler

Re: Wrong Syntax Highlighting in 6.20

Posted: Mon Mar 03, 2025 11:16 am
by Fred
Do you have the 'Enable ASM keyword coloring' in the Compiler option ? Because 'NOT' is an ASM keyword and it will be changed if it at start of the line.

Re: Wrong Syntax Highlighting in 6.20

Posted: Mon Mar 03, 2025 12:41 pm
by Cyllceaux
yes... you are right. it is the inline ASM Syntax. :oops: