Commit Graph

3858 Commits

Author SHA1 Message Date
Allan Odgaard
4843ca3e1a Checkin release notes v2.0-beta.11.4 2016-07-06 10:36:28 +02:00
Allan Odgaard
6c73e4bbae Remove legacy open callback abstract base class 2016-07-05 22:58:22 +02:00
Allan Odgaard
36e01eeb10 Fail early if OakDocumentView / OakTextView lack a document
There are still methods that will fail (crash) when we lack a document, but everything involved with constructing and displaying the view should not work even without a placeholder document.
2016-07-05 17:07:33 +02:00
Allan Odgaard
dff96aba21 Lookup theme per document type
This allows setting different themes for different document types or paths (closes #801).
2016-07-05 15:31:19 +02:00
Allan Odgaard
f8b2ca4da4 Don’t make OakTextView’s theme property a const reference
At the same time use dot-notation to access the property.
2016-07-05 15:11:57 +02:00
Allan Odgaard
b6f5474629 Fail early for some OakTextView methods when we have no theme 2016-07-05 14:58:23 +02:00
Allan Odgaard
f487c5d575 Simplify code to obtain font’s em-space 2016-07-05 14:20:08 +02:00
Allan Odgaard
436e43d78f Specify OS requirements (to server) via depends DSL 2016-07-05 12:13:06 +02:00
Allan Odgaard
ef876499bd Use system’s default monospace font for theme_t 2016-07-05 12:13:06 +02:00
Allan Odgaard
0bb275b4f0 Rely on the system’s default monospaced font rather than Menlo
Furthermore, if the user changes to the default monospaced font then we do not store its name in settings (given that it’s default).
2016-07-05 12:13:06 +02:00
Allan Odgaard
7e69201513 Use default monospace font when failing to get requested font
If we ask for a non-existing font then we may get back the system default font and as most users expect a monospaced font, we take extra steps to catch this situation and switch to the default monospaced font.

For example users that are currently using Menlo may get into this situation on macOS 10.12 where Menlo has been removed.

Furthermore, when no font name is configured we also use the system’s default fixed width font.
2016-07-05 12:13:06 +02:00
Allan Odgaard
58aafa283d Let OakTextView store an NSFont instead of separate font name and size 2016-07-05 12:13:06 +02:00
Allan Odgaard
a337d6029c Remove use of copy_with_font_name_and_size from OakTextView 2016-07-05 12:13:06 +02:00
Allan Odgaard
ec430fe375 Don’t let layout_t rely on caller to set the theme’s font
The theme_t::copy_with_font_name_and_size is an implementation detail that would be nice to get rid of.
2016-07-05 12:13:05 +02:00
Allan Odgaard
a415576827 Disable deprecation warning for Gestalt API
The replacement API¹ did not appear until the 10.10 SDK, although it might be usable from 10.9.2, but as we currently support 10.8, we cannot use it.

¹ [[NSProcessInfo processInfo] operatingSystemVersion]
2016-07-05 10:45:02 +02:00
Allan Odgaard
1afd1f11ba Use weak storage for OakTextView’s delegate (10.8)
Prior to 10.8 we could not form weak references to NSWindowControllers and as a delegate’s superclass is unknown, and could very likely be a window controller, we could not use weak storage.
2016-07-05 10:15:07 +02:00
Allan Odgaard
a3639495d1 Update dialog plug-ins (use non-deprecated nib API) (10.8) 2016-07-05 10:01:45 +02:00
Allan Odgaard
3ef7c81470 Ensure a dropped tab is always moved
This is done by asking to both close and insert the tab, which works as a move regardless of the “re-order tabs” setting.
2016-07-04 23:10:37 +02:00
Allan Odgaard
3812acf2bc Support providing same document(s) as insert and close arguments
This is a way to move a document. Normally inserted documents already open will be moved, but only if the user hasn’t disabled tab re-ordering.
2016-07-04 23:01:54 +02:00
Allan Odgaard
1c744c9b0e Add checkbox for keeping bundles updated to Bundles preferences
This removes the current activity text and progress bar used while installing and uninstalling bundles.
2016-07-03 23:49:21 +02:00
Allan Odgaard
b4e6f186be Remove Software Update checkbox for keeping bundles updated 2016-07-03 23:47:44 +02:00
Allan Odgaard
94036f28aa Non-active text views only execute bundle items with ⌘ in their shortcut
In general only the active view should respond to keys but we have the text view handle bundle items because they can provide actions that are not tied to text editing, for example “Build” or “Show SCM Actions”.

Ideally bundle items would (also) be handled by the window controller, but keyDown: is not commonly passed up the responder chain, so our window controller never sees any keys.

The way the system is designed is that the menu system will resolve keys (before the active view) and then send the menu item’s action up the responder chain, so views respond to actions rather than keys, but we cannot use this system for bundle items because it does not support multiple items with same key equivalent or scope selectors.
2016-07-03 20:34:41 +02:00
Allan Odgaard
d3f7193415 Don’t use NSControl’s controlSize property (backwards compatibility)
This property wasn’t available before 10.10.
v2.0-beta.11.3
2016-07-01 21:26:41 +02:00
Allan Odgaard
d18d524037 Use CFCharacterSet for “East Asian Width” and update tables
See 45f847d01e for code used to update the tables.
2016-07-01 13:49:44 +02:00
Allan Odgaard
3ff9a5dfee Don’t go via buffer_t to remove document marks
The document will post a “marks did change” notification, so we can remove our local notification posting.
v2.0-beta.11.2
2016-06-30 22:48:40 +02:00
Allan Odgaard
1bc09c2ee7 Don’t go through buffer_t to get document’s indent settings 2016-06-30 22:48:17 +02:00
Allan Odgaard
823313d276 Add some assertions 2016-06-30 22:37:18 +02:00
Allan Odgaard
d9769edf6b Loading document in the progress of loading would return immediately
This could lead to a crash if the second caller of load would access the document’s buffer (before the load initiated by first caller had finished).

Issue introduced in beta 11.
2016-06-30 22:32:42 +02:00
Allan Odgaard
cc7ff6e631 Always store release notes digest in user defaults
Commit 8c19532531 broke it so that a digest would only be stored if one was already there, meaning that new users (since November 2015) would not see release notes after update.
v2.0-beta.11.1
2016-06-30 17:21:05 +02:00
Allan Odgaard
39b9dd19bf Checkin release notes v2.0-beta.11 2016-06-30 16:51:44 +02:00
Allan Odgaard
cba83cc413 Opening a file without a grammar can now suggest installing a bundle
This can be disabled using:

	defaults write com.macromates.TextMate.preview disableBundleSuggestions -bool YES

Though the user can also hold option and select “Never” for a suggestions to never see that again, and once the user has a custom binding for a document’s type, no suggestion will be shown.
2016-06-30 16:22:10 +02:00
Allan Odgaard
61492af33c Fix typo 2016-06-30 15:25:46 +02:00
Allan Odgaard
34c126b634 Add new class: SelectGrammarViewController
This can be used to ask the user about installing a new bundle.
2016-06-30 15:25:46 +02:00
Allan Odgaard
ab6c91b1c4 Let BundlesManager observe user defaults for disabling update checks 2016-06-29 23:24:17 +02:00
Allan Odgaard
5f336984f3 OakDocument was only using virtual path to lookup some settings 2016-06-29 22:36:09 +02:00
Allan Odgaard
194a2c35c3 Ensure document always receives a file type
If OakDocument itself is unable to find one we look at the fileType .tm_properties setting, either looking it up using ‘attr.untitled’ for untitled documents, or ‘attr.file.unknown-type’ for documents with a path.

If nothing is found we fallback to ‘text.plain’.
2016-06-29 22:30:44 +02:00
Allan Odgaard
629ac714f3 Limit the steps taken by OakDocument to find a file type
If there is no custom binding and no installed grammar matches the document (based on content or path extension) then we leave the document without a file type and expect the caller (of loadModalForWindow:completionHandler:) to set the file type (in the completion handler).

The caller can consult online bundles, present UI to the user, and also know about “project directory”, so they can make a better choice than the OakDocument.
2016-06-29 21:55:02 +02:00
Allan Odgaard
b209d81645 Make file::type_from_path a public function 2016-06-29 16:32:01 +02:00
Allan Odgaard
5dccc9f824 Multiple selections copied to find clipboard creates alternation regexp 2016-06-29 14:21:56 +02:00
Allan Odgaard
6a476b868c Add regexp::escape helper to escape special characters 2016-06-29 14:21:55 +02:00
Allan Odgaard
15d798dde8 Add proposedGrammars method to OakDocument
This returns an array of grammars that can be used with the receiver, either matched via file type extension or first line.
2016-06-29 14:21:55 +02:00
Allan Odgaard
adef9fbbbc Use new BundlesManager API to obtain release notes
This removes the last dependency on the updater framework.
2016-06-29 14:21:55 +02:00
Allan Odgaard
b1fcb9dea4 Update bundles preferences to new BundlesManager API
We now use an array controller and bindings for the table view.
2016-06-29 14:21:55 +02:00
Allan Odgaard
caf8ee5b1f Change API and implementation of BundlesManager
We now have an Objective-C type that can be used in the UI to show various properties of a bundle.

This commit breaks compatibility with the current bundles preferences page.
2016-06-29 14:21:55 +02:00
Allan Odgaard
4db51602b0 Remove unused load/save methods from key_chain_t 2016-06-29 11:37:29 +02:00
Allan Odgaard
ca24ad9388 Remove unused grammar selection sheet resources 2016-06-29 11:37:29 +02:00
Allan Odgaard
5361e287f9 Do not handle file type sniffing in file::open
This disables support for showing the user a selection sheet when the file type is unknown, instead we fallback on text.plain.
2016-06-29 11:37:29 +02:00
Allan Odgaard
e88f40a76d Do not attempt to save document meta data for non-existing files 2016-06-29 11:37:29 +02:00
Allan Odgaard
1b7e37affa Set OakDocument’s ‘onDisk’ property during initialization
The old implementation in document_t would check the status in the getter when the document wasn’t open, since we only observe the disk for open documents.

Such solution though would not support key/value observing.

We could improve performance slightly by accepting an “isOnDisk” flag in the initializer since when we create documents from scanning the disk (folder search and file chooser) we already know the document is on disk and thus could skip the extra disk access.
2016-06-29 11:37:28 +02:00
Allan Odgaard
3f44309466 Post OakDocumentWillCloseNotification when closing a document 2016-06-29 11:37:28 +02:00