SlickEdit Product Discussion > SlickEdit®

Coloring and reloading modified files.

(1/3) > >>

I've been working with files that are created during a build - having some of these generated source files open in Slickedit.
I've been seeing Slickedit get the coloring confused after files are reloaded, and I haven't seen a good way to fix it when it happens.

See the attached screen shots. I replaced "[a-z]" with "Q" to obfuscate for posting here.
The Replace operation didn't change the coloring.
Note in the 2nd image, I removed the "//" prefix so the line is no longer a comment, and still the coloring for some of the letters is wrong.

I also tried using "Tools > Options > Appearance > Colors", and clicking on various things.
Clicking anywhere in the "Q"s tells me "Line Comment"
Once I remove the "//" from line 38, clicking on any "Q" tells me "Identifier" - even the ones that are the wrong color.

If I change the ColorProfile (for example, to Black") these mis-colored letters are still colored incorrectly (changing to yellow).

When I change the color for "Keyword", those "Q"s update to match.

Anyway you can give us a reproducible test case?

I keep seeing this problem.
See the attached colors in the comment in a C# file.

This is generated code.
However, the coloring is preserved when I close the file and open it again. (Case1)

If I open Tools > Options > Appearance > Colors, then click on the letters with the wrong colors, Options still indicates "Line Comment" -- just as it does for all of the correctly colored comment characters.

If I delete the "//" the badly colored characters stay badly colored (Case2), while rest of the comment is recolored as "Identifier" (the ":" is colored as "Operator").

Inserted characters inherit the bad colors around them (Case3)

Case4 and Case5: More of the same, this time starting out not commented.
Is there something I can do to track this down?
Its not really serious, but it is distracting.

Since you can remove the // and the text still doesnt look right I’m guessing this is not color coding. It’s probably some stream markers. try deleting ALL the incorrectly colored characters that are not in comment color. Then type the same characters back in. If the wrong color doesn’t come back, the color is from some stream markers. I have no idea what’s creating the stream markers.

Deleting the miscolored text, then undoing fixes the coloring.

I made a function to dump the stream markers. In the file in question there are lots of them. The following one is one inside a comment where some text is miscolored.
    Marker:13742, Start=27452, Color:17, Type:172, Flags0, Flags2=16, Pri=225

What I think are the relevant definitions

My code

--- Code: ---_command listmarkers() name_info(','VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL)
    int list[];
    int wid = p_window_id;
    wid._StreamMarkerFindList(list, wid, 0, wid.p_buf_size, VSNULLSEEK, 0);
    foreach (auto sm in list) {
       if (_StreamMarkerGet(sm, info) == 0) {
           if (info.StartOffset > 27400) {
               int flags = _MarkerTypeGetFlags(info.type);
               int pri = _MarkerTypeGetPriority(info.type);
               say("Marker:"sm", Start="(info.StartOffset)", Color:"(info.ColorIndex)", Type:"(info.type)", Flags"(info.MarkerTypeFlags)", Flags2="flags", Pri="pri);

--- End code ---


[0] Message Index

[#] Next page

Go to full version