Commit Graph

15 Commits

Author SHA1 Message Date
Allan Odgaard
3b2a075808 Add public htmlOutputView property to OakCommand 2016-09-27 21:51:55 +02:00
Allan Odgaard
ce55f5691e Add public closeHTMLOutputView method to OakCommand 2016-09-27 21:51:55 +02:00
Allan Odgaard
d7f06c70c6 Don’t check requirements or new HTML output view when reusing OakCommand 2016-09-27 21:51:55 +02:00
Allan Odgaard
ecee5e62e3 Add updateHTMLViewAtomically property to OakCommand
This can be used to refresh the output from a command that is already visible (to avoid flicker and resetting scroll position).
2016-09-27 21:36:26 +02:00
Allan Odgaard
8e9cd68c4f Refactor handling of HTML output in OakCommand
Setup and teardown is now contained in the same method.
2016-09-27 21:36:26 +02:00
Allan Odgaard
4dea28811c Let OakTextView run modal event loop waiting for command 2016-09-27 21:34:55 +02:00
Allan Odgaard
bf2eb3eb83 Add terminationHandler property and terminate method to OakCommand 2016-09-27 21:29:03 +02:00
Allan Odgaard
ede6b4b026 Change named parameter completionHandler: to outputHandler:
The handler is only called for commands with output to insert into the text view, hence completionHandler is a misnomer.
2016-09-27 21:29:03 +02:00
Allan Odgaard
3af916629c Let OakCommand use OakDocumentController API 2016-09-24 08:33:33 +02:00
Allan Odgaard
74a2c9e801 Handle potential exception when asking NSFileHandle for fileDescriptor
Based on crash logs this occasionally throws an “Operation not permitted” or “unknown error” exception, so now we catch these.
2016-09-21 20:39:41 +02:00
Allan Odgaard
51faf0ed3c Remove WebKit workaround that no longer seems necessary
The workaround was introduced in May 2005, so the underlying issue was probably addressed a long time ago :)
2016-09-17 07:22:41 +02:00
Allan Odgaard
e9cf7df4a6 Do not close file handle potentially used by another thread 2016-09-07 22:13:10 +02:00
Allan Odgaard
800f47e85d Deliver all data from custom URL protocol on main thread
This closes textmate/bundle-support.tmbundle#26.
2016-09-05 08:56:23 +02:00
Allan Odgaard
95580d5ec7 Do not assume NSApp.keyWindow nor NSApp.mainWindow are valid
These are both set to nil when the app loses focus, and even in an NSApplicationDidBecomeActiveNotification these are still nil.

This means any command running while the app was inactive or as part of a “did become active” notification, would not find the proper objects to setup environment etc.
2016-08-30 18:33:24 +02:00
Allan Odgaard
f3745fe034 Add new OakCommand framework
A lot of the code is copy/pasted from the document::run implementation, our command::runner and HTMLOutput (custom URL protocol).
2016-08-28 13:32:48 +02:00