Commit Graph

3793 Commits

Author SHA1 Message Date
Allan Odgaard
7a981db42a Introduced disableFilterListAutoScroll
For context see http://lists.macromates.com/textmate/2016-November/040134.html
2016-11-18 23:18:57 +07:00
Allan Odgaard
847de30205 Revert "Use thread_local instead of our own implementation"
Unfortunately Xcode 8 and Xcode 8.1 both produce an unstable executable.

This reverts commit 1658d6356a.
2016-11-15 23:03:25 +07:00
Allan Odgaard
3450724cc4 Introduce enableResponsiveScroll user defaults 2016-11-15 23:03:25 +07:00
Allan Odgaard
b8e84e344c Let Open Quickly… block main thread until open documents are loaded
This should ensure that ⌘T quickly followed by ↩ will always select the last document (as long as it is still open).
2016-11-15 23:03:24 +07:00
Allan Odgaard
2cbb657bbe Do not abort when failing to create persistent storage for CoreData
While rare, it seems to happen for some users for seemingly unknown reason.
2016-11-15 22:32:48 +07:00
Allan Odgaard
84889c703d Move crash reporter defaults keys to Preferences framework
Seeing a few crashes from registering user defaults in the “post crash reports” block, hence the motivation to eliminate it.
2016-11-15 22:32:48 +07:00
Allan Odgaard
51c067fb2d Fix race condition
We could call pop_callback before having pushed one because the latter is done after delay.

Also, when disabling observeSCMStatus we now destroy the SCM handle rather than only remove our callback (since we do not re-use the handle).
2016-11-15 21:49:35 +07:00
Allan Odgaard
dd7a7b2724 Revert "Fix race condition"
This reverts commit 9467f3f92b.
2016-11-15 21:49:34 +07:00
Allan Odgaard
5a5f5e8d75 Make folder search depth-first 2016-11-13 16:22:04 +07:00
Allan Odgaard
9467f3f92b Fix race condition
We could call pop_callback before having pushed one because the latter is done after delay.

The way we obtained a weak reference to ourself was also scoped incorrectly so our block effectively had a strong reference to self.

Lastly when disabling observeSCMStatus we should destroy the SCM handle rather than only remove our callback (since we do not re-use the handle).
2016-11-11 15:47:19 +07:00
Allan Odgaard
944ad3ea5d Rename API: add_callback → push_callback
This makes it clear what is actually done.
2016-11-11 15:47:19 +07:00
Allan Odgaard
5caf3f789d Update build file generator
We no longer build frameworks as standalone targets but instead link it all together, which also means resources from “frameworks” will end up in the main bundle.

Currently the new build file generator does not create test targets and changing linker settings in frameworks is not inherited by the main target (since there is no naive way to “merge” framework specific linker settings).

For custom library dependencies (capnp, kj, and libressl) we specify them via `LIBS` using `/path/to/libfoo.a` so that the root target will inherit these dependencies and using the absolute path ensures that we get the static (rather than dynamic) version.
2016-11-06 16:49:46 +07:00
Allan Odgaard
383cae795d Move libressl include path to main target file
Although we only use the headers in a single framework, we generally do not use per-framework include paths and furthermore, by having it as a “global” setting, it’s much easier to change how TextMate is built (w/o having to analyzer compiler flags like `-I`).
2016-11-06 16:49:14 +07:00
Allan Odgaard
f28faeafcb Do not pass bundle items by reference
When executing a bundle item without any default document open, we may first “load” the document, which is done via a callback (for when the document is loaded), and at that time, the bundle item reference has become invalid.
2016-11-04 19:22:39 +07:00
Allan Odgaard
3e276e7e04 Update assertion
We change the semantics of “open” when we introduced the “loaded” property.
2016-11-04 19:22:39 +07:00
Allan Odgaard
8c5936d3d7 Only run modal event loop runner when it exists
When running commands without a text view (i.e. no windows open), we do not have a modal event runner.
2016-11-04 19:22:39 +07:00
Allan Odgaard
517847b8c7 Update location of dsym files 2016-11-04 19:22:39 +07:00
Allan Odgaard
a1a5430abb Fix potential nil value in dictionary literal 2016-11-04 19:22:39 +07:00
Allan Odgaard
122bd0b8a1 File descriptor was closed twice causing a potential crash 2016-11-04 19:22:39 +07:00
Allan Odgaard
30b409b2eb Revert "Remove custom handling of ‘return’ to edit items in file browser"
It appears that the OS does not reliable initiate edit on 10.12.1.

When expanding and then collapsing an item, the OS will often then no longer edit the item on return.

This reverts commit cce3417962.
2016-11-02 23:02:18 +07:00
Allan Odgaard
690e8d22b0 Do not run modal event loop when doing command preflight actions
Preflight actions could show dialogs (such as a save dialog) which would then be unresponsive, since we were running a modal event loop.
2016-11-02 23:02:18 +07:00
Allan Odgaard
aec44343ff Cancelling a save dialog could mark document as saved 2016-11-02 23:02:18 +07:00
Allan Odgaard
c92e0c42d8 Provide save dialog with document’s file type for encoding settings
Previously the save dialog would update encoding settings solely based on the path, but the user could set different line endings or character set for a file type (rather than extension).
2016-11-02 23:02:18 +07:00
Allan Odgaard
783d073098 Opening document with no newlines no longer default to LF
Since creating new untitled documents go through the same “open” code they would have their newlines set to LF, this is no longer the case, so the global (or targeted) lineEndings setting now decide what to use (when saving the document).

Currently creating an untitled document from a buffer (e.g. `echo foo|mate`) will do newline detection and thus will ignore user settings during save, if the buffer had any newlines during initialization.

This may or may not be desired. Probably it should do newline detection when the data is provided by the user, but not when it is based on “internal” data, for example a command with “New Document” as output location.
2016-11-02 23:02:18 +07:00
Allan Odgaard
fb62334362 Add “small” prefix to our custom document icons
A few of these names clash with our file type icons (Blank, C, JavaScript, Python, Ruby, and Text) so we need to change one of the sets if we want to build TextMate.app with a single Resources folder (instead of keeping resources with their respective frameworks).
2016-11-02 22:59:44 +07:00
mathbunnyru
926f702828 Use CFPropertyListWrite as CFPropertyListWriteToStream is deprecated 2016-10-31 17:30:30 +07:00
Allan Odgaard
577c663d4e Allow building OakDebug framework with NDEBUG defined 2016-10-31 17:30:30 +07:00
Allan Odgaard
9d980a07df Remove NSPrincipalClass from framework bundles’s Info.plist
This is not something which is used anywhere and a few of the frameworks does not have a principal class.
2016-10-31 17:30:30 +07:00
Allan Odgaard
95b8c58c4e Avoid typecasting our delegate 2016-10-24 02:21:29 +07:00
Allan Odgaard
7bbcc93c34 Update busy property to match (updated) status bar API
This would throw an exception when changing busy status from JavaScript.

This issue was introduced in f0a2a70998.

Closes textmate/latex.tmbundle#155.
2016-10-24 02:21:29 +07:00
Allan Odgaard
e4c408fcad Improve disambiguation of applications in the Open With menu
If there are multiple copies of the same app installed and the version numbers are the same, it will now include location information.
2016-10-24 02:21:29 +07:00
Allan Odgaard
1f0c52a8cf Let Open With use application URL instead of bundle identifier
It is not unlikely to have multiple versions of Xcode installed which all use the same bundle identifier, but we want to select a specific one for opening xib files etc.
2016-10-24 02:21:29 +07:00
Allan Odgaard
50b3da7788 Create Show Hidden Files checkbox in code instead of using a xib 2016-10-24 02:21:29 +07:00
Allan Odgaard
ebe6029137 Register defaults in +initialize instead of using dispatch_once 2016-10-24 02:21:29 +07:00
Allan Odgaard
efecda7526 Reuse variables already initialized 2016-10-24 02:21:29 +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