Commit Graph

3997 Commits

Author SHA1 Message Date
Allan Odgaard
31a2f8e210 Do not call sync_open on a document which is loading
A document which is loading is likely showing a modal dialog (encoding view) and calling sync_open will run a local event loop which may then lock up the UI.
v2.0-beta.12.2
2016-08-16 21:07:57 +02:00
Allan Odgaard
d87b9c167c Let OakHTMLOutputView handle the “Stop Task?” warning sheet
This also allows for the sheet to automatically close, should the command exit before the user selects an action.
2016-08-16 14:41:35 +02:00
Allan Odgaard
a24fc7804d Indented line movement now produce multiple carets for column selections v2.0-beta.12.1 2016-08-15 09:34:18 +02:00
Allan Odgaard
68f468ae20 Add search excerpt tests related to LF and CRLF matching 2016-08-15 09:28:13 +02:00
Allan Odgaard
20612a2d9b Excerpts for CRLF delimited files were off-by-one when searching for CR
Our excerpt would go to “end of line (with the CR)” rather than “begin of next line”, the latter though would be assumed when showing the match in the search results and cause a std::string exception.
2016-08-15 09:25:36 +02:00
Allan Odgaard
e3165bef42 Add assertions
These currently fail if we do folder search for CR when a file (on disk) uses CRLF as delimiters.
2016-08-15 08:43:49 +02:00
Allan Odgaard
51b3161bb5 Improve variable naming 2016-08-15 08:43:49 +02:00
Allan Odgaard
b93ebb943f Change ‘runningCommand’ getter to ‘isRunningCommand’ 2016-08-14 12:57:58 +02:00
Allan Odgaard
62f76eb421 Remove unnecessary code 2016-08-14 12:53:16 +02:00
Allan Odgaard
fb8e4fd105 Do not try to detect when font creation fails
Some users manually set their font to “Anonymous Pro”, “DejaVu Sans Mono”, or similar, where the created font will use a name without the spaces, so TextMate would consider this a failure and fallback to the system default (monospace) font.

This partially reverts commit 7e69201513.
2016-08-14 11:40:33 +02:00
Allan Odgaard
a893a2adef Use NSURLProtocol’s setProperty:forKey:inRequest: for associated data
This simplifies our code though it seems like the lifetime of the data is much longer than the request it is associated with.
2016-08-14 11:20:35 +02:00
Allan Odgaard
b49aeb0ed9 Introduce a pipe when writing to the HTML output view
This removes the command::runner_t dependency from our custom URL protocol.
2016-08-14 11:19:02 +02:00
Allan Odgaard
f773bb3738 Use WebView’s stopLoading instead of killing the running task
This is a more appropriate API to use for signalling that we wish to abort the running command.
2016-08-14 11:17:25 +02:00
Allan Odgaard
c1a8ea734e Use event monitor instead of local event loop for tool tip
We no longer monitor if the application becomes inactive or the key window is changed, but I don’t see how this could cause a problem.
2016-08-14 11:16:52 +02:00
Allan Odgaard
8e04e888d1 Use zeroing weak reference to NSWindow instance (10.8) 2016-08-14 11:16:35 +02:00
Allan Odgaard
7cff411632 fixup! Simplify code which inserts new documents into the tab bar
The simplified code did not remove duplicates from the documents to be inserted.
2016-08-10 11:31:11 +02:00
Allan Odgaard
6954185e8f fixup! Simplify code to obtain font’s em-space
This was supposed to obtain the font’s en-space, not em-space.
2016-08-09 12:57:25 +02:00
Allan Odgaard
6470bdd241 Checkin release notes for 2.0-beta.12 v2.0-beta.12 2016-08-08 16:47:00 +02:00
Allan Odgaard
3d5aa5078b Checkin release notes v2.0-beta.11.17 2016-08-07 20:56:02 +02:00
Allan Odgaard
ad34203e89 Ignore /usr/bin/svn if /usr/bin/xcode-select -p fails
On recent OS versions the /usr/bin/svn executable will prompt the user to install svn (if Xcode is not already installed) which can cause some user confusion, so we now avoid using /usr/bin/svn unless Xcode is installed.

This echoes commit 02a5747f89.
2016-08-07 20:46:11 +02:00
Allan Odgaard
19028bbd71 Using mate /path/to/folder would not use file type setting
This was only incase a new untitled document was created (rather than restore open files for the folder).
2016-08-07 20:43:11 +02:00
Allan Odgaard
e7420edb06 Update dialog plug-in (completion menu width now includes image width) 2016-08-07 17:49:36 +02:00
Allan Odgaard
6859d70e95 Read tab item’s min/max width and line break style from user defaults 2016-08-07 17:21:35 +02:00
Allan Odgaard
002b17e4da fixup! Ensure we have a CTLineRef before asking for line metrics 2016-08-07 17:08:06 +02:00
Allan Odgaard
e60eba2a24 Update item count when removing from Recent Projects dialog
Closes textmate/bugs#15
2016-08-06 11:51:38 +02:00
Allan Odgaard
076863e954 Add some extra checks to potentially avoid crashes v2.0-beta.11.16 2016-08-05 23:19:18 +02:00
Allan Odgaard
26edab6a75 Running a command with output and no document would crash 2016-08-05 23:18:43 +02:00
Allan Odgaard
1f23a34c15 Ensure we have a CTLineRef before asking for line metrics
Closes textmate/bugs#22.
v2.0-beta.11.15
2016-08-05 22:51:48 +02:00
Allan Odgaard
a8f1d63225 Use current run loop instead of main dispatch queue for write callback 2016-08-05 22:16:30 +02:00
Allan Odgaard
8e0948ca0d Use current run loop instead of main dispatch queue for read callback
This is similar to commit 26e66b887a but this change affects reading files.

If we have a command that runs on `callback.document.did-save` and that command writes to another (open) document, TextMate would hang as the save completion handler is indirectly invoked by `dispatch_async(dispatch_get_main_queue(), …)` so the main queue is blocked throughout the execution of the completion handler, and this completion handler may run commands (`callback.document.did-save`) which means it runs a local event loop, and thus while running this event loop, a new event can arrive which tells TextMate that files have changed (and should be reloaded).
2016-08-05 22:11:16 +02:00
Allan Odgaard
793a23cda7 QuickLook generator would fail for users with no font configured
We now fallback to the system’s fixed width font.
v2.0-beta.11.14
2016-08-04 18:13:18 +02:00
Allan Odgaard
40a96c8815 Update dialog plug-ins (Replace deprecated nib initializing) v2.0-beta.11.13 2016-08-04 14:39:35 +02:00
Allan Odgaard
e381dbaf58 Fix typo in comment 2016-08-04 14:37:02 +02:00
Allan Odgaard
49cc601ae6 Only call NSData’s enumerateByteRangesUsingBlock: when available
This restores compatibility with 10.8.
2016-08-04 14:37:02 +02:00
Allan Odgaard
49ce387960 Update dialog plug-ins (revert ‘Replace deprecated nib initializing’) 2016-08-04 00:34:53 +02:00
Allan Odgaard
c947ca6659 Add crash report debug info 2016-08-04 00:34:53 +02:00
Ronald Wampler
4c1f8a18fb Use weak storage for GutterView's partnerView
On 10.12 beta 3, when closing a window, the following exception is thrown:

Exception Name: NSInternalInconsistencyException
Description: <GutterView 0x7fa71c511150> has reached dealloc but still has a super view. Super views strongly reference there children, so this is being over-released, or has been over-released in the past.

Despite the mention of our GutterView instance being over-released, the actual problem is that we do not call super in our override of `removeFromSuperView`, where we nil out our partner view. A simple fix to avoid crashing would be just calling super in that method so that the view is marked as being removed; however, we can simplify the code and eliminate the need to override our super's method by using a weak reference instead and let ARC automatically handle the zeroing of our partner view.
2016-07-21 15:55:01 -04:00
Allan Odgaard
502c578f54 Checkin release notes v2.0-beta.11.10 2016-07-16 14:08:31 +02:00
Allan Odgaard
866136fe83 Add more (crash reports) debug info when dragging text 2016-07-16 13:40:33 +02:00
Allan Odgaard
f3a042aead Add some (crash reports) debug info to libressl usage
After switching to a version of libressl compiled from source I am seeing crashes from BIO_new_mem_buf and PEM_read_bio_RSA_PUBKEY.

Also minor code touchups, no functional change.
2016-07-16 13:27:57 +02:00
Allan Odgaard
511e1d58a5 Remove old (crash reports) debug info 2016-07-16 13:14:43 +02:00
Allan Odgaard
93e9d23a7d Ensure “will save” callbacks run on buffer that gets written to disk 2016-07-16 13:14:43 +02:00
Allan Odgaard
07bb1ce28d Let OakDocumentEditor update document’s ‘selection’ property 2016-07-16 13:14:43 +02:00
Allan Odgaard
55c6f20b51 Let OakDocumentEditor update document’s ‘folding’ property
This has the advantage that we also get updated folding state saved with backups plus we do not burden the OakTextView with keeping metadata in sync.
2016-07-16 13:14:42 +02:00
Allan Odgaard
1f09c4292a Drop the OakDocumentEditorProtocol
This was only required when the OakDocumentEditor implementation was in a different framework (that OakDocument could not depend on).
2016-07-16 13:14:39 +02:00
Allan Odgaard
417706400d Remove document_t from refresh helper 2016-07-16 13:13:45 +02:00
Allan Odgaard
4d8cef31a0 Let OakDocumentEditor expose buffer_t
Although the buffer is maintained by OakDocument, it makes sense to only allow access via an OakDocumentEditor instance, since the buffer only exist when the document is loaded (implied by the presence of an editor).
2016-07-16 13:13:45 +02:00
Allan Odgaard
86719625d2 Limit what we import in a public header 2016-07-16 13:13:44 +02:00
Allan Odgaard
a7e6d2fcee Let OakDocumentEditor sanitize selection on external content changes 2016-07-16 13:13:44 +02:00
Allan Odgaard
5ec9aafc81 Add undo/redo API to OakDocument 2016-07-16 13:13:44 +02:00