Author Topic: Beginning with SVN 10634 code highlighting defaults to plain text  (Read 4543 times)

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Edit: Edited title with exact SVN.

See: Here.

It seems that with SVN 10637 the default highlight mode for source code is defaulting to plain text files.  Even after changing the mode and saving all.  I did delete the APPDATA Code::Blocks settings and started fresh to make sure it wasn't in there.

« Last Edit: January 01, 2016, 11:47:02 am by headkase »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12090
    • Travis build status
Re: SVN 10637 Default Code Highlighting is Plain Text
« Reply #1 on: December 31, 2015, 10:09:43 am »
What? Try to explain what the problem is better, please, at the moment it is hard to understand.

And please post in a single topic.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: SVN 10637 Default Code Highlighting is Plain Text
« Reply #2 on: December 31, 2015, 07:06:46 pm »
What? Try to explain what the problem is better, please, at the moment it is hard to understand.

And please post in a single topic.

Sorry, created this thread as I found the issue during troubleshooting a plugin but it is about the editor so I created a new thread.

* With SVN 10637, create a new C++ console project.
* The syntax highlighting is supposed to be C++, instead it defaults to plain text.
* Highlighting is chosen from the: Edit menu, Highlight Mode. 
* Set C++ highlighting, save all, close C::B, restart, load project.
* highlighting back to plain text.

Compiler used is MinGW-Builds 5.3.0 32-bit.

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #3 on: January 01, 2016, 11:40:51 am »
Did some test compiles and narrowed down the issue:

* SVN 10633 correctly applies the appropriate code highlighting on opened files

* SVN 10634 defaults to plain text highlighting which is incorrect

Thanks,

Bill.
« Last Edit: January 01, 2016, 11:47:20 am by headkase »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12090
    • Travis build status
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #4 on: January 01, 2016, 02:37:04 pm »
Works fine for me on linux.
Can someone else confirm that the issue happens?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #5 on: January 01, 2016, 03:19:21 pm »
Works fine for me on linux.
Can someone else confirm that the issue happens?

As always I will gladly apply and compile test patches.  It's the least I can do for all the effort that is provided from the team at no monetary cost.

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #6 on: January 01, 2016, 03:32:13 pm »
Here, this file may be useful:

https://www.dropbox.com/s/2ie4mkgwjzcfale/Highlight_Builds.7z?dl=0

It is both builds 10633 and 10634 as compiled on my own system using MinGW-Builds 5.3.0 32-bit.  No contrib plugins, just the main project.  Everything needed to run them (toolchain dll's) are included.  If another Windows user does not have the issue with a different toolchain then it might be what I'm using.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #7 on: January 01, 2016, 04:40:32 pm »
* SVN 10633 correctly applies the appropriate code highlighting on opened files
* SVN 10634 defaults to plain text highlighting which is incorrect
I can reproduce on Windows. Lets have a look...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #8 on: January 01, 2016, 04:45:13 pm »
* SVN 10633 correctly applies the appropriate code highlighting on opened files
* SVN 10634 defaults to plain text highlighting which is incorrect
I can reproduce on Windows. Lets have a look...
@oBFusCATed: I think for now I would revert your commit becasue it really causes the issue and that is serious. Will you do it?

Edit: Oh, and btw: After your commit I have two times the plain text file option: Ones is called "plain text" and the other is "Plain Text Files". Why? Are you sure you didn't implement something that was already there? :-)
« Last Edit: January 01, 2016, 04:47:39 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #9 on: January 01, 2016, 04:54:36 pm »
Did some test compiles and narrowed down the issue:
For now, please remove the lexer on Windows (lexer_plain.xml) then it should work again. I think the reason for the bug is simple: The file mask in the lexer (*) hits for all files. As the index (1) is the lowest index it will always "win" for all files. Thus, all files will be handled as "plain text". This surely it not what we want, isn't it? To me its weird that it works on Linux, because it should show the same effect. Or does "*" mean really just a file w/o extension?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #10 on: January 01, 2016, 04:59:13 pm »
For now, please remove the lexer on Windows (lexer_plain.xml) then it should work again.

Yes, removing that file restores correct behavior without doing any other change.  Thanks.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12090
    • Travis build status
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #11 on: January 01, 2016, 05:07:56 pm »
To me its weird that it works on Linux, because it should show the same effect. Or does "*" mean really just a file w/o extension?
Probably on my machine or on linux the plain text lexer is loaded after the other lexers. So it is added to the end of the list of lexers.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12090
    • Travis build status
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #12 on: January 01, 2016, 05:17:01 pm »
Edit: Oh, and btw: After your commit I have two times the plain text file option: Ones is called "plain text" and the other is "Plain Text Files". Why? Are you sure you didn't implement something that was already there? :-)
Nope I see only "Plain Text Files" in the combo box. But I see the "Plain text" menu option in the Highlight menu.
So I guess there is more work to do about this patch.
And obviously I was right that this change is not safe for 15.12 :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Scr3amer

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #13 on: January 03, 2016, 02:10:19 am »
Hey guys,

So I had the same bug, good to know it is not from my side.

But I have another question concerning the syntax hightlight when I build from source : is it normal the members of classes are not highlighted ? Because on C::B 13.12 they are highlighted in purple (default theme color).

Thanks again for the great work you do with C::B  :D !

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #14 on: January 03, 2016, 04:16:08 am »
But I have another question concerning the syntax hightlight when I build from source : is it normal the members of classes are not highlighted ? Because on C::B 13.12 they are highlighted in purple (default theme color).
This is controlled by Settings->Editor->Code Completion->pseudo semantic keyword highlighting.

@devs: Some of the options there are "Disable xyz", and some are "Enable xyz"... this is kind of confusing.

Online ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5241
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #15 on: January 03, 2016, 09:24:29 am »
But I have another question concerning the syntax hightlight when I build from source : is it normal the members of classes are not highlighted ? Because on C::B 13.12 they are highlighted in purple (default theme color).
This is controlled by Settings->Editor->Code Completion->pseudo semantic keyword highlighting.

@devs: Some of the options there are "Disable xyz", and some are "Enable xyz"... this is kind of confusing.
I prefer the "Enable xyz" kinds option.  :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Scr3amer

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Beginning with SVN 10634 code highlighting defaults to plain text
« Reply #16 on: January 03, 2016, 04:49:04 pm »
But I have another question concerning the syntax hightlight when I build from source : is it normal the members of classes are not highlighted ? Because on C::B 13.12 they are highlighted in purple (default theme color).
This is controlled by Settings->Editor->Code Completion->pseudo semantic keyword highlighting.

@devs: Some of the options there are "Disable xyz", and some are "Enable xyz"... this is kind of confusing.

Thanks for the help :D !