Author Topic: syntax-highlighting on write-protected sourcefiles fail  (Read 16007 times)

stuffbit

  • Guest
syntax-highlighting on write-protected sourcefiles fail
« on: May 22, 2006, 10:37:17 am »
Hi all,
i have a problem with syntax-highlighting, when opening a write-protected file in the editor. The highlighting then is completely wrong. If the file is not write-protected, everything is fine. When a write-protected file is in the editor (with incorrect syntax-coloring) it is sufficient to open the syntax-highlighting dialog and to terminate it with OK. Then this single write-protected file is shown with the correct highlighting until code::blocks is ended. With the next start of c::b, the problem is the same as before.
- DZi

I´m using c::b rev. 2438, Win XP SP2

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #1 on: May 22, 2006, 07:50:25 pm »
I´m using c::b rev. 2438, Win XP SP2

Hello,

Try with a more recent C::B revision if you still have your problem.

Best wishes,
Michael

sethjackson

  • Guest
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #2 on: May 22, 2006, 11:09:02 pm »
Hi all,
i have a problem with syntax-highlighting, when opening a write-protected file in the editor. The highlighting then is completely wrong. If the file is not write-protected, everything is fine. When a write-protected file is in the editor (with incorrect syntax-coloring) it is sufficient to open the syntax-highlighting dialog and to terminate it with OK. Then this single write-protected file is shown with the correct highlighting until code::blocks is ended. With the next start of c::b, the problem is the same as before.
- DZi

I´m using c::b rev. 2438, Win XP SP2

It is known although maybe somewhat forgotten

Anyways could you please post this to the BerliOS bug tracker (so it won't be lost). I may be able to fix it. :D

stuffbit

  • Guest
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #3 on: May 23, 2006, 11:13:38 am »
Hi,
with Rev.2484 the problem with syntax-highlighting is still there.
I´ll try to post the problem to the bug-tracker.
- DZi

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #4 on: May 23, 2006, 01:13:53 pm »
Quote
when opening a write-protected file in the editor. The highlighting then is completely wrong. If the file is not write-protected, everything is fine.
This is no bug, it is intentional behaviour.

Quote
it is sufficient to open the syntax-highlighting dialog and to terminate it with OK. Then this single write-protected file is shown with the correct highlighting until code::blocks is ended.
This is a bug.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

sethjackson

  • Guest
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #5 on: May 23, 2006, 08:01:43 pm »
Quote
when opening a write-protected file in the editor. The highlighting then is completely wrong. If the file is not write-protected, everything is fine.
This is no bug, it is intentional behaviour.

Quote
it is sufficient to open the syntax-highlighting dialog and to terminate it with OK. Then this single write-protected file is shown with the correct highlighting until code::blocks is ended.
This is a bug.

Exactly.

EDIT:

Proposed fix here.
« Last Edit: May 23, 2006, 09:09:33 pm by sethjackson »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #6 on: May 24, 2006, 08:39:52 am »
i don't understand the reason, why write protected files should not use the same highlighting scheme as non write protected.
why is this intentional ?


from my point of view it would be much more user-friendly, if write-protected files would use exactly the same highlighting-scheme as not write protected ones.

not everyone is using svn - in many companies version-control is done by other systems, which are using file-protecting until you have checked out a specific file to work with, but normally you have to look in many other files too, which you didn't check out for editing.
i find the current highlighting handling of write-protectde files really annoing. if you can't edit a file, you know already that it's write protected, that's enough.
« Last Edit: May 24, 2006, 09:02:06 am by tiwag »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #7 on: May 24, 2006, 09:37:55 am »
if you can't edit a file, you know already that it's write protected, that's enough.

Well, the first few times this happened to me, I thought my keyboard was broken or a virus had entered my system :P
Be patient!
This bug will be fixed soon...

worster

  • Guest
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #8 on: May 24, 2006, 09:57:45 am »
In my opinion, you could just place a little meaningful file icon to indicate a file is write-protected,
that's enough, and the syntax highlight should be the same as files which are not protected.

Just my point of view.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #9 on: May 24, 2006, 10:02:11 am »
Well, I suggest someone should start a poll about this issue. Then we can go with what the community decides...
Be patient!
This bug will be fixed soon...

stuffbit

  • Guest
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #10 on: May 24, 2006, 10:47:55 am »
I trapped into the problem with syntax-highlighting because we are using MKS Source Integrity as a version control system for some of our projects. File-locking is realized with the write-protection-bit. It´s unusual to check-out files from the project-archive for only viewing them in an editor. SVN has a similar function (property svn:needs-lock) if you don´t want to merge files when they are committed to the repository.
I used CodeWright for many years as my preferred source-editor before I started to work with code::blocks.
- DZi

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #11 on: May 24, 2006, 11:51:43 am »
SVN has a similar function (property svn:needs-lock) if you don´t want to merge files when they are committed to the repository.
While the arguments about some other revision control systems are certainly correct, locking in SVN is only to be used for files that do not work well for merging, such as binary images. You can of course do differently, but that is wrong.
In the Subversion philosophy, locking is "considered generally harmful to collaboration".

Every file that can be edited in Code::Blocks can be merged without problems. Therefore, in the normal case, no such file should be locked. There may be exceptions to this rule, but there are few.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

sethjackson

  • Guest
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #12 on: May 24, 2006, 01:43:58 pm »
I think the way C::B handles the syntax highlighting of write protected files is ok, but this is my opinion.....
« Last Edit: May 24, 2006, 01:59:19 pm by sethjackson »

ProutDeMammouth

  • Guest
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #13 on: May 24, 2006, 01:53:57 pm »
Well, I suggest someone should start a poll about this issue. Then we can go with what the community decides...
or just add an option somewhere.

sethjackson

  • Guest
Re: syntax-highlighting on write-protected sourcefiles fail
« Reply #14 on: May 24, 2006, 01:58:31 pm »
Well, I suggest someone should start a poll about this issue. Then we can go with what the community decides...
or just add an option somewhere.

That is an even better idea. :D