author | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 11 Nov 2006 22:52:16 +0000 (17:52 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 12 Nov 2006 05:16:01 +0000 (00:16 -0500) | ||
commit | 03e4ec5364f955f5e1af0775166c679ed60f7fb4 | |
tree | 1606cbecdadc650b4fd8db9b19bbf12733036f22 | tree | snapshot |
parent | 7d9e1d5e8a398a9ed3b782e7c2b49d1dcb5f53f7 | commit | diff |
git-gui: Always indicate the file in the diff viewer.
When we did a rescan to update the file lists we lost the tag which
indicated which file was currently in the diff viewer. This occurs
because we delete every line from the two file list boxes (thus
removing the tag) and then redisplay the diff in the diff viewer
but then fail to restore the tag in the file list.
Now we restore that tag by searching for the file in the file lists
and adding the tag back when the diff viewer displays something.
We also no longer obtain the file path directly from the file list
text box. Instead we now keep two Tcl lists, one for each file list,
holding the file names in sorted order. These lists can be searched
with the native [lsearch -sorted] operation (which should be faster
than our crude bsearch) or can be quickly accessed by index to return
the file path. This should help make things safer should we ever be
given a file name which contains an LF within it (as that would span
two lines in the file list, not one).
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
When we did a rescan to update the file lists we lost the tag which
indicated which file was currently in the diff viewer. This occurs
because we delete every line from the two file list boxes (thus
removing the tag) and then redisplay the diff in the diff viewer
but then fail to restore the tag in the file list.
Now we restore that tag by searching for the file in the file lists
and adding the tag back when the diff viewer displays something.
We also no longer obtain the file path directly from the file list
text box. Instead we now keep two Tcl lists, one for each file list,
holding the file names in sorted order. These lists can be searched
with the native [lsearch -sorted] operation (which should be faster
than our crude bsearch) or can be quickly accessed by index to return
the file path. This should help make things safer should we ever be
given a file name which contains an LF within it (as that would span
two lines in the file list, not one).
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | diff | blob | history |