Commit Graph

3829 Commits

Author SHA1 Message Date
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
Allan Odgaard
41b987e82c Select last added document when creating multiple tabs at once
When we close a tab then we select the tab to the left, for this reason it makes most sense to select the last tab added, so that ⌘W will effectively go to the “next tab inserted”.

The exception is when we create a new project, here we select the first tab since there are no tabs to the left, so ⌘W will still work as a “next tab” button. Though I may later change this so that the behavior is consistent.
2016-06-29 11:37:28 +02:00
Allan Odgaard
e39e744636 Simplify code which inserts new documents into the tab bar
All insertion now go through the same method.
2016-06-29 11:37:28 +02:00
Allan Odgaard
afe9240883 Use initializer list instead of helper function (C++11) 2016-06-29 11:37:28 +02:00
Allan Odgaard
c76022c367 Don’t use const reference for Objective-C property
I believe this used to be a requirement (presumably since a const reference can be treated as a pointer by Objective-C) but recent versions of clang have no problem with complex C++ data types in Objective-C class interfaces.
2016-06-29 11:37:28 +02:00
Allan Odgaard
4b0dcce670 Potentially update document’s file type when editing first line
If an edit to the first line causes the document to match with a different grammar then we switch to this grammar.
2016-06-29 11:37:28 +02:00
Allan Odgaard
ca01850b7c Make file::type_from_bytes a public function 2016-06-29 11:37:28 +02:00
Allan Odgaard
f55d929aed Remove scale factor support from the print dialog
The implementation was no different than adjusting the font size, so since that is also exposed, there is no reason to provide both to the user.
2016-06-29 11:37:28 +02:00
Allan Odgaard
bcae1a8aa1 Move printing support to OakDocument 2016-06-29 11:37:28 +02:00
Allan Odgaard
81b09120cd Calling OakShowSheetForWindow with no window now show modal dialog
Based on crash reports received it might be that this function is sometimes called without a window, although the call-sites all do pass a window to the function.
2016-06-29 11:37:28 +02:00
Allan Odgaard
f78bfd306d Remove unused constant for “mixed newlines” and callback related to this 2016-06-29 11:37:28 +02:00
Allan Odgaard
78b528f299 Update LINK dependencies in target files 2016-06-29 11:37:27 +02:00
Allan Odgaard
ab1b4a1237 Move everything about loading a document to OakDocument 2016-06-29 11:37:27 +02:00
Allan Odgaard
f97e89e84b Remove document_t::symbols 2016-06-29 11:37:27 +02:00
Allan Odgaard
50dabac467 Let the symbol chooser use OakDocument instead of document_t 2016-06-29 11:37:27 +02:00
Allan Odgaard
1551efa8d2 Allow obtaining OakDocument from document_t and export OakDocument.h 2016-06-29 11:37:27 +02:00
Allan Odgaard
c21b421b5e Add enumerateSymbolsUsingBlock: to OakDocument
Currently this is a no-op when the document is closed.
2016-06-29 11:37:27 +02:00
Allan Odgaard
455fa2a4be Add keepBackupFile property to OakDocument 2016-06-29 11:37:27 +02:00
Allan Odgaard
98dfad30a3 Let status bar translate file type → grammar name
This is so that we can use bindings, once we deal with OakDocument objects.
2016-06-29 11:37:27 +02:00
Allan Odgaard
8580b04e8d Move “recent documents” tracking to OakDocument 2016-06-29 11:37:19 +02:00
Allan Odgaard
cd614c9a3b Changing path already reset our file system observer 2016-06-24 17:23:18 +02:00
Allan Odgaard
e07d150f43 Improve how we handle the state of the “Replace All / Selected” button
The button will show “Replace Selected” if either not all results are selected
or when all results are selected, replacement has been done for only some of the files with matches.

Validation of the Check/Uncheck All menu items has also been improved.
2016-06-24 09:56:24 +02:00
Allan Odgaard
f66ea4d27f Add ‘countOfExcludedReadOnly’ property to FFResultNode
It does seem redundant with four counters for the FFResultNode but this is required for efficient bindings since the state of the “Replace All / Selected” button depend on all these things.
2016-06-24 09:00:57 +02:00
Allan Odgaard
a4a4746dd9 Change FFResultNode’s ‘ignore’ property to ‘readOnly’
At the same time the semantics have been simplified so that the ‘readOnly’ property (formerly ‘ignored’) does not have any side effects with respect to whether or not the item is excluded.

The only thing special is that when a node is set to be read-only, a change of its ‘exclude’ property will not be forwarded to its children.
2016-06-24 08:45:12 +02:00
Allan Odgaard
994d60120f Update backup file atomically and verify that writing succeeded 2016-06-23 10:03:41 +02:00
Allan Odgaard
1f3ea40516 Update dialog plug-ins (remove workaround for Lion and suppress warning) 2016-06-23 08:53:37 +02:00
Allan Odgaard
383ac8c29d Remove tmColorWithCGColor: / tmCGColor (10.8) 2016-06-23 08:45:30 +02:00
Allan Odgaard
33aec21dcb Provide buffer_t visitor with offset and a way to stop the visit
If the lambda stops the visit then buffer_t::visit_data will return true, otherwise it returns false.
2016-06-22 23:22:47 +02:00
Allan Odgaard
c36ec7757e Send minimum OS requirement to server when we upload a new build 2016-06-22 22:53:38 +02:00
Allan Odgaard
b4a0704723 Remove 10.7 section from README 2016-06-22 22:53:06 +02:00