News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

syntax-highlighting on write-protected sourcefiles fail

Started by stuffbit, May 22, 2006, 10:37:17 AM

Previous topic - Next topic

stuffbit

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

Michael

Quote from: stuffbit on May 22, 2006, 10:37:17 AM
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
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

sethjackson

Quote from: stuffbit 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

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

Hi,
with Rev.2484 the problem with syntax-highlighting is still there.
I´ll try to post the problem to the bug-tracker.
- DZi

thomas

Quotewhen 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.

Quoteit 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

#5
Quote from: thomas on May 23, 2006, 01:13:53 PM
Quotewhen 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.

Quoteit 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.

tiwag

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.

mandrav

Quote from: tiwag on May 24, 2006, 08:39:52 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

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.

mandrav

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

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

thomas

Quote from: stuffbit on May 24, 2006, 10:47:55 AMSVN 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

#12
I think the way C::B handles the syntax highlighting of write protected files is ok, but this is my opinion.....

ProutDeMammouth

Quote from: mandrav 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...
or just add an option somewhere.

sethjackson

Quote from: ProutDeMammouth on May 24, 2006, 01:53:57 PM
Quote from: mandrav 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...
or just add an option somewhere.

That is an even better idea. :D