Announcement

Collapse
No announcement yet.

Indentation compare

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

  • Indentation compare

    Here's an idea that I had for a feature that I think would be handy that's a bit of a departure from anything I've seen before. I would like it if I could see if code indentation is different and I would like it differentiated from other whitespace. For example, suppose the following two blocks of code are compared:

    Code:
    if (x)
    {
      if (y)
      {
        doit();
      }
    }
    ================
    if (x && y)
    {
      doit();
    }
    I think it would be nice to see a vertical rectangle showing the difference in indentation:
    Code:
    if (x)
    {
    [COLOR="Magenta"]##[/COLOR]if (y)
    [COLOR="Magenta"]##[/COLOR]{
    [COLOR="Magenta"]##[/COLOR]  doit();
    [COLOR="Magenta"]##[/COLOR]}
    }
    I have wanted something like that on more than one occasion.

  • #2
    Well, actually, if you have Visible Whitespace showing, you do see the indent difference. However, the existing indent is matched at the front end rather than the back end (see attached screenshot).
    I'm don't know if the Scooter team would consider changing it that so the inserted indent is always at the left...???
    BC v4.0.7 build 19761
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

    Comment


    • #3
      Scooter...

      Still waiting for your thoughts on this. I've noticed it many times since my post in April:

      When there is a whitespace difference at the beginning of the line, it would be nice if BC3 showed the diff on the left. This way indents would show up as an indented block instead of some lines showing an indent and other lines showing inserted whitespace in the middle of the line. This is true for tabs as well as spaces.

      I understand that it would take a little extra logic to process leading whitespace this way, but it would greatly improve the look of indent differences when visible whitespace is enabled.
      BC v4.0.7 build 19761
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

      Comment


      • #4
        Bump (again)
        BC v4.0.7 build 19761
        ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

        Comment

        Working...
        X