Commit Graph

2432 Commits

Author SHA1 Message Date
Allan Odgaard
f60abefd72 Checkin release notes v2.0-alpha.9527 2014-03-30 09:48:07 +07:00
Allan Odgaard
66af811197 Assume cap’n’proto is installed in parent of build directory 2014-03-30 09:36:50 +07:00
Allan Odgaard
1547795a9b Update kvdb dependency to version to 0.0.8 2014-03-29 18:58:53 +07:00
Allan Odgaard
3a25a99d6d Variables set via requiredCommands are now shell escaped
Additionally we expect that any variable the user has set is properly shell escaped. Though this is only relevant if the value contains spaces or escape characters.

Currently bundle commands has not been updated to assume that the variables are already shell escaped, so this commit can cause issues with existing bundles.
2014-03-29 18:58:53 +07:00
Allan Odgaard
716b8ea8f3 Add path::unescape to split a shell line into words 2014-03-29 18:58:53 +07:00
Allan Odgaard
4f4fe38aec Use path::escape instead of local code 2014-03-29 18:58:53 +07:00
Allan Odgaard
c73ad254cb Add path::escape to use when passing paths to a shell interpreter 2014-03-29 18:58:53 +07:00
Allan Odgaard
5b58397c41 Remove initWithRunner: method (refactor) 2014-03-29 18:58:53 +07:00
Allan Odgaard
c1dcc72c41 Make htmlOutputView a public property of the HTML output window 2014-03-29 18:58:53 +07:00
Allan Odgaard
b23163476f Add loadHTMLString: API to HTML output view
This replaces the current HTML shown without adding to the history and will preserve scroll position.
2014-03-29 18:58:52 +07:00
Allan Odgaard
a404daecce Use io::exec() instead of system()
The motivation for this change is that we may enable MallocDebug when running tests, which is done via environment variables that we do not want to be passed on to the shell tools we execute.
2014-03-29 18:58:52 +07:00
Allan Odgaard
589e62b1a7 File descriptors without FD_CLOEXEC are closed before we execve()
No file descriptors (other than input/output) should be inherited by our child process. We set FD_CLOEXEC ourself, but system frameworks might not always set it, or there might be a race condition (e.g. with socket(), pipe(), mkstemp(), etc.).
2014-03-29 13:44:13 +07:00
Allan Odgaard
7a66926231 Let command::runner_t use io::create_pipe 2014-03-29 09:57:10 +07:00
Allan Odgaard
c3120c15aa Set FD_CLOEXEC immediately after calling mkstemp()
There is still a race condition but it’s a little better than before.
2014-03-29 09:57:10 +07:00
Allan Odgaard
fe59a55750 Do not abort() if we fail to create a pipe
Failure to create a pipe does happen “in the wild” (with the error “too many open files”). Since majority of subprocess executions relate to gathering version control info we can probably ignore the failure, as not having version control info is better than crashing.

OTOH that pipe() fails does seem to be a symptom of a more serious issue.

The io::spawn implementation has also been updated to use io::create_pipe which sets FD_CLOEXEC, so there should be no reason to set this.
2014-03-29 09:57:10 +07:00
Allan Odgaard
7f7613fe62 Change io::create_pipe API
We now return a tuple and always set FD_CLOEXEC.
2014-03-29 09:57:09 +07:00
Allan Odgaard
dac27f7587 Use constants for input, output, and error file descriptors 2014-03-29 09:57:09 +07:00
Allan Odgaard
e68290aaec Convert CxxTest test to custom test framework 2014-03-29 09:57:09 +07:00
Allan Odgaard
d985a83845 Use runner_t::wait_for_command instead of runner_t::wait(true)
The latter API has been removed.
2014-03-29 09:57:09 +07:00
Allan Odgaard
ffd034453a Extend command::runner_t API 2014-03-29 09:57:09 +07:00
Allan Odgaard
f64d349033 Set file type to ‘text.hg-commit’ for ‘hg-editor-*.txt’
Since Mercurial is not using a unique “path suffix” we need to handle this via the default properties (instead of in the grammar’s file type extension array).
2014-03-28 19:31:15 +07:00
Allan Odgaard
74d6cc47da Use htmlOutputView.runningCommand instead of command::runner_t
The latter is updated via a dispatch queue and thus might be delayed (to after end of current event loop cycle). This is relevant when WebView itself terminates the URL loading and calls the “WebView should close” delegate method.

Here the HTML output view property has been updated (via the WebView delegate method) but the command runner has not yet executed the completion code (which updates it’s “is running” state).
2014-03-28 19:31:15 +07:00
Allan Odgaard
5a8967e88e Implement delegate method for WebView load failures
This can happen if the WebView itself terminates the load, for example if window.close() is called from JavaScript.
2014-03-28 19:31:15 +07:00
Allan Odgaard
c9400e036d Use std::string for memory management 2014-03-28 19:31:15 +07:00
Allan Odgaard
935da75a43 Use new path::temp API to set initial content 2014-03-28 19:31:15 +07:00
Allan Odgaard
5881b86775 Support initial content when creating temporary files 2014-03-28 19:31:15 +07:00
Allan Odgaard
1fbf878a4d Refactor/simplify command runner 2014-03-28 19:31:15 +07:00
Allan Odgaard
5f69ef31c7 Don’t use NS prefix for custom functions 2014-03-28 19:31:14 +07:00
Allan Odgaard
619a2cfec7 Change a few instances of floorf/fabsf → floor/fabs 2014-03-28 19:31:14 +07:00
Allan Odgaard
6d6210e490 Use ‘assign’ instead of ‘weak’ when building for 10.7 2014-03-28 10:19:06 +07:00
Allan Odgaard
ccac862602 Remove process_t 2014-03-28 10:19:06 +07:00
Allan Odgaard
45b297a150 Use custom code instead of process_t 2014-03-28 10:19:06 +07:00
Allan Odgaard
1e2f10ed46 Use dispatch queue instead of a thread for reading command output 2014-03-28 10:19:06 +07:00
Allan Odgaard
9d218ea846 We use camelCase for parameter names 2014-03-28 10:19:06 +07:00
Allan Odgaard
63d431b5ed Simplify parsing of multiple choice keys (tmCommand) 2014-03-28 10:19:06 +07:00
Allan Odgaard
4313571fc9 Parse ‘autoRefresh’ key from tmCommand files
This can be set to ‘onDocumentChange’ to indicate that the command should be re-run when the document changes, though the code hasn’t yet been written to handle this.
2014-03-28 10:19:05 +07:00
Allan Odgaard
c758c9296f Remove unnecessary check in menu item validation
Since the HTML output window responds to toggleHTMLOutput: we would never be called when that window is key.
2014-03-28 10:19:05 +07:00
Allan Odgaard
080dd3da18 Add showWindow:/close methods for HTML output window controller
These must be used for proper management of the “retainedSelf” property.
2014-03-28 10:19:05 +07:00
Allan Odgaard
33178679c7 Scroll to caret failed if mouse button was pressed
We want to disable “make selection visible” when the user is drag-selecting, though the previous check was too broad and would disable it if user opened a document via double click (e.g. a find in folder result).
2014-03-27 07:53:55 +07:00
Allan Odgaard
a6654f56c9 Using cut/copy will always update the system pasteboard
Previously we only updated the system pasteboard if it was different, but some users copy rich text from one application, paste it in TextMate and then copy it (in TextMate) with the expectation that the rich styles are stripped.
2014-03-26 19:02:42 +07:00
Allan Odgaard
7e02902ab0 Remove retain cycle from pasteboard history window 2014-03-26 19:02:41 +07:00
Allan Odgaard
b9fafd1495 Use local undo manager for file browser
This ensures that ⌘Z / ⇧⌘Z are only targeting the file browser when it has focus.

Previously these keys would act on the file browser undo stack when a view without it’s own undo/redo stack had focus, e.g. HTML output view.
2014-03-26 15:30:36 +07:00
Allan Odgaard
764a8407e9 Use undo manager’s menu item titles in file browser action menu 2014-03-26 15:30:36 +07:00
Allan Odgaard
6535546c87 Use view’s undo manager rather than the window’s 2014-03-26 15:30:36 +07:00
Allan Odgaard
1a20f3a42d Set accessibility description when creating action buttons 2014-03-26 15:30:36 +07:00
Allan Odgaard
a004fe685d Only set raised background style for borderless action buttons 2014-03-26 15:30:35 +07:00
Allan Odgaard
9f9cb23609 Improve alignment of glob text field in find window
The combo box’s top border should now align with the pop-up buttons on the same line, though it’s not baseline aligned.
2014-03-26 15:30:35 +07:00
Allan Odgaard
9ae2630607 Delete unused code 2014-03-26 15:30:35 +07:00
Allan Odgaard
ec491a4e19 Exclude divider images from accessibility
Since it is the cell that is providing the accessibility attributes the simplest way I could think of to have it ignored was to remove NSImageView’s support for the NSAccessibilityChildrenAttribute.

I tried using accessibilitySetOverrideValue:forAttribute: but it did not work for me, so a subclass was required.
2014-03-26 15:30:35 +07:00
Allan Odgaard
2cc71e57f9 Limit clipboard history display string to ~1024 code points
This should fix performance issues (during scroll).
2014-03-26 15:30:35 +07:00