Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    May 2005
    Posts
    23

    Question Syntax hilighting doesn't work in diff blocks

    Is there a way to set up the text compare colors (Tools>Options>File Views>Compare Colors) so that the syntax highlighting is visible even in difference blocks? The way it is by default, syntax works everywhere except in the diff blocks, which are red/blue.

    I'd prefer to be able to set it up so that only the background of the diff is red/blue and the letters are still syntax-highlighted. I've tried various settings but am unable to produce this effect.

    Any help is appreciated.

    Thanks,
    Alen
    Last edited by alenl; 11-Jul-2008 at 03:06 AM.

  2. #2
    Join Date
    Oct 2007
    Location
    Pennsylvania
    Posts
    1,772

    Default

    Hi Alen. There currently is no way to preserve syntax coloring in a difference section... though I agree that preserving syntax coloring and only changing the background color in difference sections would be a nice feature.
    BC v4.0.7 build 19761
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

  3. #3
    Join Date
    Oct 2007
    Location
    Pennsylvania
    Posts
    1,772

    Default

    I would expect the red/blue coloring to remain in the Text Details pane even if Syntax Coloring was retained in the main intput panes. Otherwise there wouldn't be an easy way to identify exactly what has changed in the line.
    BC v4.0.7 build 19761
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

  4. #4
    Join Date
    May 2005
    Posts
    23

    Default

    For me, it would be best to have the syntax change only the font color, while diffs change background and eventually bold the text.

    But I would expect it to be configurable, because there might be people who prefer to give more visual importance to syntax coloring more, and those who'd prefer more importance for diffs.

    Is there any chance this could make it to BC3 before final release? I mean, syntax coloring is most important in the areas where there are some changes, especially if new code is added (entire new functions), which is where you need to use more concentration to review the code, and syntax coloring helps you concentrate on the important things.

    Thanks!

  5. #5
    Join Date
    Oct 2007
    Posts
    786

    Default

    I assume you'd want one background color for lines that have a diff somewhere, and another background color for the diff itself. Is that correct?
    Tim T Scooter Software

  6. #6
    Join Date
    Oct 2007
    Location
    Pennsylvania
    Posts
    1,772

    Default

    That would make sense to me. I would call it the DIFF highlight color.
    BC v4.0.7 build 19761
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

  7. #7
    Join Date
    May 2005
    Posts
    23

    Default

    Sorry I didn't respond earlier, somehow I didn't get an email notification that there are replies. Anyway, yes the solution you offer sounds good.

    Btw, I see that the 463 build says this:

    - Added "Show syntax highlighting on difference lines" tweak.

    I have installed the 464 build and I cannot find that. Where is it?

    Thank you very much.

  8. #8
    Join Date
    Oct 2007
    Posts
    437

    Default

    1. Type [Shift+Ctrl+T] to open the Tweaks dialog.
    2. Switch to the "Text Editors" page.
    3. Check "Show Syntax highlighting on difference lines".
    4. Click "OK".


    You'll probably have to adjust your file compare colors as well.
    Erik Scooter Software

  9. #9
    Join Date
    May 2005
    Posts
    23

    Default

    Ahhhh, didn't even know that dialog exists. Thanks!

    Yes, this is better. If I enable this and make sure all syntax highlight colors are set to some color (not left on default), I will see syntax highlighting in the diff blocks. Tweaking the background colors enables me to even set it up the way Tim suggested - one background color for the chars that changed, another for the rest of the changed line.

    There is one sideeffect when set up that way - as the background color for changed chars highlights even changed spacing some strange effects happen. I have marked embedded whitespace as important, which makes it more readable, but leading whitespace and newlines (one character at the end of line) are now highlighted in blue background even on lines that are added/removed (don't exist in the other pane).

    See the screenshot:



    Since the whole lines are new, I find the blue parts before and after each line a bit odd looking, don't you think? Is this normal, and is there a way to turn it off?

    Thanks in advance for any hints.
    Last edited by alenl; 29-Jul-2008 at 08:49 AM. Reason: Cropped the screenshot

  10. #10
    Join Date
    Oct 2007
    Posts
    437

    Default

    This is intended behavior. If you make leading and trailing whitespace important, it will show in red instead of blue.
    Erik Scooter Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •