Commit Graph

614 Commits

Author SHA1 Message Date
Allan Odgaard
1fa5bc7fae Implement command auto refresh for document change, save, and close 2016-10-03 22:05:39 +02:00
Allan Odgaard
0556886d99 Add class to manage “command refresh” 2016-10-03 22:05:39 +02:00
Allan Odgaard
acd76d52f6 Use NSTimer instead of OakTimer 2016-10-01 09:03:25 +02:00
Allan Odgaard
4dea28811c Let OakTextView run modal event loop waiting for command 2016-09-27 21:34:55 +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
d8312b833e Rely on NSUUID overload of to_s 2016-09-26 11:09:16 +02:00
Allan Odgaard
dc5028f039 Let text view and find window show documents using OakDocumentController 2016-09-24 08:33:33 +02:00
Allan Odgaard
28da74ca01 Add diagnostics info related to framework crash 2016-09-24 08:33:32 +02:00
Jacob Bandes-Storch
f36ce366f4 Make OakPopOutAnimation window a child of the main window 2016-09-21 21:00:51 -07:00
Allan Odgaard
981b7a6d8f Move undo grouping to OakDocumentEditor 2016-09-21 20:39:42 +02:00
Allan Odgaard
808563c934 Remove unnecessary overloads of requiresConstraintBasedLayout
It should only be necessary to overload this method (to return YES) when the system is unable to figure out by itself, that it should enable constraint-based layout for the window in which the view is placed.
2016-09-21 20:39:41 +02:00
Allan Odgaard
1fad00682a Do not include final “newline” when creating image from selection
Previously searching for something with a trailing newline would have the pop-out animation (image) include an extra empty line.

An issue is when only searching for a newline, currently this results in an empty image, so we need to special-case that.
2016-09-20 18:11:23 +02:00
Allan Odgaard
10f88212e4 Use setDynamicTitle: for menu items with dynamic title
See previous commit for details.
2016-09-20 10:03:45 +02:00
Allan Odgaard
ad883f7211 fixup! Only set table view’s row height during sizeToFit
Incase of no choices we would set a row height of zero which is not allowed.
2016-09-19 13:12:53 +02:00
Allan Odgaard
5f53075864 Disable recent tracking for non-open documents instead of non-loaded 2016-09-18 10:33:45 +02:00
Allan Odgaard
ddefdec649 Change document’s isOpen property to isLoaded
Since we do not load documents before the user selects them, e.g. after session restore or when opening multiple documents, it makes sense to have both an isOpen and isLoaded property, the former means “is shown somewhere in the UI” and would make it appear (e.g. in file browser) with close button etc., whereas the latter means that data has been loaded from disk, and we can safely access the buffer.
2016-09-18 10:29:21 +02:00
Allan Odgaard
f1fef3315e Add callback.document.did-change-scm-status
This is useful for SCM gutter marks which should update after committing or reverting changes in the current document.
2016-09-13 23:49:17 +02:00
Jacob Bandes-Storch
d6652ff4e8 Hide previous pop-out animations when showing a new one 2016-09-12 23:50:46 -07:00
Ronald Wampler
9c8caa21ec fixup! Only set table view’s row height during sizeToFit
We need to set the row height after calling sizeToFit on textField.
2016-09-12 09:50:56 -04:00
Allan Odgaard
7b291185fe Only set table view’s row height during sizeToFit
The initial dimension of the OakChoiceMenu could be incorrect because the row height had not been updated.

This broke in c270b0c5af
2016-09-12 08:47:10 +02:00
Allan Odgaard
553e89ceb6 Update include statements and link declarations 2016-09-11 12:47:39 +02:00
Allan Odgaard
da5fdd78a8 Remove document_t from OakDocumentView
This also updates the commit window to only use OakDocument API.

The bundle editor and document controller still require updating.
2016-09-11 08:49:32 +02:00
Allan Odgaard
9f4ff49529 Change kBookmarkIdentifier → OakDocumentBookmarkIdentifier 2016-09-11 08:46:11 +02:00
Allan Odgaard
149dfd884d Prepare to drop cppDocument property 2016-09-11 08:45:12 +02:00
Allan Odgaard
ebf6ae9346 Rename document property to cppDocument as intermediate refactoring step 2016-09-11 08:43:46 +02:00
Allan Odgaard
cdcb5a4836 Use OakDocument API to load/close document
We sort of assume that OakDocumentView is only given documents which are already loaded.
2016-09-11 08:43:04 +02:00
Allan Odgaard
f2289039da Calling document_t::show/hide is now done by DocumentController
This is only done for LRU tracking so it sort of makes sense to move this outside the document view itself (e.g. commit window and bundle editor does not require any LRU tracking).
2016-09-11 08:42:20 +02:00
Allan Odgaard
1e6102fb6e Observe OakDocumentMarksDidChangeNotification instead of adding callback 2016-09-11 08:42:01 +02:00
Allan Odgaard
ec0be36078 Post OakDocumentMarksDidChangeNotification when changing marks
This is instead of posting the GVColumnDataSourceDidChange notification.
2016-09-11 08:40:55 +02:00
Allan Odgaard
b9f7d23283 Make all tabSize properties use NSUInteger as their type 2016-09-11 08:40:22 +02:00
Allan Odgaard
102f22e266 Rename property isMacroRecording → isRecordingMacro/recordingMacro 2016-09-11 08:38:27 +02:00
Allan Odgaard
91190cdf9f No need to have dealloc clear properties with weak storage 2016-09-11 08:36:52 +02:00
Allan Odgaard
76183d63dd Observe OakDocument for fileType, tabSize, and softTabs 2016-09-11 08:36:30 +02:00
Allan Odgaard
dae362060d Fix crash if symbol chooser was open when closing window
This was introduced in 50dabac467.
2016-09-11 08:34:46 +02:00
Allan Odgaard
b57cde0886 Improve implementation of document_view_t::has_marks
The previous version was proportional in time with number of marks, since it requested (a copy of) all the marks.
2016-09-11 08:33:07 +02:00
Allan Odgaard
358ce2f3fc Use new bookmark API from OakDocumentView 2016-09-11 08:32:36 +02:00
Allan Odgaard
da847e71d0 Use OakDocument’s bookmark enumeration API to construct navigation mneu 2016-09-11 08:30:50 +02:00
Allan Odgaard
654a3f8483 Let OakTextView be responsible for most bookmark actions
Actions such as next/previous bookmark and toggle current, rely on the caret/selection, so these should be handled by the text view.
2016-09-11 08:28:49 +02:00
Allan Odgaard
067f8014ff Let OakTextView be responsible for “current symbol”
Since this depends on the caret position/selection, it makes sense to place this with the text view.
2016-09-11 08:26:58 +02:00
Allan Odgaard
468f95cb45 Use OakDocument API for symbols menu 2016-09-10 12:56:03 +02:00
Allan Odgaard
2c925dd9be Let OakDocumentView go via OakDocument for a few properties 2016-09-10 12:55:57 +02:00
Allan Odgaard
63fd2e4f76 Rename instance variable document → cppDocument
This is just an intermediate step (until we get rid of document_t).
2016-09-10 12:54:47 +02:00
Jacob Bandes-Storch
73330e29db Highlight the selection again when it’s the only find result
This more closely matches the behavior of NSTextView.
2016-09-10 12:52:25 +02:00
Allan Odgaard
7a89742f6d Handle most/all movement keys for snippet pop-up menu 2016-09-08 20:14:08 +02:00
Allan Odgaard
bd54418a4b Use zeroing weak reference to NSWindowController instance (10.8) 2016-09-08 20:14:07 +02:00
Allan Odgaard
1539468399 NSPanel will set isReleasedWhenClosed to NO 2016-09-08 11:42:46 +02:00
Allan Odgaard
99b51c7f92 Use OakDocument as type for OakTextView’s document property 2016-09-04 22:58:58 +02:00
Ronald Wampler
06ba9b6dab Don't store our font scale factor as a percentage
While we want to show the font scale factor as a percentage in the UI, internally, we should represent it as a CGFloat, which is more consistent with the NSFont APIs and makes interacting with them easier.
2016-09-04 20:17:42 +02:00
Allan Odgaard
79302ba49c The TM_DROPPED_FILE variable is again a relative path
This broke when we switched to OakCommand
2016-08-31 08:49:20 +02:00
Ronald Wampler
f59c445bc8 Tail truncate strings in OakChoiceMenu
This allows strings longer than our max width to still align up properly with the corresponding insertion text.
2016-08-31 08:26:54 +02:00