Page 1 of 1
DUal pane: select a file in both panel
Posted: 17 Feb 2010 15:28
by carmenm
Hi,
I just had to make a diff between two files from 2 different directories. My first thought was to activate dual pane and try to select both file. But obviously there is no way to do that right now.
Is there any way to make both panel active? so that we can do things like selecting files in both panel.
I almost sure of the answer but it was worth asking

and may be you will give a better way to do it
Thanks a lot
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 15:40
by j_c_hallgren
carmenm wrote:I just had to make a diff between two files from 2 different directories. My first thought was to activate dual pane and try to select both file. But obviously there is no way to do that right now.
There
is a way to do it currently (unless you meant something else)! Just select the first file to be compared on pane 1, then select the second file on pane 2, and then use Edit>Compare>Compare current file on both panes...just because pane 1 becomes inactive when you move to pane 2 does NOT mean that the file selected there is no longer available for this function.
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 15:53
by carmenm
Ok good to know about file still being selected. My problem is that i dont want to use the compare from XY but the diff from tortoiseSVN.
It works when selecting 2 files from the same panel, but sadly it doesnt work with dual panes :s
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 16:00
by TheQwerty
You'll need to script it and do something similar to...
Code: Select all
"Compare Paths"
Global($g_LEFT, $g_RIGHT);
$g_LEFT = GetInfo("Path", "a");
$g_RIGHT = GetInfo("Path", "i");
Sub("_doCompare");
"Compare Focused"
Global($g_LEFT, $g_RIGHT);
$g_LEFT = "<focitem>";
Focus("PI");
$g_RIGHT = "<focitem>";
Focus("PI");
Sub("_doCompare");
"_doCompare"
Global($g_LEFT, $g_RIGHT);
Open("""..\Beyond Compare 3\BCompare.exe"" ""$g_LEFT"" ""$g_RIGHT""");
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 16:09
by j_c_hallgren
carmenm wrote: My problem is that i dont want to use the compare from XY but the diff from tortoiseSVN.
Oh..ok...you didn't specify that in your OP...that's why I answered as I did...but at least you know that the built-in XY compare works for this situation now.
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 16:12
by carmenm
Thanks for the script TheQwerty!
@ j_c_hallgren: sorry i should have mentioned it, i wasnt even remembering that XY could do compare ...
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 16:24
by TheQwerty
I call that script "ComPain," get it?!?
Just wanted to point out (in case it wasn't clear) that it will always use the active pane for the left side, which can sometimes be confusing if you don't pay attention and expect the items to be on the same sides as they were in XY.
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 16:59
by j_c_hallgren
TheQwerty wrote:You'll need to script it and do something similar to...
Remembering that I don't write scripts, so I tried this one adapting it to use my "ExamDiff" (freeware that seems to now be somewhat discontinued) but it just seems to ignore the Open cmd...I get no errors and the pgm doesn't execute...script just ends..any ideas?
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 17:25
by serendipity
j_c_hallgren wrote:TheQwerty wrote:You'll need to script it and do something similar to...
Remembering that I don't write scripts, so I tried this one adapting it to use my "ExamDiff" (freeware that seems to now be somewhat discontinued) but it just seems to ignore the Open cmd...I get no errors and the pgm doesn't execute...script just ends..any ideas?
OK, I dont use ExamDiff, but looking at their command line options, this should work for comparing two selected files in two panes.
Code: Select all
$pane1= <curitem>;
focus PI;
$pane2= <curitem>;
open """C:\Program Files\ExamDiff\ExamDiff.exe"" $pane1 $pane2";
If that does not work, I would try replacing the last line with this:
open """C:\Program Files\ExamDiff\ExamDiff.exe"" ""$pane1"" ""$pane2""";
Just a try.
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 18:00
by j_c_hallgren
Thanks serendipity! Here's what they give as options:
Code: Select all
-Command line options include:
Usage: ExamDiff [Filename1] [Filename2] [Options]
Filename1, Filename2 are names of files to be compared
Options are any of:
/i ignore case
/w ignore all white space in lines
/b ignore changes in amount of white space in lines
/l ignore leading white space in lines
/e ignore trailing white space in lines
/t treat both files as text files
/d show differences only
/n don't show initial "Compare Files" dialog
/sd always show initial "Compare" dialog, even if
two filenames are used
/aN scroll trough all differences with N second delay
and exit after the last difference
/?,/h print this screen
NOTE: if options /i, /w, /b, /l, /e, /t, or /d are not set,
the last used options remain in effect.
So I tried
Code: Select all
$pane1= <curitem>;
focus PI;
$pane2= <curitem>;
focus PI;
open """C:\Program Files\ExamDiff\ExamDiff.exe"" ""$pane1"" ""$pane2"" ""/n""";
which worked and went directly to compare...
I added the second "focus" to reset it back to original pane (right?) based on TheQwerty's vers.
BTW, I did find a link to the old freeware vers in their support forums:
http://www.prestoforums.com/viewtopic.php?f=2&t=495
It has served my basic needs for a text file compare for quite some time.
Upd/Addendum: Dumb question: How would this be adapted to compare two selected files on same pane?
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 19:45
by serendipity
j_c_hallgren wrote:Thanks serendipity!
Glad it helped.
j_c_hallgren wrote:
Upd/Addendum: Dumb question: How would this be adapted to compare two selected files on same pane?
This should do.
Code: Select all
$items=getinfo("SelectedItemsPathNames", "+");
$item1=gettoken ($items,1,"+");
$item2=gettoken ($items,2,"+");
open """C:\Program Files\ExamDiff\ExamDiff.exe"" ""$item1"" ""$item2""";
Re: DUal pane: select a file in both panel
Posted: 17 Feb 2010 20:05
by j_c_hallgren
Yup...that worked fine...so I put both within one UDC as
Code: Select all
"Compare same pane"
$items=getinfo("SelectedItemsPathNames", "+");
$item1=gettoken ($items,1,"+");
$item2=gettoken ($items,2,"+");
open """C:\Program Files\ExamDiff\ExamDiff.exe"" ""$item1"" ""$item2"" ""/sd""";
"Compare dual pane"
$pane1= <curitem>;
focus PI;
$pane2= <curitem>;
focus PI;
open """C:\Program Files\ExamDiff\ExamDiff.exe"" ""$pane1"" ""$pane2"" ""/sd""";
I added the "/sd" to get the initial pgm prompt so I can tweak compare opts if I want before it runs or cancel it out.
Thanks again!
