Accessibility visual bounds for a range of a single softline should always
be also visually restricted to the softline. This is in order to be consistent
with implementation in Apple's apps (e.g. TextEdit).
Fixes#1149.
VoiceOver expects AXLineForIndex and AXRangeForLine to be consistent with
the movement by line using arrow up/down. That means it expects "line"
to mean softline.
VoiceOver also distinguishes commands to move by:
* paragraph (hardline): VO-Shift-PgUp/PgDown
* line (softline): VO-up/down
These are available when interacting with the text area (VO-Shift-down).
This commit therefore fixes the AXLineForIndex and AXRangeForLine
to make "line" mean "softline" instead of "hardline" as was the case
until now.
Now links in text (e.g. links to RFCs after installing the Hyperlink Helper bundle)
are announced as such with VoiceOver and it is possible to search for them with
VO-Cmd-L.
TODO:
* launching links with VO-Space is not supported yet, but Enter (Fn-Return)
does the same thing and is even more reliable.
* link URL is not supported, so it is not possible to learn the URL
with VO-Shift-U.
Previously only the text view’s background would affect the window’s opaque property, which made it impossible to have a solid text view background with a transparent gutter.
With responsive scrolling we need to return NO from isOpaque in order to get transparency and we cannot overload the scrollWheel: method (which we use to forward mouse events from the gutter to the text area).
I have also received a few crash reports that might be caused by responsive scrolling and one user has reported “sticky” scroll behavior.
So for now better just disable it, and see if it fixes all these issues.
Fixes#1135
Previously the character before the potential tab trigger had to be of a different character class. This is now only required when the first character of the tab trigger is a word character.
This setting allows changing which invisibles are shown and what glyph
is used for them.
Invisibles are '\t', '\n', and ' ', to turn one off, add ~[\t \n] to
the settings string. To set the glyph used for the invisible, add [\t
\n][glyph_to_use].
Logically I think the less temporary marks should be eclipsed, but this currently lead to inconsistencies with respect to hover images, e.g. hovering a search mark that also has a bookmark should show “remove bookmark” which it presently doesn’t, and will require a bit of refactoring to allow.
Issue #1132
My interpretation: The old inline array is interpreted as an initializer list which cannot (yet) be used with Objective-C objects when ARC is enabled.
Fixes#1037
VoiceOver can announce text formatting, such as bold font, italics,
underline, font, etc., as well as whether text is misspelled. For this,
it needs the AXAttributedStringForRange attribute supported. This commit
does exactly that.
Testing can be done in this way (VO stands for Ctrl-Option):
* first interact with the text (VO-Shift-down arrow when standing
on the text element)
* to announce text attributes for character after cursor, press VO-T
* to seek for next:
* misspelled text: VO-Cmd-E
* color change: VO-Cmd-K
* underlined text: VO-Cmd-U
* many more (see VO-H-H, "Find", close help with Esc)
* to seek for previous *: just add Shift to the shortcut
Some attributes remain to be supported (full list of attributes is available at: https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/Protocols/NSAccessibility_Protocol/Reference/Reference.html#//apple_ref/doc/uid/20000945-SW53).
The misspelled text VoiceOver support can be used nicely with TextMate's
spelling support:
1. the user finds next mistake with VO-Cmd-E, hears the misspelled word,
perhaps reads it on a braille display
2. the user then presses Cmd-; to show the spelling menu for that word
and chooses the desired resolution (apply suggested correction etc.)
3. go back to step 1. :-)
If the spelling panel is visible when checkSpelling: is invoked then its language is taken and used for the buffer. If the panel is not visible, the buffer’s language is set for the spelling panel.
We probably should also set the spelling panel’s language when switching document, and when the panel is first opened. I don’t think the code complexity is really worth it though (depends on how often one use the spelling panel with a non-default language).
Fixes#1104
We invalidate the entire buffer since the word can appear in multiple locations. This could be optimized to only invalidate misspelled instances of the ignored or learned word. Likewise, we redraw entire buffer since the refresh macro is not able to handle changes in spelling meta data and calculate minimal refresh region.
Now using Edit -> Spelling -> Check Spelling selects next spelling error or one
at caret if it was not yet selected, then shows context menu with correction
suggestions.
This makes checking spelling as easy as tapping Cmd+;
Closes#1103
Previously it would only observe NSViewBoundsDidChange from the clip view containing the text view, and while it worked most of the time, it failed to see notifications when a text view was smaller than the clip view’s view port and grew, yet still staying smaller than the view port.
I’m seeing a crash in ‘-[OakDocumentView dealloc]’ stating that “selectionString” is not being observed. This would indicate that a OakDocumentView instance is created that doesn’t go through the designated initializer, how that can happen is beyond me, but with the reshuffled code, if it happens, it should no longer cause a crash in dealloc.
This is to avoid cyclic dependencies since it was previously in a somewhat high-level framework, so everything that framework depended on, could not augment crash reports.
This is when switching tabs ore re-opening a file.
Restoring the visible rectangle doesn’t always work because we do an initial heuristic layout where we don’t do proper soft wrap and may also lack scoped settings to increase font size for headings, meaning that the restored visible rectangle does not point to the same section of the text, as it would with a fully updated layout.
This fixes#243.