Commit Graph

1057 Commits

Author SHA1 Message Date
Allan Odgaard
4dada34bde Make network tests concurrent 2013-03-10 16:07:10 +01:00
Allan Odgaard
be65671e52 Fix shell quoting for selected files
There would be a pair of redundant single quotes after each quoted path.
2013-03-10 16:07:09 +01:00
Allan Odgaard
710e4ffad0 Remove unused tbz (download) filter 2013-03-10 16:07:09 +01:00
Allan Odgaard
d92a4ee286 Range check for ⌘1-n should include ⌘0 2013-03-10 16:07:09 +01:00
Allan Odgaard
59fb3bc1a9 The ⌘1-n keys wouldn’t always work in find dialog 2013-03-10 14:34:44 +01:00
Allan Odgaard
53d1928b9d Update buffer tests
Mainly improving function names including appropriate prefix for benchmark functions so that they are picked up by the new test system.
2013-03-10 14:34:44 +01:00
Allan Odgaard
e3e643468f Use constructor function instead of class 2013-03-10 14:34:44 +01:00
Allan Odgaard
ee2c2b33fb Fix potential deadlock when opening find window
The Find object is assigned to a variable with (guarded) static storage, so the initializer of the Find object will run with a lock on the guarded variable, which turns out to be shared with all other guarded variables.

When setting up the window controller, from the Find object’s initializer, we create a “recent folders” menu which hold icons with SCM badges.

When creating these SCM icons, blocks are scheduled (asynchronously) to “fetch status”. These asynchronous blocks will need to lock the same mutex as we currently have locked (because we haven’t yet left the initializer).

The issue is that we also schedule synchronous blocks on the same queue, and that’s why we get a deadlock, because those can’t run before the asynchronous blocks have finished, yet those are waiting on the global lock that our main thread has currently obtained.

Fixes #874.
2013-03-07 22:03:50 +01:00
Steven Clukey
636c321e46 Adjust scroll past end height logic
This will work properly with very long lines and soft wrap

Fixes #869.
2013-03-07 20:23:11 +01:00
Allan Odgaard
14cfedb287 Implement Replace [and Find] bound to ⌥⌘G
Currently this is implemented in OakTextView which means that it doesn’t work for macros. Some refactoring is in order so that the implementation can be shared (lack of sharing has to do with how OakTextView reports status to Find dialog or via tool tips, and macros want none of that).

There is also no check to see if the current state of the editor is the result of a find operation, i.e. you can invoke “replace” regardless of wether or not “find” was the last action.

Finally, doing a multi-file search and using “find next” at the end of one document, which brings you to the first match of next document (part of the results), will not update “captures” from a potential regular expression search, meaning that if you then do “replace”, and your replacement string is a format string that references the match (via $1-n) then it will not be correctly expanded.

Closes #104.
2013-03-07 16:21:57 +01:00
Allan Odgaard
5ad6d0c5c0 Simplify implementation of OakTextViewFindServer 2013-03-07 16:21:56 +01:00
Allan Odgaard
02f32977f2 Introduce Replace [and Find] in find protocol
Previously there was a single replace action and the options would indicate if it was a “replace all”, this mimics the “find” (which can be a “find all”) but since single match replacement is somewhat different than a “replace all”, as the former may need to know the captures from a previous find action, it makes sense to factor out these things as different actions.
2013-03-07 16:21:47 +01:00
Allan Odgaard
599d903eb4 ARC: Update Find framework 2013-03-07 10:50:41 +01:00
Allan Odgaard
4a24d0ad58 Rework find dialog (part one)
This is work in progress but I don’t think any functionality is missing compared to previous commit, although some functionality might be less polished, e.g. the action buttons don’t properly enable/disable and the height of the results list gets lost when hiding it.

Some of the stuff that has changed / improved:

 * The find/replace text fields adjust their height to encompass the content (closes #94). Presently though the initial height of the ontrols is one line regardless of content (but they should adjust on first edit).
 * You can use Save All (⌥⌘S) to save affected files after Replace All (closes #558).
 * The key equivalents / actions available in the Find dialog is now easier to find via the action pop-up, which also has enables accessibility.
 * Using Next (⌘G) or Previous (⇧⌘G) with search results will move selection up/down.
 * Using Find All with ‘in’ set to ‘Selection’ will find and select all matches in the current document, which fixes #425, though it might be more desirable to show the results in the find dialog (like Find All does for a document or folder).
2013-03-07 10:50:19 +01:00
Allan Odgaard
e8cd0b0df7 Reject bad folding meta data
Fixes issue #866.
2013-03-05 16:42:22 +01:00
Allan Odgaard
c459e0483f Remove compatibility check (10.5) 2013-03-04 13:33:38 +01:00
Allan Odgaard
ae15687db4 Move focus to document when closing split with focus
This applies to file browser and HTML output (when configured to be shown in the document window).

Closes #838.
2013-03-04 10:43:58 +01:00
Adam Strzelecki
6ed3c93872 Lighter tab bar background for better readibility 2013-03-04 10:22:54 +01:00
Allan Odgaard
699d0676b3 Add to undo stack when replacing after folder search
Fixes #536.
2013-03-03 23:19:34 +01:00
Allan Odgaard
2f05d5aec5 Improve VO for folder pop-up button 2013-03-03 15:53:05 +01:00
Allan Odgaard
2c6504b82f Use symbolic constants for binding properties 2013-03-03 15:53:05 +01:00
Boris Dušek
5391d1d7b4 Present the file browser area as a group to VoiceOver/accessibility 2013-03-03 15:53:05 +01:00
Boris Dušek
f4e2de14f2 Present the document view as a group to VoiceOver/accessibility
This enables VoiceOver user to see the document view as a single
element and interact with it (i.e. inspect its subelements) only when
needed by using the VO-Shift-down shortcut (and stop interacting with
it using VO-Shift-up shortcut). This makes the element structure more
hierarchical where at the top level are only major user interface
components, so that it's easier for orientation. It also prevents
unrelated UI elements to be sequential as VoiceOver by default orders
elements by the visual order (top-down, left-right) rather then
the order in the AXChildren array. For example in this case,
the bottom status bar of the document window gets separated from
the bottom toolbar of the file browser, unlike the situation before
grouping when both bars were adjacent to the VoiceOver user.
2013-03-03 15:53:04 +01:00
Boris Dušek
944e1e32fa Make macro recording an NSToggleButton
This fixes semantics of the button and thus also its
accessibility. The macro recording button represents state - more
specifically a boolean state, so it has to be a NSToggleButton (or
its specialization). Then the button is presented to the VoiceOver
user as an AXCheckbox - that is a checkbox with on and off value -
which is exactly what the button's function is. Examples of this in
system apps is e.g. the "Play" button in QuickTime Player, which is
also an AXCheckbox ("Pause" is then simply an unchecked "Play"
checkbox).
2013-03-03 15:42:18 +01:00
Boris Dušek
21c70057b4 Fix initial accessibility of symbol pop-up
VoiceOver reads an AXValue for a pop-up button - that is the selected
item. But button's title does not set an AXValue, as it probably is
not a menu item. So change the code set to the title by setting a
single menu item with that title.

This fixes accessibility of the pop-up when accessing its value before
it is first popped up. It makes the code consistent with setGrammarName:
which works fine (that's how I discovered how to fix it).
2013-03-03 15:41:54 +01:00
Boris Dušek
baf2839299 Add AXDescription to pop-ups to tell about their purpose 2013-03-03 15:41:48 +01:00
Boris Dušek
c3f57b0235 Add AXDescription to image buttons 2013-03-03 15:40:39 +01:00
Steven Clukey
7892eac2d4 Add “scroll past end” option to the View menu
When enabled the height of the document is increased by the height of the view port, which means the last lines of the document are not anchored to the bottom of the view port but can e.g. be centered.

Closes #513.
2013-03-03 15:14:29 +01:00
Allan Odgaard
4e3d31e09c Improve heuristic for swipe gestures
We now try to find a scrollable view under the mouse, and if any scrolling was done, we reject the gesture as a “go back/forward” event.

Additionally we reject gestures with a duration of more than 0.2 seconds.

Maybe fixes #854.
2013-03-02 11:26:30 +01:00
Allan Odgaard
f7f3fc3638 Copy incremental search string
Fixed #631 (again).
2013-03-02 09:26:35 +01:00
Allan Odgaard
e8efb3638d Fix Go → Current Document with no project folder
We were creating an NSURL from the project folder which would throw an exception when the project folder was nil.
2013-03-01 22:03:58 +01:00
Allan Odgaard
5e6cfe8e1e The 10th tab now get ⌘0 as key equivalent 2013-02-27 21:05:09 +01:00
Allan Odgaard
57c2aeda47 Use libdispatch for monitoring file changes
This is instead of using kqueue, which has more overhead and require a dedicated thread for the kevent run-loop.
2013-02-25 15:28:37 +01:00
Allan Odgaard
7de06dc9f4 Changing default bundle item settings could fail
The cache would not include changes to settings keys from delta bundles.
2013-02-25 15:28:37 +01:00
Allan Odgaard
ea5d7d3af9 Use weak pointers in most async dispatch blocks
This is mainly to expedite potential destruction of the objects referenced.
2013-02-25 15:27:29 +01:00
Allan Odgaard
3859e25429 Disallow copying scm::info_t
Presently not supported.
2013-02-25 15:27:29 +01:00
Allan Odgaard
e091bdb2f0 Use const for member data initialized by constructor 2013-02-25 15:26:45 +01:00
Allan Odgaard
38be7f56db Add scm::info_t::pop_callback
Ideally we would be able to remove arbitrary callbacks rather than the last one added, but for this we would need to introduce some sort of handle (the callback itself is a block so not suitable as handle). The push/pop API for callbacks is sufficient for our use-case though.
2013-02-25 15:25:17 +01:00
Allan Odgaard
c4323efbb7 Use path::is_child instead of custom code 2013-02-25 15:25:17 +01:00
Allan Odgaard
6d6c3e4de6 Use path::is_absolute instead of custom code 2013-02-25 15:25:17 +01:00
Allan Odgaard
a3ec258912 Update settings tests to new system 2013-02-25 15:25:17 +01:00
Allan Odgaard
10ebd31ad9 Let SCM tests use same executable as driver
The was previously only done for the svn tests and the code had some flaws, like modifying the PATH environment variable.
2013-02-23 11:24:57 +01:00
Allan Odgaard
b4ee927fdf Expose scm::find_executable (for testing)
This is so that tests can use the exact same executable to create the repository, as is used to obtain status (svn repositories created with newer executables are often not backwards compatible).
2013-02-23 11:24:56 +01:00
Allan Odgaard
b9ebb6068f Remove unused private field
Basically to avoid a clang warning.
2013-02-23 11:24:56 +01:00
Allan Odgaard
b718106ff8 Make semi-internal API private
This was previously public so that we could write tests for it, but since the test runner is linked with the object files, it can access symbols that has visibility set to hidden.
2013-02-23 11:24:56 +01:00
Allan Odgaard
104ed0e325 Treat ‘nil’ as empty string
With bindings, clearing a text field results in its value being set to nil.
2013-02-22 18:15:11 +01:00
Allan Odgaard
ca0c72e0c0 Fix potential retain loop via document SCM callback
If we closed a window with a document SCM callback for the current document, but that document was untitled (so it wouldn’t be cleared during shutdown), we would keep ‘self’ retained.
2013-02-22 17:59:42 +01:00
Allan Odgaard
e033b7031f Avoid non-POD static data in thread
The issue here is that the thread can outlive the data.
2013-02-22 16:07:35 +01:00
Allan Odgaard
cd2b0882f0 Use new test system for a few frameworks 2013-02-22 15:55:28 +01:00
Allan Odgaard
972348687c Make fs-events wrapper thread safe
Previously this wasn’t used from multiple threads, but with the new testing system it can be.
2013-02-22 15:51:51 +01:00