Commit Graph

2454 Commits

Author SHA1 Message Date
Allan Odgaard
e86f40255c Update HTML tool tips (font and WebView cache/plug-in settings) 2014-04-01 16:01:19 +07:00
Allan Odgaard
cccfd855ac Sanitize output from TextMate.system()
Since the API specifies an NSString we must expect valid UTF-8.
2014-04-01 16:01:19 +07:00
Allan Odgaard
184c5fecb0 Don’t use -KU with ruby as it logs a warning with ruby 2.0 2014-04-01 16:01:19 +07:00
Allan Odgaard
0daa6d0ec2 Tighter code for removing malformed UTF-8 sequences 2014-04-01 16:01:19 +07:00
Allan Odgaard
cf452cdcee Increase the number of tests for sanitizing UTF-8
Also harmonize the formatting of the existing tests.
2014-04-01 16:01:19 +07:00
Allan Odgaard
471fbe45c2 Do not stack allocate potentially large buffer
Also test that each system function used actually succeeds.
2014-04-01 16:01:19 +07:00
Allan Odgaard
25b3a5f4a4 Notify VoiceOver user of find window status bar changes
We don’t have a specific element associated with the result being announced so we use the current responder (unless it has accessibility ignored, in which case we do not post any notification).

Using the current responder is not ideal, but I do not know how we can either associate the notification with the find panel or post it as a global notification.
2014-04-01 14:36:04 +07:00
Allan Odgaard
5f94f460ee Post find feedback accessibility announcements 2014-04-01 14:23:31 +07:00
Boris Dušek
c3088da9a5 Add my work email as contributor address 2014-04-01 14:03:29 +07:00
Boris Dušek
3c853dfa5e Use UI creation functions for accessibility in status bar 2014-04-01 14:03:29 +07:00
Boris Dušek
f48216a0f1 Add accessibility labels to Find dialog 2014-04-01 13:44:28 +07:00
Boris Dušek
896ad73ee8 Add ability to specify AX labels in UI functions
Accessibility labels now can be specified conveniently as a parameter
of a UI construction function.
2014-04-01 13:39:27 +07:00
Boris Dušek
b80d60db57 Add OakSetAccessibilityLabel function
This function makes it easy to set accessibility "labels" for UI elements.
It is flexible - takes care of NSView vs. NSControl case, labels can be
specified directly as a string or as a user interface element.
2014-04-01 13:37:45 +07:00
Allan Odgaard
617e9df202 Move missing accessibility API declarations to OakAppKit.h 2014-04-01 13:33:49 +07:00
Allan Odgaard
9f177d39e8 Checkin release notes v2.0-alpha.9529 2014-03-31 18:04:02 +07:00
Allan Odgaard
afdebfa576 Revert "Variables set via requiredCommands are now shell escaped"
This reverts commit 3a25a99d6d.
2014-03-31 18:00:09 +07:00
Allan Odgaard
69c83e56df The ‘const’ keyword should be to the right of its type
The standard doesn’t care which side the keyword is placed on, but placing it on the right makes it easier to read types.

E.g. reading “int const* const” from right to left we get “const pointer to const integer”.
2014-03-31 08:27:19 +07:00
Allan Odgaard
db13d4c1f9 Use std::string::back() instead of operator[] with size()-1 2014-03-31 08:27:18 +07:00
Allan Odgaard
04cd55303a Ensure we have a document in tab drop action method
Some crash reports indicate that we do not have a document, although I can’t think of why such situation would arise.
2014-03-31 08:27:18 +07:00
Allan Odgaard
a63edc149f Set default merge policy for CoreData
This is only relevant when another process is updating the CoreData storage (while TextMate is running), i.e. not a scenario normal users should see.
2014-03-31 08:27:17 +07:00
Allan Odgaard
1377e34bb5 Fix deadlock related to aborting command with HTML output
This would happen for a command that is set to re-use previous output window (when busy). We would kill the running command and wait (in the main dispatch queue) for it to stop, but since the runner is (now) using GCD as well, and updating the “did exit” status in the main queue, we would wait forever.
2014-03-31 08:27:17 +07:00
Allan Odgaard
91e8064439 Add to_s for file_status_t 2014-03-31 08:27:16 +07:00
Allan Odgaard
3bc0c65c7a Introduce variable for where cap’n’proto is installed
Set the `capnp_prefix` variable when calling ./configure.

E.g. build and install cap’n’proto in $HOME/build:

    ./configure --disable-shared --prefix="$HOME/build"
    make -j6 check && make install

Then configure TextMate to find it there:

    capnp_prefix="$HOME/build" ./configure
2014-03-30 11:18:41 +07:00
Allan Odgaard
cbfe73b13e Checkin release notes 2014-03-30 10:36:56 +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