Wrong Syntax Highlighting in 6.20

Working on new editor enhancements?
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Wrong Syntax Highlighting in 6.20

Post 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)
User avatar
STARGÅTE
Addict
Addict
Posts: 2228
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Wrong Syntax Highlighting in 6.20

Post by STARGÅTE »

Can't confirm. Highlighting is correct here with PB 6.20
Image

Do you have custom keywords?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: Wrong Syntax Highlighting in 6.20

Post 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.
User avatar
STARGÅTE
Addict
Addict
Posts: 2228
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Wrong Syntax Highlighting in 6.20

Post 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
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: Wrong Syntax Highlighting in 6.20

Post 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.
User avatar
STARGÅTE
Addict
Addict
Posts: 2228
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Wrong Syntax Highlighting in 6.20

Post 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.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: Wrong Syntax Highlighting in 6.20

Post 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.
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Wrong Syntax Highlighting in 6.20

Post 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
Fred
Administrator
Administrator
Posts: 18171
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Wrong Syntax Highlighting in 6.20

Post 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.
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: Wrong Syntax Highlighting in 6.20

Post by Cyllceaux »

yes... you are right. it is the inline ASM Syntax. :oops:
Post Reply