Author |
Topic |
|
dodudo7
Ketchup Master
Israel
55 Posts |
Posted - Nov 10 2004 : 07:45:01 AM
|
I think that this problem is very old. In some projects (sometimes even very small ones), a variable or a method argument named "data" will be colored as class, struct or typedef. It is also bold if it is a local symbol (which is 100% OK).
I am using VC++ 6 on win2k sp4, VaX 1283
|
Edited by - dodudo7 on Nov 10 2004 10:00:55 AM |
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Nov 10 2004 : 08:42:04 AM
|
Surprisingly enough, we can't see the images on your local drive. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Nov 10 2004 : 08:46:49 AM
|
I think the story is that if there are two symbols of the same name, the colouring algorithm can't tell them apart, and that this is so that it can be fast enough to repaint while you're scrolling. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
dodudo7
Ketchup Master
Israel
55 Posts |
Posted - Nov 10 2004 : 09:00:19 AM
|
Stephen,
1) There is only one symbol with this name - "data" 2) This bug has nothing to do with scrolling.
|
|
|
jpizzi
Tomato Guru
USA
642 Posts |
Posted - Nov 10 2004 : 10:44:48 AM
|
My thoughts are that "data" is defined somewhere (so there are now two of them), and the result is what Stephen described.
"Data" is one of those terms that is so ubiquitous that I try to never use it as an identifier. Not only is it not very descriptive, there is too much danger of it being #defined somewhere, or at the very least, used in too global of a namespace.
|
Joe Pizzi |
|
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Nov 10 2004 : 10:52:00 AM
|
I thought we had all agreed to name our variables "A1" through "Z9"?
|
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Nov 10 2004 : 11:11:48 AM
|
Stephen is correct. Our coloring algorithm is built for speed -- ridiculously high speed since it needs to run as you scroll, among less intensive tasks like arrowing or using PageUp to scroll.
Our coloring algorithm makes a fair number of guesses. It's usually correct, but it's reasonable to imagine it thinking a symbol named "data" is a #define or a class.
The algorithm that applies bold is much smarter. |
|
|
PatLuja
Tomato Guru
Belgium
416 Posts |
Posted - Nov 11 2004 : 02:56:55 AM
|
Hello all,
This topic is also discussed in a topic from eight months ago: Wrongly coloured code.
Isn't it an idea, to run two colouring threads, one that does it really fast, and one that kicks in when there is no change for one second, but gives even better results? (I must admit, I looks like a lot of work and a source for many bugs...)
I hope it gets resolved somehow...once...
With kind regards, Patrick Luja |
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Nov 11 2004 : 05:19:42 AM
|
1099 is another reference. Support pointed out in that thread another problem with having two colouring threads. Not only do you have the practical problem of keeping twice as much code free of bugs, but also symbols would change colour when there was a pause in scrolling/typing. This could be very distracting. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
Uniwares
Tomato Guru
Portugal
2322 Posts |
Posted - Nov 11 2004 : 08:10:54 AM
|
Just wondering why cant VAX keep a coloring table in memory for the whole actual file? While you scroll the code wont change. And this coloring table can be built while loading the file, and updated while editing. I would gladly waste a few Kb more to have correct coloring always. During painting VAX would just need to lookup the current position and fetch the coloring information from that table. Sounds not too hard to implement. In fact, much easier than doing it on the fly. |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Nov 12 2004 : 12:18:13 PM
|
Interesting idea.
Unfortunately, we are a bit tied by how the IDE paints text. We intercept what it does, and color just before the text hits the display. ... and the IDE does not paint in any normal pattern. Far from it. A few character here, some down there, a bit more over there, etc. .. And the IDE doesn't exactly tell us what character on the display matches what character in the file.
All said, we will seek inspiration from your suggestion. |
Edited by - support on Nov 12 2004 12:20:04 PM |
|
|
Uniwares
Tomato Guru
Portugal
2322 Posts |
Posted - Nov 12 2004 : 3:48:10 PM
|
If you have enough information to make an (un-)educated guess at a symbol, you should have enough information to look it up in the coloring table. I think... I hope...
Even then, there should be a pattern (maybe various patterns) in how screen contents is painted. This might lead to an even better estimate what part of the file/screen is being painted now, depending on what was painted before. Uh? Yes? Maybe? I know, IDE sucks. Just making some wild guesses.
|
|
|
|
Topic |
|