Previously searching would filter the commits in the commit tableview to only show the commits that matched the search. However the context of where those commits exist in the history is lost.
With this patch all the commits are shown but the commits that match the search are highlighted with a light blue background. In addition there is a forward/back button to step through the matches.
A new search controller:
- keeps track of the matching results
- finds the next or previous result
- displays the number of matches found or "Not found"
- shows/hides the # of matches text and the next/last stepper button
- shows a small bezel style window with a rewind icon indicating that the selection has cycled (pressing next when at the last match or previous when at the first)
- sets up the search predicate which covers Subject, Author and SHA (previously this was three different searches)
- stores search results in an NSIndexSet to make finding if a row is in the set faster (needed at drawing time)
Highlighting of search result rows is done in PBCommitList -drawRow:clipRect:
PBGitTextFieldCell is a subclass of NSTextFieldCell that disables the cell's selection highlighting.
Supporting Find Next and Find Previous (cmd-g and cmd-shift-g) menu commands required changing the action method of the menu items because NSTextFields (seem to) actively disable items in the Find menu.
rewindImage.pdf created by Nathan Kinsinger
If the current branch filter is switched to "All" or "Local" the index that's
calculated as being the targeted index to scroll to visible, is off by the amount
in Y that the bottom split view separator is off from a multiple of rows.
-adjustScroll: on PBCommitList is called automatically whenever the list needs
laying out.
An ivar keeps track if we come from the -scrollSelectionToTopOfViewFrom: method
of PBGitHistoryController.
I'll leave the commented out NSLogs in there in case they're needed for debugging
again later.
In 10.6 Apple removed the private QL API that existed in 10.5 and added a new public API. However they did not port the new API back to 10.5 so we have to do some work to get it working in both.
This patch has GitX choose the correct version at run time.
- The delegate code is based on Apple's QuickLookDownloader example project
- added three of the public API methods to CWQuickLook.h to avoid warnings about unknown method calls
- In ApplicationController try to load the public API first then load the private one if it fails
- Created PBQLTextView, a subclass of NSTextView to allow the space key event to toggle the preview panel
- PBGitHistoryView.xib:
- set the text view's class to PBQLTextView
- connected the history controller to the controller outlet
- bound the quick look button's enabled binding to File's Owner.selectedCommitDetailsIndex
- added "Quick Look" to the quick look button's tooltip
- The commit list table view toggles the panel if the tree view is active
- changed name of the toggle IBAction method which caused MainMenu.xib and PBGitHistoryView.xib to update
When the Subject column is not the first column in the git history table the contextual menu for refs and dragging and dropping refs don't work.
Offset the mouse click's x value by the x origin of the Subject column.
In PBRefController look up the column index of the subject column and check that it's the clicked column (don't assume it's the first one).
This adds a method to programmatically collapse/uncollapse the two
subviews of our custom SplitView-class. It also implements a
keyDown-method so that the collapsing can be used with
Command-Shift-{Up,Down}.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
That's why it's there, after all. This also makes the system
more robust and catches some more errors.
The next thing this enables is to also allow right-clicking
on refs in the commit list.