Announcement

Collapse
No announcement yet.

Syntax hilighting doesn't work in diff blocks

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 04:06 AM.

  • #2
    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
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

    Comment


    • #3
      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
      ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

      Comment


      • #4
        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!

        Comment


        • #5
          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

          Comment


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

            Comment


            • #7
              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.

              Comment


              • #8
                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

                Comment


                • #9
                  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, 09:49 AM. Reason: Cropped the screenshot

                  Comment


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

                    Comment


                    • #11
                      Hm, yes, I thought it would make it impossible to see indentation changes that way, but they are just visible in red now, which is ok-ish. Btw, to completely get rid of the blue parts in the above example, the option "orphan lines are always important" needs to be selected as well.

                      I can live with this for now, but this way I actually make all whitespace everywhere and all orphan lines important. Generally, I would prefer to have some separate options to make whitespace elements important only in "important" orphan lines (i.e. those orphan lines that have at least some other important elements - keyword, base text, i.e. not comments).

                      Thanks!

                      Comment


                      • #12
                        Originally posted by Erik View Post
                        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.
                        Awesome just what I needed!

                        Comment


                        • #13
                          In BC4, we also worked to help expose our Tweaks a bit more: Options dialog, Tweaks section, and this is the first option in our 'Editor Display' section.
                          Aaron P Scooter Software

                          Comment

                          Working...
                          X