Commit Graph

3498 Commits

Author SHA1 Message Date
Allan Odgaard
15d57f7aed Checkin release notes v2.0-beta.7.7 2015-07-31 12:49:32 +02:00
Allan Odgaard
98206004dc Support fallback units for multiple carets
For example a command that works on selection but falls back to current word will now also work with multiple carets.
2015-07-31 12:37:29 +02:00
Allan Odgaard
755a9e1f7e Look at all carets to decide if there is a selection
Previously we only looked at the last caret, and if this one was not a selection then we would treat the multiple carets (selection ranges) as nothing being selected, and thus, a command replacing the carets, would not leave anything selected.
2015-07-31 12:18:53 +02:00
Allan Odgaard
3047212ed2 Use empty last line from commands working on multiple selections
When pasting or using Filter Through Command with multiple carets, we ignore a potential final empty line, this is because our text will be something like “foo\nbar\n” and we split on the newline, so we end up with (“foo”, “bar”, “”) and if we have more than two carets, then we insert the empty string for every third caret.

For a command though we expect there is a 1:1 between number of carets and newlines in the result, so we should never skip the last element.
2015-07-31 12:01:46 +02:00
Allan Odgaard
58bacfb763 Command with multiple selections would never select output
This now uses the same logic as with a single selection.
2015-07-31 11:48:56 +02:00
Allan Odgaard
0aa9cd8166 Don’t skip binary files when using Find All with open documents 2015-07-31 11:29:42 +02:00
Allan Odgaard
b440a8681f Remove OakImageAndTextCell class 2015-07-30 22:18:39 +02:00
Allan Odgaard
2a9220c570 Update dialog plug-in (add own image and text cell) 2015-07-30 22:18:07 +02:00
Allan Odgaard
f2387c9bc3 Ensure that the outline view’s clicked row is valid
The problem is if we right-click an item that causes content to be changed (e.g. Show Enclosing Folder) then later in the same run loop cycle ask for selected items, we prefer the clicked row, but this one might now no longer exist.
2015-07-30 22:00:06 +02:00
Allan Odgaard
14a1110199 Don’t pass NSTableCellView to OakFileManager
The view passed to the file manager is used to request the undo manager. The problem with using an NSTableCellView instance is that this view may be taken out of the view hierarchy (and thus responder chain) which makes it lose its undo manager.

This isn’t an immediate problem but if we later use undo/redo, it might be.
2015-07-30 21:56:00 +02:00
Allan Odgaard
a92b34fcaa Prefer insert/removeItemsAtIndexes: over reloadItem:
This way we only have to abort editing if the item being edited is going away.

View-based table views do not supported editedRow so this commit also change the way to figure out if a row is being edited.
2015-07-30 14:12:07 +02:00
Allan Odgaard
8abf5f2c9a Improve selection in file browser after deleting items
Previously if we deleted an expanded folder it would select the first child of this item which would then be removed and leave nothing selected.

There are still a few edge-cases left though where what’s selected after deleting items is not ideal.
2015-07-30 14:12:07 +02:00
Allan Odgaard
f0f056318d Update scmStatus and missing FSItem properties in SCM data source 2015-07-30 14:12:07 +02:00
Allan Odgaard
ecf8cbc0bf Never update OakFileIconImage states that are not marked dirty 2015-07-30 14:12:07 +02:00
Allan Odgaard
9cb059fa7b Move FSFileItem’s missing property to superclass 2015-07-30 14:12:07 +02:00
Allan Odgaard
16363f3aa0 Let the SCM data source re-use its FSItem instances 2015-07-30 14:12:07 +02:00
Allan Odgaard
bf9102f789 Re-use FSFileItems that represent missing files 2015-07-30 14:12:07 +02:00
Allan Odgaard
d40d9b0f24 Draw white circle around label swatch when row is selected
We previously did this when the background style was set to dark, but the code for this only works when the view is a direct descendent of the NSTableCellView and also, when a row is selected in an inactive table view, the background style is not set to dark.
2015-07-30 14:12:06 +02:00
Allan Odgaard
5b357d58c2 Track open state in FSItem
This eliminates the need for the last binding that was causing a retain cycle.
2015-07-27 18:45:32 +02:00
Allan Odgaard
79d012dba2 Dynamically create and dispose close button and label view 2015-07-27 18:44:49 +02:00
Allan Odgaard
a2052592ef Move construction of open/close buttons to table cell view
This gives us a bit more flexibility which we will need to properly toggle the close button.
2015-07-27 18:43:36 +02:00
Allan Odgaard
297c1c7ea5 Limit the tab bar items’ tool tips to the title string
This prevents having a tool tip show when hovering the close button (as can often happen when closing multiple tabs).
2015-07-27 18:43:14 +02:00
Allan Odgaard
0c2a8b7e0c File browser’s undo/redo menu items only worked when it had focus
We only want to use first responder’s (local) undo manager when the first responder is a descendent of the file browser itself, e.g. the field editor.
2015-07-27 18:42:03 +02:00
Allan Odgaard
33d5538967 Make the datasource setter more robust
Previously it would throw an exception if datasource was set to nil after the outline view had been disposed.
2015-07-27 18:40:38 +02:00
Allan Odgaard
2d1804fc4c Don’t handle “item did reload” notifications for leaf items
In the view-based system all changes to a single item should be done by updating the properties of this item.
2015-07-27 18:39:43 +02:00
Allan Odgaard
e52efd5486 Avoid binding each table cell view to the modifiedURLs property
This removes a retain cycle though we still have one left caused by the openURLs property.
2015-07-27 18:39:37 +02:00
Allan Odgaard
f66abfa33d Add isModified property to FSItem 2015-07-27 18:39:26 +02:00
Allan Odgaard
b67713e9e5 Add custom view to draw label swatch
This mimics the new look used by Finder and we also fix a retain cycle by not binding to ‘self’ for the labelIndex property.
2015-07-27 18:39:25 +02:00
Allan Odgaard
161ffdc3fc Remove “cut” from file browser’s menu
It’s still possible to use ⌘X but I will probably remove the functionality in the future.
2015-07-24 23:41:06 +02:00
Allan Odgaard
909e36b516 Support using ⌥⌘V in file browser to “move” an item
This is consistent with Finder and slightly more flexible as it allows copying items in Finder and pasting them in TextMate via ⌥⌘V.
2015-07-24 23:34:05 +02:00
Allan Odgaard
8910b395f9 Include number of items on pasteboard in menu item title 2015-07-24 23:24:14 +02:00
Allan Odgaard
90ab3749d9 Setup proper truncation for file browser’s text field 2015-07-23 21:54:20 +02:00
Allan Odgaard
828f6fdd37 Remove reference to OakView.h 2015-07-23 21:50:47 +02:00
Allan Odgaard
f675008402 Mark file browser as needing display after reloading items
After changing root item it often fails to redraw itself, so this is a workaround for what appears to be a framework bug.
2015-07-23 13:18:02 +02:00
Allan Odgaard
22acd31b25 Skip reloading file browser items if items are unchanged
The comparison is somewhat shallow, but ideally all changes to the actual items (rather than adding or removing items) is done by updating the properties of the existing instance. The exception here is the SCM Status data source, but FSItem’s isEqual: method does compare scmStatus.
2015-07-23 13:13:09 +02:00
Allan Odgaard
b8906248bd Don’t post “item did reload” notification for property changes 2015-07-23 13:08:09 +02:00
Allan Odgaard
f5358c79e4 Remove OFBPathInfoCell 2015-07-23 13:06:39 +02:00
Allan Odgaard
5b30416083 Switch file browser to be view-based (instead of cell-based)
One issue with the view-based version is that there seems to be no hook where we can update the text prior to edit, so in the SCM Status view where item names are disambiguated, editing the item will cause the disambiguated name to be used as basename.

The view-based version is also more eager to start editing rows, for example the “click a selected item to move focus to file browser” now also trigger renaming of that item, which is rather undesirable.

A few other pending issues also remain, like better rendering of labels, not adding a (hidden) close button to each row, and ensuring FSItem instances are re-used when possible (e.g. SCM data source).

The way we mark items as modified or open is also suboptimal, as it’s partly done via bindings and partly manual.
2015-07-23 12:59:25 +02:00
Allan Odgaard
e3ad1440e1 Prefer the clicked row when triggering edit of a row 2015-07-23 12:54:16 +02:00
Allan Odgaard
34ebabdc87 Call abortEditing on outline view instead of cancelOperation
I’m not sure if it is necessary to manually refocus the outline view after aborting the field editor, does seem like a bug and will most likely not be present for view-based outline views.
2015-07-23 12:50:21 +02:00
Allan Odgaard
58dc3070ba Move label color change to FSItem 2015-07-23 11:49:24 +02:00
Allan Odgaard
12fdcefb14 Don’t rely on cached display name when requesting a rename
The problem is that we may update the display name property before requesting the FSItem be renamed.
2015-07-23 11:32:19 +02:00
Allan Odgaard
5cd7958fb7 Move rename support to FSItem 2015-07-20 12:11:01 +02:00
Allan Odgaard
6aad406dde Use symbolic constants for binding properties 2015-07-20 12:10:23 +02:00
Allan Odgaard
a13b75ebc4 Use isEqualToXYZ: or isEqual: instead of isEqualTo: 2015-07-20 12:10:05 +02:00
Allan Odgaard
772692c2df Limit file browser path change for Go → Current Document
If the file browser’s root path is already a parent of the item we want to reveal (and a descendent of the requested parent) then we skip changing path.
2015-07-20 12:08:57 +02:00
Allan Odgaard
37ed461ca6 Use menu delegate for the file browser’s context menu
This simplifies the code (API) and also allows us to skip having to select the clicked item, as the outline view will handle this for us (using a “special” selection indication that can work in parallel with regular selection).
2015-07-20 12:08:32 +02:00
Allan Odgaard
f942869bee Let file browser’s selectedItems include clicked row 2015-07-20 12:07:12 +02:00
Allan Odgaard
497afab82b Update roll-over button state when control is hidden
If the button gets hidden while the mouse is hovering above it then it’ll not receive a mouseExited: message once the mouse leaves its bounds (while the control is hidden).
2015-07-20 11:41:02 +02:00
Allan Odgaard
b3ec7b4c05 Setup key view loop manually for main window
The auto-calculated key view loop includes everything, which means dynamically added elements such as the close buttons for tab view items, but worse, the subviews of a view-based table view. So this change is required before switching to a view-based file browser.
2015-07-20 11:40:59 +02:00