Author Topic: Undo doesn't work after diff  (Read 33639 times)

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #15 on: September 12, 2017, 06:28:00 PM »
I agree.  We may one day add an option to collapse matching sections (since you can edit in the diff in our product it gets a little harder), but personally I won't use it, I like to see what surrounds it.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Undo doesn't work after diff
« Reply #16 on: September 12, 2017, 08:39:21 PM »
Dan: Thanks for asking!

The attached 2 png files illustrate some of the things that I like better about BC vs DIFFzilla:

1. BC can show a left/right line one on top of the other while highlighting differences, DIFFZilla does not do this.

2. BC has "Minor" button, to allow me to ignore or not ignore unimportant differences (like comments or spacing differences), so that when I click "previous"/"next", I only go to the next non-commented code change.

3. BC was able to align lines 1254 and 1347, but DIFFZilla did not align them.

4. BC has swap button to allow to swap left/right sides.

5. BC has "Diffs" and "Same" button, so that we can see on the screen only the different lines, or only the same lines.

6. The way BC handles "imaginary buffer line" is more visually pleasing.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Undo doesn't work after diff
« Reply #17 on: September 12, 2017, 08:53:10 PM »
Another thing BC does is I can point it to 2 directories and it will scan both directories and find which files are different. Then I can double click on each different one and inspect it. See attached screenshot.

Not sure if DIFFZilla does that as it is mainly in the context of an editor.

I use this directory diff all the time, so then I get used to the BC user interface. If I used BC for directory diff (and then drill into files), but only use DIFFZilla for file diff, then I have to get used to the User interface of 2 different tools.

BC also does 3 way merge which is useful when I am updating my working version of source code. Not sure DIFFZilla supports 3 way merge.

So since I use BC for directory diff and 3 way merge, which I'm not sure DIFFZilla supports, not sure it is worth it for me to learn the UI of another tool.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #18 on: September 12, 2017, 08:59:26 PM »
Dan: Thanks for asking!

The attached 2 png files illustrate some of the things that I like better about BC vs DIFFzilla:

1. BC can show a left/right line one on top of the other while highlighting differences, DIFFZilla does not do this.

Let me say from the start, of the standalone diff products I've seen out there, I thing BC is really good.

I suppose we could add something like that.  I think a long time ago, BC didn't let you edit in place, so that was why they had those text boxes at the bottom.  Nobody ever asked for this just as a visual.

2. BC has "Minor" button, to allow me to ignore or not ignore unimportant differences (like comments or spacing differences), so that when I click "previous"/"next", I only go to the next non-commented code change.

Have you tried SlickEdit's Source Diff?  It is different, you have to turn it on before you run the diff, and there is a different option to skip comments.

3. BC was able to align lines 1254 and 1347, but DIFFZilla did not align them.

You can right click and use align-with... but this is probably a difference in how the diff algorithm has been tweaked in each product.  There may be a place where we did a better job (or maybe there isn't, but it's probably just a tweak to the algorithm).

4. BC has swap button to allow to swap left/right sides.

Nobody ever asked for this.  It's something we can consider if there's a big draw for it.

5. BC has "Diffs" and "Same" button, so that we can see on the screen only the different lines, or only the same lines.

This is something we can add and I see the value in it.  Myself, I like to see the context around the difference, and just use next and prev difference, but this is something we've talked about adding.

6. The way BC handles "imaginary buffer line" is more visually pleasing.

It is.  We were talking about this earlier.

We also want to add buttons in the margins copy blocks back and forth.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Undo doesn't work after diff
« Reply #19 on: September 12, 2017, 09:13:33 PM »
Attached is another difference showing how BC shows "unimportant" (comments and spacing) as "blue", while it shows "important" (like code) in red.

Also, I see that DIFFZilla does have a directory compare, but BC allows me to save "sessions", where I can specify file patterns and directory patterns to ignore. This is real important because the build can put many files into the directory structure that I don't want showing up. Does DIFFZilla directory compare allow to ignore file/directory patterns and to save these into a "diff session"?

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #20 on: September 12, 2017, 09:14:53 PM »
Another thing BC does is I can point it to 2 directories and it will scan both directories and find which files are different. Then I can double click on each different one and inspect it. See attached screenshot.

Not sure if DIFFZilla does that as it is mainly in the context of an editor.

I use this directory diff all the time, so then I get used to the BC user interface. If I used BC for directory diff (and then drill into files), but only use DIFFZilla for file diff, then I have to get used to the User interface of 2 different tools.

BC also does 3 way merge which is useful when I am updating my working version of source code. Not sure DIFFZilla supports 3 way merge.

So since I use BC for directory diff and 3 way merge, which I'm not sure DIFFZilla supports, not sure it is worth it for me to learn the UI of another tool.

It does, you just choose "Compare Two Folders" and give the paths, filespecs, and exclude filespecs.  You can also use a file list.  Also, for source files, you can expand the file and see which functions have changed.  Double clicking on the file will diff those two files.  Double clicking on a function will diff just that function, and if you make changes it will overlay them inside the file.  I don't believe any other product does this, because it uses SlickEdit's context tagging.



Also we do have a three way merge, Tools>File Merge.

Also, both diff and merge have command line programs in the SlickEdit\win directory.

https://www.youtube.com/watch?v=XhoZT0qyW0w
« Last Edit: September 12, 2017, 09:27:28 PM by Dan »

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Undo doesn't work after diff
« Reply #21 on: September 12, 2017, 09:20:20 PM »
Quote
1. BC can show a left/right line one on top of the other while highlighting differences, DIFFZilla does not do this.
Quote
Let me say from the start, of the standalone diff products I've seen out there, I thing BC is really good.

I suppose we could add something like that.  I think a long time ago, BC didn't let you edit in place, so that was why they had those text boxes at the bottom.  Nobody ever asked for this just as a visual.

I find it really helpful as a visual, it is probably the main reason I like BC over DIFFZilla.

Quote
2. BC has "Minor" button, to allow me to ignore or not ignore unimportant differences (like comments or spacing differences), so that when I click "previous"/"next", I only go to the next non-commented code change.
Quote
Have you tried SlickEdit's Source Diff?  It is different, you have to turn it on before you run the diff, and there is a different option to skip comments.

I haven't explored it much yet, but the dialog asking to turn on/off source diff confuses me. In BC I can just use the "minor" button.

Quote
BC has swap button to allow to swap left/right sides.
Quote
Nobody ever asked for this.  It's something we can consider if there's a big draw for it.

Actually I do remember it being asked for here ;) : https://community.slickedit.com/index.php/topic,14830.msg58540.html#msg58540

Quote
BC has "Diffs" and "Same" button, so that we can see on the screen only the different lines, or only the same lines.
Quote
This is something we can add and I see the value in it.  Myself, I like to see the context around the difference, and just use next and prev difference, but this is something we've talked about adding.

BC has a "context" button, looks like you can configure it to specify how much context you want around (how many lines before/after). I don't use this feature much though, I generally like to look at the whole file.


Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #22 on: September 12, 2017, 09:20:23 PM »
Attached is another difference showing how BC shows "unimportant" (comments and spacing) as "blue", while it shows "important" (like code) in red.
Have you tried SlickEdit's Source Diff?  It has an option to not compare comments.  It also has options to map one token to another.  This can come in handy in certain cases.

Also, I see that DIFFZilla does have a directory compare, but BC allows me to save "sessions", where I can specify file patterns and directory patterns to ignore. This is real important because the build can put many files into the directory structure that I don't want showing up. Does DIFFZilla directory compare allow to ignore file/directory patterns and to save these into a "diff session"?

Also, SlickEdit saves named and unnamed sessions for both regular and multi-file diffs.  I highlighted it in red on the screenshot.  This is just the editor I'm using, so I don't have any named ones.
« Last Edit: September 12, 2017, 09:22:29 PM by Dan »

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #23 on: September 12, 2017, 09:39:19 PM »
Since we're talking about diff features, I thought I'd throw out some that people might not know about.  Some of these only SlickEdit has because they use SlickEdit's context tagging engine.


Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #24 on: September 12, 2017, 09:44:46 PM »
Quote
1. BC can show a left/right line one on top of the other while highlighting differences, DIFFZilla does not do this.
Quote
Let me say from the start, of the standalone diff products I've seen out there, I thing BC is really good.

I suppose we could add something like that.  I think a long time ago, BC didn't let you edit in place, so that was why they had those text boxes at the bottom.  Nobody ever asked for this just as a visual.

I find it really helpful as a visual, it is probably the main reason I like BC over DIFFZilla.

Quote
2. BC has "Minor" button, to allow me to ignore or not ignore unimportant differences (like comments or spacing differences), so that when I click "previous"/"next", I only go to the next non-commented code change.
Quote
Have you tried SlickEdit's Source Diff?  It is different, you have to turn it on before you run the diff, and there is a different option to skip comments.

I haven't explored it much yet, but the dialog asking to turn on/off source diff confuses me. In BC I can just use the "minor" button.

Quote
BC has swap button to allow to swap left/right sides.
Quote
Nobody ever asked for this.  It's something we can consider if there's a big draw for it.

Actually I do remember it being asked for here ;) : https://community.slickedit.com/index.php/topic,14830.msg58540.html#msg58540

Quote
BC has "Diffs" and "Same" button, so that we can see on the screen only the different lines, or only the same lines.
Quote
This is something we can add and I see the value in it.  Myself, I like to see the context around the difference, and just use next and prev difference, but this is something we've talked about adding.

BC has a "context" button, looks like you can configure it to specify how much context you want around (how many lines before/after). I don't use this feature much though, I generally like to look at the whole file.

What does Minor skip over?  It looks like it affects the whole file, but I don't understand what it skips.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Undo doesn't work after diff
« Reply #25 on: September 13, 2017, 02:02:09 AM »
In DIFFZilla, you have the "Next Diff" and "Prev Diff" buttons. In BC the equivalent are buttons on the main toolbar: "Next Section" and "Prev Section". "Skipping" means that when pressing "Next Diff", it will skip any of the "unimportant" blocks to go to the next important difference section.

In BC, with "Minor" off, sections that have unimportant diffs (comments and spacing) are marked in blue. Sections that have important diffs are marked in pink - I like the different colored sections. The equivalent in DIFFZilla of "Minor" set to "off" is to not use Sourcediff, in this case, both important and unimportant sections are both marked in the same color (red), with no differentiation. I like that I can see the difference in BC. Only with Sourcediff set to ON in DIFFZilla will I see the unimportant sections marked in a different color (green), then they will get "skipped" in "next/prev diff".

With "Minor" off, when I click on BC's equivalent of "Next Diff" or "Prev Diff", I go to the next diffed section, no matter whether it is blue (unimportant) or pink (important).

With "Minor" on, the unimportant sections are not shown, so instead of blue, BC doesn't highlight that it is different at all. So when clicking on "Next Diff", it will skip past the blue (unimportant) sections.

For example, if diff section 1 is important (pink), diff section 2 is un-important (blue), diff section 3 is important (pink), if I'm currently at section 1 then if "Minor" is "off", clicking "Next section" will take me to section 2. But if "minor" is "on", clicking "Next section" will take me to section 3, as diff section 2 is no longer highlighted, so diff section 2 is "skipped" - this is what I meant by the skipping.

With DIFFZilla, if I want to do the equivalent of pressing the "Minor" button in BC, I have to close my diff and restart it with source diff the opposite way. But with BC I can just click on the "Minor" button, don't need to close and reopen my diff session.

Also with DIFFZilla, I get a confusing message about having a read only copy of file 2 in order to get source diff. So this means I can't edit file 2 then in DIFFZilla with sourcediff turned on? In BC I can edit file 2 with "Minor" on or off.

In DIFFZilla, with source diff turned on, I still see a highlight (in green) that the "unimportant" section is changed, although it does get skipped with "Next Diff". But in BC with "Minor" set to "off", there is no highlight marking it anymore, so I'm not distracted by unimportant sections when I don't want to be. I don't want unimportant sections highlighted when doing the equivalent of "Minor" set to "off".

Also in BC, the red and blue markings use the background color of the entire text section, and the actual text differences are highlighted in a different color. In DIFFZilla, only the text characters that are different are highlighted, not the background color.
« Last Edit: September 13, 2017, 02:04:53 AM by rowbearto »

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #26 on: September 13, 2017, 02:14:15 AM »
Ok, I understand the convenience of what they've done.  Keep in mind that source diff works for every language we support.

Also, you can click a button at the bottom to toggle source diff and line diff.  This isn't a perfect solution.

Always determining what is unimportant (source diff, and having a toggle button whether or not to skip those lines) would have an effect on performance.  You may find our diff is faster.  Although in my testings, sometimes source diff was actually faster.  Also, they're "unimportant"  logic may be less intense than what we do for source diff. Does it do a whitespace, or just comments?

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Undo doesn't work after diff
« Reply #27 on: September 13, 2017, 02:15:57 AM »
BCs unimportant logic is both spacing and comments. I find it to be very very fast, I have no issues with BCs performance.

Also, attached is a picture illustrating the differences from my last post.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Undo doesn't work after diff
« Reply #28 on: September 13, 2017, 02:19:39 AM »
Another minor detail about something I like in BC, for the equivalent of DIFFZilla "Block>>", "Line>>" buttons, in BC I right click on a line and I get a menu of these options. I prefer this a little more because its closer on the screen to where I'm actually working.

I see the button to toggle source diff on and off now. Just tried it and while it does the job, the diff briefly flashes off the screen and then flashes back on, like you are closing/reoping the diff. Toggling "minor" in BC is much smoother.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Undo doesn't work after diff
« Reply #29 on: September 13, 2017, 02:21:28 AM »
Also, in BC if I have a section with say 3 changed lines, if I only want to copy 2 of those lines to the other side, I just highlight those 2 lines out of the 3, right click and select "Copy line to right". I don't see how I can do a subsection in DIFFZilla.