Author Topic: was : undo doesn't work after diff  (Read 621 times)

Graeme

  • Senior Community Member
  • Posts: 2279
  • Hero Points: 296
was : undo doesn't work after diff
« on: September 15, 2017, 01:50:51 pm »
This is a follow up to https://community.slickedit.com/index.php/topic,15501.msg59395.html#msg59395
since I kind of gate-crashed that thread.
Quote
Quote from: Graeme on 14 September 2017, 00:59:40
Maybe you could add "diff a range of lines" to this list.  I use the xcompare_diff_region I posted here quite a lot.  I would be happy if you added these to slickedit.  I know you can do it through the diff dialog but it's quite laborious.
https://community.slickedit.com/index.php/topic,11186.msg47177.html#msg47177
The problem here is that there can only be one selection in SlickEdit.  So you can't select two different line ranges then diff.  Have you tried the drop down? It will bring up the file for you to select.

Nope there's no problem.  Obviously you didn't try my code or read the notes.  Select the first region, bring up the xxutils menu and select "set diff region".  Select the second region, bring up the xxutils menu and select "compare diff region".  You don't actually have to select anything - it will compare 50 lines or something if you don't select anything.  Going through the diff dialog then hunting for the text you want to compare takes a prohibitively long time.  One of the reasons I use exam-diff-pro as an external diff tool is that it has right click explorer context options for "select first file to compare" and "compare with first file".

Quote
Quote from: Graeme on 14 September 2017, 00:59:40
2) Make a change to the current file without saving it, then diff two files, one of which is the file you just changed - and using "compare symbols all".  The buffer you had open loses the changes you made and gets some green highlighting in the places you had changed.  Now do it again but this time, save the buffer before you run the diff.  Diffzilla says "no differences" and the buffer somehow loses the changes you just made and saved  - it does on my machine anyway.

I can't reproduce this one.  Did you actually diff a symbol?  Were you diffing two files, or diffing with version control?
 
I was diffing two identical slick C files with the same name in two different folders both of which are open in the editor.  Now that I come to think of it  - that might be what the problem is.  Maybe the diff tool is getting confused because there are two files/buffers with the same name.  I'm getting some slightly different behaviour now.  Starting with two identical files with the same name in different folders and both open in slick.  Insert a couple of blank lines in one of them but don't save, bring up diff with Ctrl-S-=, select compare files and "compare symbols".  Click diff, slick says no differences then brings up the multi-file diff window with nothing in it.  Close the window and now slick has magically made the same changes (extra blank lines) to the other copy of the file which I never changed !!!!!!!!!  Yikes.  And it has some green highlighting in it.

Quote
Quote from: Graeme on 14 September 2017, 00:59:40
3) When you diff two files and select "compare symbols all" for path one, for path two you can't select "compare symbols all".  I'm not sure why path two even has a dropdown list for this ??.

When you select "Compare Symbols: All", that's what it's going to do, so it just doesn't care what you pick in the second combobox.
 
The second one should be grayed out if it's ignored because it's confusing.  Why is it even there?


Quote
Quote from: Graeme on 14 September 2017, 00:59:40
4) Diff two files on disk one of which is open, diffzilla pro opens with the file on the right (the one that is open) marked as read only (why?).  When you right click in the right hand pane and select "edit file", slick ignores you and keeps diffzilla open.

Are you running vsdiff externally?
  Nope.  Open two files in slick, use Ctrl-S-= to bring up diff and select compare files, compare all lines, and enter paths to the two files, click diff, slick says it will use source diff, then it says "files match" -> view anyway -> now the window on the right has read-only ticked (the one on the left doesn't), use right click -> edit file  - nothing happens.



Graeme

  • Senior Community Member
  • Posts: 2279
  • Hero Points: 296
Re: was : undo doesn't work after diff
« Reply #1 on: September 16, 2017, 09:18:37 am »
Also, the context menu in an edit window could have a "diff" option with a sub-menu of the following

1. select first file to diff (whatever.123)
2. diff with first file (whatever.123)
3. select first function to diff (whatever)
4. diff with first function whatever
5. select first lines to diff (50)
6. diff with first lines

For item 5, if there are selected lines, put the number of selected lines that will be diffed, otherwise put a default value.

Graeme

  • Senior Community Member
  • Posts: 2279
  • Hero Points: 296
Re: was : undo doesn't work after diff
« Reply #2 on: September 18, 2017, 10:09:47 am »
Also option 7,8
7. diff with file at startup
8. diff here with file at startup

Option 7 diffs the current buffer with the version of the file as it was when slick started.
Option 8 is same as 7 except the diff positions the current line at the same line as in the open buffer. i.e. show me what I changed in this code today.