Allan Odgaard
4a260811ec
Change URL scheme to https
2016-09-29 09:56:50 +02:00
Allan Odgaard
0fb5050cfe
Support NSNotFound in performCloseTab:
...
The tab bar uses the result of indexOfObject: as the tag, so if there is no selected tab, it would be NSNotFound.
Generally though this should not happen.
2016-09-29 09:56:49 +02:00
Allan Odgaard
07a44f7540
Always wrap document saving in open/close and inline didSaveAtPath:
...
Since open no longer tries to load the document it is safe to call even for a document with isLoaded == NO.
2016-09-29 09:56:49 +02:00
Allan Odgaard
db6c22bd8c
Delegate menu item validation for performBundleItemWithUUIDStringFrom:
...
We now let the object that handles performBundleItem: validate the menu item.
2016-09-29 09:16:00 +02:00
Allan Odgaard
9e8a435e2b
Change how we manage window title updates
...
We now only “reveal file in project” (when enabled) on document path changes.
2016-09-28 20:56:55 +02:00
Allan Odgaard
e59b023119
Post OakDocumentContentDidChangeNotification for all buffer changes
2016-09-28 20:56:55 +02:00
Allan Odgaard
3b2a075808
Add public htmlOutputView property to OakCommand
2016-09-27 21:51:55 +02:00
Allan Odgaard
ce55f5691e
Add public closeHTMLOutputView method to OakCommand
2016-09-27 21:51:55 +02:00
Allan Odgaard
d7f06c70c6
Don’t check requirements or new HTML output view when reusing OakCommand
2016-09-27 21:51:55 +02:00
Allan Odgaard
010bb72375
Add ‘visible’ property to OakHTMLOutputView
...
This can be observed to learn when the view is hidden, either because the window it is in closes or when it is removed from its superview.
2016-09-27 21:51:55 +02:00
Allan Odgaard
09534b7ffc
Use NSWorkspace API instead of LSGetApplicationForURL
2016-09-27 21:49:32 +02:00
Allan Odgaard
406a804a3e
Remove redundant intrinsicContentSize overload
2016-09-27 21:49:32 +02:00
Allan Odgaard
330c434a73
Check for nil before messaging object
...
This shouldn’t be necessary but many of the new crashes on macOS 10.12 are from this method, though I suspect that ‘self’ is the already released object rather than ‘otherObject’ being nil.
2016-09-27 21:49:32 +02:00
Allan Odgaard
e93f34b5ab
Only remove buffer callback if added
...
This is incase our initializer fails, here dealloc is still called, but we didn’t get to add the callback so we should not try to remove it.
Why our initializer would fail is beyond me, but I see a few crashes from this (though all from the same user on 10.8.5).
2016-09-27 21:49:32 +02:00
Allan Odgaard
f0a2a70998
Change ‘isBusy’ setter to just ‘busy’
...
The getter is still ‘isBusy’.
2016-09-27 21:49:32 +02:00
Allan Odgaard
ecee5e62e3
Add updateHTMLViewAtomically property to OakCommand
...
This can be used to refresh the output from a command that is already visible (to avoid flicker and resetting scroll position).
2016-09-27 21:36:26 +02:00
Allan Odgaard
3cf916cf49
Rename loadHTMLString: method to setContent:
...
The previous name was inspired by WebView’s default API but it sounds like it is just the default implementation with a default baseURL: parameter, hence why I prefer to name it something different.
2016-09-27 21:36:26 +02:00
Allan Odgaard
8e9cd68c4f
Refactor handling of HTML output in OakCommand
...
Setup and teardown is now contained in the same method.
2016-09-27 21:36:26 +02:00
Allan Odgaard
4dea28811c
Let OakTextView run modal event loop waiting for command
2016-09-27 21:34:55 +02:00
Allan Odgaard
bf2eb3eb83
Add terminationHandler property and terminate method to OakCommand
2016-09-27 21:29:03 +02:00
Allan Odgaard
ede6b4b026
Change named parameter completionHandler: to outputHandler:
...
The handler is only called for commands with output to insert into the text view, hence completionHandler is a misnomer.
2016-09-27 21:29:03 +02:00
Allan Odgaard
3c150d34aa
Ensure we only remove observer that we previously added
...
We were previously assuming that the viewWillMoveToSuperview: was only called when moving to a view and then later when removed, but for 10.8.5 it appears that it might be called multiple times (with a nil superview), causing us to remove ourself as observer from something we didn’t observe.
2016-09-26 21:01:04 +02:00
Allan Odgaard
b0d2a93040
Fix placement of search results checkboxes
2016-09-26 11:14:23 +02:00
Allan Odgaard
796a879452
Use objectsAtIndexes: instead of iterating index set
2016-09-26 11:14:14 +02:00
Allan Odgaard
e286df09e6
fixup! Avoid wrapper objects in FileChooser
2016-09-26 11:13:06 +02:00
Allan Odgaard
2bf803b889
Post OakDocumentWillSaveNotification before reading extended attributes
...
The notification makes the text view update the visualIndex (saved as an extended attribute) so previously we would save the previous value for this attribute.
2016-09-26 11:11:15 +02:00
Allan Odgaard
e6ed50c107
Introduce kMacClassicThemeUUID since we reference it in multiple places
2016-09-26 11:09:32 +02:00
Allan Odgaard
d8312b833e
Rely on NSUUID overload of to_s
2016-09-26 11:09:16 +02:00
Allan Odgaard
9e949e3eda
Use NSUUID for project identifier (instead of NSString)
2016-09-26 11:08:22 +02:00
Allan Odgaard
de92b7dbe9
Provide to_s for NSUUID
2016-09-26 11:07:56 +02:00
Allan Odgaard
d5fad16311
Dragging selected tab to new window will select it in the new window
2016-09-26 11:06:52 +02:00
Allan Odgaard
7cb8755a66
Fix issue with updating bufferEmpty property
...
We should initiate it to YES and the logic for when to skip updating was wrong because of precedence.
2016-09-26 08:09:58 +02:00
Allan Odgaard
b1f92d1415
Skip work when regular expression property is set to its existing value
2016-09-26 08:09:58 +02:00
Allan Odgaard
12ca096ccb
Enable syntax highlight for find and replace text fields
...
These use the source.regexp.oniguruma and textmate.format-string grammars respectively, both in the TextMate bundle.
2016-09-26 08:09:58 +02:00
Allan Odgaard
b5d897315c
Add ${«var»:/titlecase} as alias for ${«var»:/capitalize}
2016-09-25 13:08:21 +02:00
Allan Odgaard
7f42f439b7
Add NSFormatter subclass that does syntax highlight
...
The theme used can be set using the UIThemeUUID defaults key. The default is Mac Classic.
2016-09-25 13:08:21 +02:00
Allan Odgaard
5a571ad036
Fix leak: CGPathRef
2016-09-25 07:31:13 +02:00
Allan Odgaard
973e38a383
Fix leak: buffer_callback_t
2016-09-25 07:31:13 +02:00
Allan Odgaard
b56c51212a
Check for exact dependencies when updating icon/represented file
2016-09-24 15:21:02 +02:00
Allan Odgaard
8cab8be8b5
Also observe document’s display name
...
The display name can change without a change to the path, in which case, we should update the UI accordingly, although the current implementation of OakDocument does not trigger any change notification when e.g. the user enables “Hide Extension” for a document.
2016-09-24 15:21:02 +02:00
Allan Odgaard
66075f6a30
Inline the track/untrack methods
2016-09-24 15:21:02 +02:00
Allan Odgaard
46e83179ae
No need to track/untrack selected document since we track all documents
2016-09-24 15:21:01 +02:00
Allan Odgaard
7d40792a32
Do not update documentPath from setSelectedDocument:
...
The property will automatically be updated by our observer.
2016-09-24 15:21:01 +02:00
Allan Odgaard
d9b6bde6ec
Update window’s icon/represented file directly from observer
2016-09-24 15:21:01 +02:00
Allan Odgaard
a3543029d8
Update window’s documentEdited property directly from observer
2016-09-24 15:21:01 +02:00
Allan Odgaard
17046aa051
Observe documents/selectedDocument properties instead of each document
2016-09-24 15:21:01 +02:00
Allan Odgaard
0a6cbe150e
Remove documentDisplayName property
...
The only purpose of observing this property seems to be to update the window title, but since display name is derived from path, which we also observe, it seems redundant.
Though technically the display name could change because extension is hidden or similar, but this is a bit of an edge-case, and long-term we want file browser and tab bar to observe the document’s displayName property directly.
2016-09-24 09:43:59 +02:00
Allan Odgaard
510d093696
Use selectedDocument.property instead of our mirrored documentProperty
2016-09-24 09:41:36 +02:00
Allan Odgaard
dcd725de05
Remove cppDocuments property and last usage of document_t
2016-09-24 09:37:31 +02:00
Allan Odgaard
83c1f2b6e5
Use OakDocument API to “detach” backup file
...
This needs to be revised.
2016-09-24 09:37:31 +02:00