Commit Graph

3660 Commits

Author SHA1 Message Date
Allan Odgaard
955cc0c288 Revert "Use thread_local instead of our own implementation"
This reverts commit 1658d6356a.
2016-09-27 17:24:55 +02:00
Allan Odgaard
dc0b64f147 Remove redundant intrinsicContentSize overload 2016-09-27 17:24:54 +02:00
Allan Odgaard
84835e1668 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 17:24:54 +02:00
Allan Odgaard
006cadf3b8 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 17:24:54 +02:00
Allan Odgaard
b06b6826d1 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 17:24:54 +02:00
Allan Odgaard
018bb0c611 Change ‘isBusy’ setter to just ‘busy’
The getter is still ‘isBusy’.
2016-09-27 17:24:54 +02:00
Allan Odgaard
683b31f79f Maintain idle timer for OakDocument
This is for future use.
2016-09-27 17:24:54 +02:00
Allan Odgaard
601ed5d90b Remove unused notification: OakDocumentContentDidChangeNotification 2016-09-26 21:01:05 +02:00
Allan Odgaard
d6cb6d5098 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-26 21:01:05 +02:00
Allan Odgaard
529ecf8218 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-26 21:01:05 +02:00
Allan Odgaard
69d3c59b2d Refactor handling of HTML output in OakCommand
Setup and teardown is now contained in the same method.
2016-09-26 21:01:05 +02:00
Allan Odgaard
8f90e40515 Let OakTextView run modal event loop waiting for command 2016-09-26 21:01:05 +02:00
Allan Odgaard
8cb09c3530 Add terminationHandler property and terminate method to OakCommand 2016-09-26 21:01:05 +02:00
Allan Odgaard
e7940a851c 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-26 21:01:05 +02:00
Allan Odgaard
2a02251c9b Add syntax highlight to pasteboard search history
This is just a quick proof-of-concept.
2016-09-26 21:01:05 +02:00
Allan Odgaard
457335d677 Remove document_t and related tests
Tests should be ported to OakDocument.
2016-09-26 21:01:05 +02:00
Allan Odgaard
a95731bbb3 Let OakDocument use OakSourceControlManager 2016-09-26 21:01:04 +02:00
Allan Odgaard
03b2fe3cff WIP: Add OakSourceControlManager 2016-09-26 21:01:04 +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
Allan Odgaard
14cdd420d3 Make backupPath property public 2016-09-24 09:37:31 +02:00
Allan Odgaard
2baf1f7889 Remove most uses of _cppDocuments 2016-09-24 09:37:31 +02:00
Allan Odgaard
b7e4f3bc4f Make OakDocument’s saveBackup: public API
This is required when saving session state.
2016-09-24 09:37:31 +02:00