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

Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
Undo doesn't work after diff
« on: September 06, 2017, 11:14:58 AM »
This happens in V21.0.3 as well as in beta 3.

Make a change to a buffer, right click on a file tab and select diff.  After the diff window opens, close it and do Ctrl-Z undo.  Slick moves the cursor to the bottom of the buffer and says "cursor movement undone".  Do ctrl-Z again and slick says "nothing to undo".

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Undo doesn't work after diff
« Reply #1 on: September 06, 2017, 12:58:57 PM »

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #2 on: September 06, 2017, 01:00:44 PM »
I explained in another thread, it's always been this way.  We will be changing it in the future.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Undo doesn't work after diff
« Reply #3 on: September 06, 2017, 06:26:08 PM »
So Dan, how many times has this "bug" been reported?
 :)

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #4 on: September 06, 2017, 06:39:56 PM »
Well, it is a "bug" in quotes.  It was a design decision made in 1996 when all the parameters of what the diff should handle were different.  Why we didn't decide to use a separate buffer at the time, I honestly don't remember.  But we also wanted the diff to perform really well on 1996 hardware, and I do remember we wanted the diff to handle a 10 megabyte file.  So if we copied that into a separate buffer, diffed it, and then took whatever changes were made and put them back, it was going to have a lot more noticeable effect on performance then.  Also, if memory serves, in 1996 a lot of products only had a few undo steps.  So we knew it wouldn't be missed as much.

Honestly, it's been roughly 21 years since the diff was put in the product, and it has come up less than you think.  I would say more in the last few years, probably because most editor controls have multiple undo steps.  I think this is the first time I remember it being reported in a beta.

mwb1100

  • Senior Community Member
  • Posts: 156
  • Hero Points: 13
Re: Undo doesn't work after diff
« Reply #5 on: September 06, 2017, 08:55:33 PM »
Just as an FYI: I've been messing around with the macro in https://community.slickedit.com/index.php/topic,9424.0.html (because I wasn't aware of the context menu item to diff the buffer against the underlying file).  That macro doesn't have the problem of clearing the undo stack.  It may have other problems that I'm not aware of.


Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #6 on: September 06, 2017, 08:59:20 PM »
That runs an external program, so there's no chance of the issues with undo I mentioned in this thread https://community.slickedit.com/index.php/topic,15495.0.html.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Undo doesn't work after diff
« Reply #7 on: September 06, 2017, 09:02:24 PM »
Thanks mwb1100! I think this will work for me - I will need to try it sometime when I have more time. I prefer Beyond Compare as my diff tool anyway.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #8 on: September 12, 2017, 02:08:47 PM »
Thanks mwb1100! I think this will work for me - I will need to try it sometime when I have more time. I prefer Beyond Compare as my diff tool anyway.

Hi... If you prefer BC, that's obviously your choice, but SlickEdit has a lot of options that BC doesn't because it's integrated with SlickEdit's context tagging.  So if you can tell me a few things you like better, maybe I could use that to improver DIFFzilla.  You could PM me if you want.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Undo doesn't work after diff
« Reply #9 on: September 12, 2017, 03:14:55 PM »
I still use Windiff sometimes - that really ancient Microsoft dev kit tool.
Things I like about it:
#1: Zebra stripes instead of side by side: This is sometimes easier to read - depends on the situation.
Ideally, DZ could toggle between side by side and zebra stripes.

#2: Allows me to change a lot of options during the diff - show same lines, show different lines, etc...
DZ makes it too hard to adjust options

#3: Commenting - I used to use this a lot of code reviews -- you can add comments during a multifile diff, then copy or save them into a plain text readable form well suited for email.
Slick Annotations could possibly do this if they worked during a diff, but there is no way to export them into a readable form.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #10 on: September 12, 2017, 03:19:50 PM »
#3: Commenting - I used to use this a lot of code reviews -- you can add comments during a multifile diff, then copy or save them into a plain text readable form well suited for email.
Slick Annotations could possibly do this if they worked during a diff, but there is no way to export them into a readable form.
Quote

So the comments aren't actually in the file?  We let you type in the file, and when I review before a big check in, I often add comments then.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #11 on: September 12, 2017, 03:20:30 PM »
#3: Commenting - I used to use this a lot of code reviews -- you can add comments during a multifile diff, then copy or save them into a plain text readable form well suited for email.
Slick Annotations could possibly do this if they worked during a diff, but there is no way to export them into a readable form.
So the comments aren't actually in the file?  We let you type in the file, and when I review before a big check in, I often add comments then.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Undo doesn't work after diff
« Reply #12 on: September 12, 2017, 05:44:52 PM »
Right, the comments are separate.
An example of text produced from commenting is below.

If slick where to produce readable comments they should be paired with a regex in ErrorParsing of course.

Quote
==============================
File:.\rehangtext.txt : .\rehangtext2.txt, Total comments:2
==============================
Comment #1, L10 of left file<9>
Reviewer comment:
    This is my comment
Source line:
    1>  i:\programming\dirlist\dirlist\dirlist.cpp(1030): note: while trying to match the argument list '(char)'
----------------------------------------------
Comment #2, L9 of right file<39>
Reviewer comment:
    This is another comment
Source line:
   
----------------------------------------------

You need version 6 or later (Windows 7 sdk I think) for this feature.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Undo doesn't work after diff
« Reply #13 on: September 12, 2017, 05:56:07 PM »
I tried this out.  It is interesting.  Is this just WinDiff's format?

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Undo doesn't work after diff
« Reply #14 on: September 12, 2017, 06:04:05 PM »
Yeah as far as I know.
I've never seen this done in any other diff tool.
Its a shame, as it is really useful - if just a bit old school.

gitlab merge requests support something really similar (commenting on diffs), but it is all web based and must be part of a merge -- it isn't done as a standalone diffing tool.
If your team is using gitlab, then its great of course.

The thing I hate about gitlab / git diffing in general is their insistence on only showing the diffs, which leaves out so much context that it can be hard to make sense of things. Sometimes the compact listing is nice, but for a good code review you really need to see the context.