Commit Graph

2340 Commits

Author SHA1 Message Date
Allan Odgaard
67e8c23b3b Checkin release notes v2.0-alpha.9519 2014-03-12 15:50:39 +07:00
Allan Odgaard
a89ca5c930 Ensure scope bar has one button selected
It was possible to press the already selected button to deselect it. Now we reselect it, when that happens.
2014-03-12 15:50:39 +07:00
Allan Odgaard
383fd44203 Only draw table view as key when linked search field has focus 2014-03-12 15:50:39 +07:00
Allan Odgaard
5073b2bf06 Remove unused code 2014-03-12 15:50:39 +07:00
Allan Odgaard
de99c053db Do not call unimplemented method on super
This was broken by commit 5edd3479ba.
2014-03-12 15:50:39 +07:00
Allan Odgaard
94b1f9aa6c Add titles to HTML used in about window
With voice over enabled the titles will be read aloud, so it makes sense to set them to something sensible.
2014-03-12 15:50:39 +07:00
Allan Odgaard
1183367694 fixup! Do “refresh” for actions which are no-op due to current state 2014-03-10 16:44:28 +07:00
Boris Dušek
129cc2749d Workaround for accessibility of OakChooser's search field
Currently for VoiceOver user when the text cursor is at the end of the search
field (which is 99% of the time) and the user wants to navigate the results
in the table view using arrow down, then after each arrow down, VoiceOver first
plays a "end-of-text" sound, then announces whole contents of the search field,
and only then announces the newly selected search result. (The same happens
when text cursor is at the beginning of the search field and user presses
arrow up.)

This is probably a bug in the way AppKit handles text field accessibility - see
http://lists.apple.com/archives/accessibility-dev/2014/Feb/msg00019.html

I also reported this as <rdar://problem/16271507>

I hereby present a hacky workaround for this - a subclass of NSSearchField
that tricks accessibility into thinking there is one extra space before and
after the text in the search field. Therefore VoiceOver will not think the user
is at the end of text when they actually are, and therefore will not play the
"end-of-text" sound and announce whole contents of the search field before
getting to the information user wants (the newly selected search result).

While this is a bit hacky, along with the previous commit it allows VoiceOver
to have the same instant great experience as a sighted user when filtering
and browsing results in OakChooser. So I think it's worth the hackiness until
there is a better alternative.

There is only last issue, as currently VoiceOver is very chatty when the
OakChooser window appears: first says "Go to file", if user interrupts it with
an action (i.e. moving VO cursor or typing a character), then VoiceOver starts
telling the whole title of the window, and only after user interrupts it again
does VoiceOver say or announce only the user actions (including search results
table selection change).

So the simpliest if the user wants to start navigating the table items
immediately after showing the OakChooser's window (i.e. without entering
a search term) is to, after showing the OakChooser (e.g. with ⌘T or ⇧⌘T),
quickly type any letter and immediately delete it with backspace and then
use arrow down/up.
2014-03-10 16:23:58 +07:00
Boris Dušek
36b1ec4fa0 Announce current OakChooser item to accessibility
This solves accessibility of situation of a user browsing results in
OakChooser (currently File Chooser and Symbol Chooser). Typically
the user is in search field and after typing the search string
wants to use arrow down and up to browse results.

The problem this presented to accessibility was that VoiceOver reads
only changes of selection in the current VoiceOver item. As the user
is on the search field but the selection changes in the results table
below, VoiceOver did not read the various search results when pressing
arrow up/down.

Alternative was to leave the search field, move to the results table,
interact with it and then navigate it with VoiceOver. This is however
not the desired user experience comparable to that of sighted users,
as the VoiceOver user still has to do quite a few steps after entering
the search string to browse the results, not to speak about the situation
when the user would like to change the search string - he/she would need
to leave the table and get back to the search field.

This solves the problem by making the search field (or more generally
any user interface element that triggers change of selection in the
results table, which should be the element the VoiceOver cursor is on)
announce to accessibility the contents of the selected row in search
results table.

See this thread on accessibility-dev mailing list where the options for
implementing such a user interface in an accessible way are discussed:

http://lists.apple.com/archives/accessibility-dev/2013/Dec/msg00000.html
and
http://lists.apple.com/archives/accessibility-dev/2014/Feb/msg00016.html

If the user did not move selection (it is on the first line) and they
want to hear it, they should use arrow up to hear it. Then they can
use arrow down to move through results.
2014-03-10 15:39:12 +07:00
Allan Odgaard
e7e1aed59c Inserting “after input” is always lower/right corner for columns
For example selecting a column of numbers and selecting “Add Numbers in Selection” will now always insert the result at a logical position rather than on the defined end points of the selection.
2014-03-10 12:40:18 +07:00
Allan Odgaard
cc446d98e5 Don’t let HTML output window itself keep track of open windows 2014-03-10 12:40:18 +07:00
Allan Odgaard
2a36fed4d8 Handle output window re-use options for commands 2014-03-10 09:39:52 +07:00
Allan Odgaard
e318ee0519 Refactor: Collecting output windows moved to own method 2014-03-10 09:39:52 +07:00
Allan Odgaard
19d03df1fb Add bundle item setting for how to re-use output windows
This presently does not have any effect.
2014-03-09 17:13:57 +07:00
Allan Odgaard
3786e0e823 Do “refresh” for actions which are no-op due to current state
For example when caret is at the beginning of the document, using “move left” would be a no-op and would cause “refresh” to be skipped, which meant if the caret was outside the visible area, no scroll would happen (to make it visible).
2014-03-09 17:13:57 +07:00
Allan Odgaard
16c09c2a92 Update API to reflect that setting command runner can’t fail 2014-03-09 17:13:57 +07:00
Allan Odgaard
3e603dd238 Show alert sheet when closing window with a running command
This only applies to commands being run embedded in the document window.
2014-03-09 17:13:57 +07:00
Allan Odgaard
69453cd1fc Do not re-use busy HTML output views/windows
Additionally, we only re-use a window when the command is the same as what was last associated with the window. So doing a documentation lookup and then building the project will not re-use the (non-busy) documentation window for the build progress.

Closes #733
2014-03-09 10:01:52 +07:00
Allan Odgaard
ee405e740f Refactor HTMLOutputWindow: Use properties and argument free init 2014-03-09 10:01:52 +07:00
Allan Odgaard
aa9b2a4b06 Use (custom) block based API for showing sheet 2014-03-09 10:01:52 +07:00
Allan Odgaard
0cb5f297de Add comment to explain workaround for presumed WebKit bug
Since the code was written before open sourcing TextMate, the explanation was only to be found in a private commit log.
2014-03-09 10:01:52 +07:00
Allan Odgaard
2b847730fd Make the preferences window restorable
This is not overly useful but the code serves as copy/paste for future endeavors into restoring non-document windows.

The feature requires that “Close windows when quitting an application” is disabled in System Preferences → General (I think that option is enabled by default, at least on 10.9).
2014-03-09 10:01:52 +07:00
Allan Odgaard
919ab40ef0 Indicate that find window is not restorable
Since we are using it with an NSDocument, it defaults to use NSDocumentController as restoration class, which gives a warning during launch, if the find window was open during termination, and the conditions are so that the system wants to restore windows from last session.

Also indicate that we do not want to save drafts, unsure if this has any effect.
2014-03-09 10:01:52 +07:00
Allan Odgaard
bf4e1d8cee Find in folder window’s title could switch to “Untitled”
This is because we are using an NSDocument to perform the folder searching (as that’s a decoupled way to have the window indicate “unsaved changes” and present a warning sheet).

The downside is that by using an NSDocument we get some undesired implicit behavior, like automatically changing the window title or trying to re-open the “document” after relaunch.
2014-03-09 10:01:51 +07:00
Allan Odgaard
a4ad676c37 Add debug output to WebView delegate 2014-03-09 10:01:51 +07:00
Allan Odgaard
50ab241838 Open new window for HTML output links with target="_blank"
Since switching to ARC we need to ensure the NSWindow is “over-retained” as we rely on “setReleasedWhenClosed:YES”.

Also add ability to close such windows from JavaScript.
2014-03-09 10:01:51 +07:00
Allan Odgaard
09e5d88437 Refactor OakHTMLOutputView 2014-03-09 10:01:51 +07:00
Allan Odgaard
166bfad140 Fix include paths 2014-03-07 00:10:35 +07:00
Allan Odgaard
c7ae7d1337 Add test for snippets with overlapping fields
See 4e1cdb4c9e for details.
2014-03-07 00:10:35 +07:00
Allan Odgaard
337dc1a221 Update sizing code for snippet pop-up menu
We now rely on the table view to obtain the entries and setup the data cell, which should make the code easier to use for other table views with a different data source implementation.
2014-03-06 10:15:09 +07:00
Allan Odgaard
5e1f86a7c2 Setting disableIndentCorrections to ‘1’ was not treated as :true 2014-03-06 10:15:09 +07:00
Allan Odgaard
7079071139 Update Dialog plug-in (pop-up menu improvements) 2014-03-06 10:15:09 +07:00
Allan Odgaard
0e16132725 Bundle item chooser key equivalent search now sort based on scope
For example searching for items bound to ⌃H will show the fallback item in the Shell Script bundle last (as it’s not scoped). Previously items were alphabetized.
2014-03-05 21:18:59 +07:00
Allan Odgaard
6ded0873a3 Remove (somewhat) redundant code 2014-03-05 21:18:59 +07:00
Allan Odgaard
8e63d2729f Setting current pasteboard entry to itself lose auxiliary options
An example where this is desired is when doing a folder search for “foo”, then going to first match and using ⌘E to copy the match to the find pasteboard. This is effectively a no-op except for dropping the auxiliary options that contain other documents with matches (which is what causes ⌘G to advance to next document).
2014-03-05 21:18:59 +07:00
Allan Odgaard
c5c88843e8 Let OakFileIconImage be lazy wrt. stat’ing and obtaining SCM info
There are situations where we create an OakFileIconImage that won’t be drawn, for example when using it with an NSMenuItem. In that case, we previously paid a somewhat noticeable price in the initializer doing work that was not required.
2014-03-05 16:39:55 +07:00
Allan Odgaard
83aabbf53c Move properties from OakFileIconImageRep to OakFileIconImage 2014-03-05 16:39:55 +07:00
Allan Odgaard
1e11a30a53 Remove redundant storage keywords for @property
These were required prior to the new 64 bit run-time.
2014-03-05 16:39:54 +07:00
Allan Odgaard
f26145e6cc Only print download progress when stderr is a tty 2014-03-05 16:39:53 +07:00
Allan Odgaard
fb036b840c Remove bitdeli badge
This no longer works, and GitHub offers traffic analysis under “Graphs”.
2014-03-04 21:20:45 +07:00
Allan Odgaard
7f11230655 Checkin release notes v2.0-alpha.9517 2014-03-04 16:13:30 +07:00
Allan Odgaard
3d4d75c543 Update about window text 2014-03-04 16:03:05 +07:00
Allan Odgaard
947b352952 Set pasteboard history search field to fire immediately 2014-03-04 10:40:05 +07:00
Allan Odgaard
a6f6185123 Add NSError info to crash report 2014-03-04 10:24:05 +07:00
Allan Odgaard
c38a1a64af Add to_s overload for NSError 2014-03-04 10:23:01 +07:00
Allan Odgaard
f5ba564c41 Update copyright to 2014 2014-03-04 08:57:56 +07:00
Allan Odgaard
2b28f5a165 Use NSHumanReadableCopyright in about window
This avoids having the copyright (which includes the current year) in multiple places.
2014-03-04 08:57:28 +07:00
Allan Odgaard
1840f5b7fa Improve utf8::find_safe_end implementation
Previously calling the function with invalid UTF-8 could cause it to iterate over all the data and, if built in debug mode, could cause an assertion failure.

Now we return the sequence’s end when the data appears to be malformed and we never look at more than the last 6 bytes in the sequence.
2014-03-03 13:48:12 +07:00
Allan Odgaard
ede827546c Update dialog plug-in (submodules) 2014-03-03 10:35:07 +07:00
Allan Odgaard
c2397484b8 Use C++11 for loop
Majority of the edits done using the following ruby script:

    def update_loops(src)
      dst, cnt = '', 0

      block_indent, variable = nil, nil
      src.each_line do |line|
        if block_indent
          if line =~ /^#{block_indent}([{}\t])|^\t*$/
            block_indent = nil if $1 == '}'
            line = line.gsub(%r{ ([^a-z>]) \(\*#{variable}\) | \*#{variable}\b | \b#{variable}(->) }x) do
              $1.to_s + variable + ($2 == "->" ? "." : "")
            end
          else
            block_indent = nil
          end
        elsif line =~ /^(\t*)c?iterate\((\w+), (?!diacritics::make_range)(.*\))$/
          block_indent, variable = $1, $2
          line = "#$1for(auto const& #$2 : #$3\n"
          cnt += 1
        end
        dst << line
      end
      return dst, cnt
    end

    paths.each do |path|
      src = IO.read(path)

      cnt = 1
      while cnt != 0
        src, cnt = update_loops(src)
        STDERR << "#{path}: #{cnt}\n"
      end

      File.open(path, "w") { |io| io << src }
    end
2014-03-03 10:34:13 +07:00