Commit Graph

3759 Commits

Author SHA1 Message Date
Allan Odgaard
80141185cc Revert "Use thread_local instead of our own implementation"
This reverts commit 1658d6356a.
2016-10-23 00:21:09 +07:00
Allan Odgaard
cdf7cc0f15 Enable kSearchIgnoreOrderingKey for Open Quickly… (⌘T) 2016-10-22 23:27:16 +07:00
Allan Odgaard
c624424539 Add kSearchIgnoreOrderingKey for when enumerating documents at path
This will return all open documents before starting to scan the disk and should make functionality like Open Quickly… (⌘T) feel faster (if enabled).
2016-10-22 23:27:16 +07:00
Allan Odgaard
948d7106d8 Add openDocumentsInDirectory: method for all open documents in folder 2016-10-22 23:27:16 +07:00
Allan Odgaard
e669722ba2 Remove workaround for changed scandir prototype (10.8) 2016-10-22 23:27:15 +07:00
Allan Odgaard
05749c5c64 Document creation in background thread could fail
This is because we remove the document record in dealloc (unregister), but at that time, the reference in the record (for the path/inode) has already been zeroed, so if a document is created for the same path/inode after the reference has been zeroed but before the record has been unregistered, we would use the zeroed reference as the result from documentWithPath:.
2016-10-22 23:27:15 +07:00
mathbunnyru
440414f96c Use nullptr in all C++ files instead of NULL
This brings us a bit of extra type safety, for example where an integer is expected, nullptr should be disallowed by the compiler (unlike NULL).
2016-10-22 21:40:14 +07:00
Allan Odgaard
f78a3b2ce4 Use kCFAllocatorDefault instead of NULL 2016-10-22 16:29:19 +07:00
mathbunnyru
d6db299a8f Changed from NULL to nullptr in variadic templates for portability 2016-10-19 00:59:11 +03:00
Ronald Wampler
4a7e774196 Use oak::random_shuffle instead of std::random_shuffle
The latter is deprecated in C++14 and will be removed in C++17
2016-10-18 23:06:49 +02:00
mathbunnyru
1b4adf29e1 Fixed memory leak 2016-10-18 23:06:49 +02:00
mathbunnyru
284b5a3896 Slight perfomance improvements 2016-10-18 23:06:48 +02:00
mathbunnyru
9632a8d804 Deleted unused variables 2016-10-18 23:06:48 +02:00
mathbunnyru
08ad760d5e static_cast instead of c-style cast 2016-10-18 23:06:48 +02:00
Allan Odgaard
5277a5a396 Use std::string’s compare function instead of find 2016-10-18 18:22:15 +02:00
Allan Odgaard
e2f8e0c188 Use std::string’s front function instead of find 2016-10-17 11:03:41 +02:00
Allan Odgaard
ee2aee21fa Use oak::has_prefix when comparing std::string against string literal 2016-10-17 11:03:41 +02:00
mathbunnyru
0b034f9a9d Use std::string’s compare to avoid searching beyond the prefix length 2016-10-17 10:50:18 +02:00
Allan Odgaard
26da9c7e15 Show “add license” titlebar buttons after one hour of use 2016-10-17 10:07:29 +02:00
Allan Odgaard
34db8d64ff Limit public API to the LicenseManager singleton 2016-10-17 10:07:29 +02:00
Allan Odgaard
5443b1b48f Add API to add a titlebar “add license” button 2016-10-17 10:07:29 +02:00
Allan Odgaard
fab0dc0da0 Move addLicense: method to LicenseManager 2016-10-17 10:07:29 +02:00
Allan Odgaard
682239e165 Do license revocation check on main thread
This should be a quick check, only done after entering a valid license, and the UI feedback depends on the result, so little was gained from doing it as a background check.
2016-10-17 10:07:29 +02:00
Allan Odgaard
644db44713 Introduce a “model” and bind to view controller’s represented object 2016-10-17 10:07:29 +02:00
Allan Odgaard
3acace3121 Remove document_t and related tests
Tests should be ported to OakDocument.
2016-10-17 10:07:29 +02:00
Allan Odgaard
bec3548d55 Avoid extra call to accessor by using instancesRespondToSelector: 2016-10-15 13:07:51 +02:00
Allan Odgaard
5a22d60127 Fix exception in Open Quickly… code
The exception would happen if the status text was updated while the path was nil. Normally there would be no items (for which to show status text) with a nil path, but using the Open Documents data source would normally have items, and thus could trigger this exception.
2016-10-15 13:07:51 +02:00
Allan Odgaard
b4c2476508 Move “add license” window to license framework
Code has been refactored to using a view controller and there are now placeholder strings plus an “Online Shop” button.
2016-10-15 13:07:51 +02:00
Allan Odgaard
0b8c2b3ff5 Add syntax highlight to pasteboard search history
This is only for regular expressions and for these we bypass the normal “show invisibles” code, this is only because it would add code complexity and regular expressions are less likely to contain newlines or tab characters.
2016-10-15 13:07:51 +02:00
Allan Odgaard
dde19a2725 Explicit constructor required after updating boost 2016-10-12 10:43:42 +02:00
Allan Odgaard
c4370ee029 Create destination’s parent folder when moving Bundles 2016-10-12 10:43:42 +02:00
Allan Odgaard
e3364c3b11 Add another LEGACY marker 2016-10-12 10:43:42 +02:00
Allan Odgaard
3dc185cb67 Do not wrap executeBundleCommand:variables: in auto refresh 2016-10-11 13:02:36 +02:00
Allan Odgaard
a278bfd5fe Postpone loading document changes when processing user edit event
When running bundle commands we run a local event loop which means that we can receive events such as “document changed” while still waiting for the bundle command to finish.
2016-10-11 13:02:36 +02:00
Allan Odgaard
dfad1a61ce Add undo_manager_t::in_undo_group API 2016-10-11 13:02:36 +02:00
Allan Odgaard
66410365d1 Remove volume::settings API 2016-10-11 10:36:49 +02:00
Allan Odgaard
7be3703404 Change user defaults to .tm_properties for disabling extended attributes 2016-10-11 10:36:49 +02:00
Allan Odgaard
5af64db166 Ask user to move Avian bundles into TextMate’s application support 2016-10-10 22:39:44 +02:00
Allan Odgaard
3a8f524803 Read and install bundles in TextMate folder (instead of Avian) 2016-10-10 22:39:44 +02:00
Allan Odgaard
8e0b22507a Use LEGACY marker for code that should eventually be retired
This is to make it easier to search for such code.
2016-10-10 22:39:16 +02:00
Allan Odgaard
f66d48d4d5 Limit input to CFCharacterSetIsLongCharacterMember
This is an optimization but it also fixes a crash when CFCharacterSetIsLongCharacterMember is called with extremely large values.

One crash report shows the input being 0x1001DEBC, which is not valid UTF-32, could perhaps be the result of loading a garbage file, so it might make sense to perform some range checks when the user selects to load a file using a UTF encoding.

It could also be command output or possibly copy/paste.
2016-10-10 22:38:06 +02:00
Allan Odgaard
dc1406e32e Use AND/OR/NOT with NSPredicate instead of the C equivalents
The BNF for NSCompoundPredicate only lists the former keywords, not the C syntax (not that it has caused any problems to use it).
2016-10-10 22:38:05 +02:00
Allan Odgaard
dfe30c5328 Prune pasteboard history before saving 2016-10-10 22:38:01 +02:00
Allan Odgaard
ff4ad90ac7 Add pruneHistory: method to OakPasteboard 2016-10-10 22:38:00 +02:00
Allan Odgaard
5c1014c578 Add user defaults keys for how much pasteboard history to keep 2016-10-10 22:38:00 +02:00
Allan Odgaard
1a79e15017 Improve Objective-C type info (generics) 2016-10-10 22:38:00 +02:00
Allan Odgaard
4f9446ae30 Preserve a document’s visible index when updating its selection
Both the selection and visibleIndex property should be reworked, as it’s not really document properties.
2016-10-10 22:38:00 +02:00
Allan Odgaard
6b93c00371 Tweak how we create the output pop-up menu for Filter Through Command… 2016-10-10 22:38:00 +02:00
Allan Odgaard
a57e4dde1c Minor improvement in pasteboard history’s Clear All 2016-10-10 22:37:53 +02:00
Allan Odgaard
d2a078fd32 Improve handling of delayed pasteboard history saving
Previously we would save 60 seconds after a change, but successive changes would not bump the timer, and we had a timer per pasteboard, so changing both the find and replace pasteboard would schedule two save operations, even though they share context.

Now we save 30 seconds after any of the pasteboards were last changed.
2016-10-10 22:37:25 +02:00