This means we don’t need to know if there is a selection when creating the menu items and long-term it’ll be easier to introduce more complex updating, e.g. make the title a format string to allow referencing TM_DISPLAYNAME or disable the menu item if its requirements cannot be met.
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.
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.
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.
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).
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).
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.
By using the menu item’s indentation level property it is possible to “type to select” items, which previously would not work for items that had leading em-space as a prefix.
Closes#806.
- Set compression priorities to collapse fields in a desirable order.
- Increase default width of selection string to fit 8888:88
- Set grammar popup to the width of the active grammar and give is sensible minimum/maximum widths.
- Set a maximum width for the tab size menu.
Previously the gutter and the text view were set to have the same height (via constraints). Though when the horizontal scrollbar is visible then the gutter should technically be made a little taller to account for the extra bottom margin. Not adding this space was causing problems.
Fixes#773.
Previously we would set it for the current file (via path) and the current scope plus parent scopes.
The latter wasn’t useful, as the file type is not indicative of the language used, and as scoped settings presently have higher priority than path-based settings, it could lead to the wrong language being used, even when language was explicitly set for a folder.
Now, when changing language via Edit → Spelling menu, we set the language globally (so default for all new documents without more specific settings), all files in the current document’s folder, and the document itself.
The undo manager will change the titles (e.g. “Undo Rename”) when it’s first responder, so we need to change them back, when the text view is first responder.
The reason for this is that NSTextField will draw itself in the “faded” state (for non-key windows) unless some of its parent views are marked opaque.
The previous problem with not having the parent views opaque (see da3a91a7bb) seems to have been solved by setting the autohidesScrollers property to YES.
Using instances with static storage in Objective-C files result in the following warning (starting with clang 425.0.24):
ld: warning: direct access in […] to global weak symbol […] means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
The symbol chooser is now owned by DocumentView instead of DocumentController.
The symbol chooser does not know about its owner and is not an observer of any notifications. Instead it has a property for “document” and one for “selectionString”. It is the owners job to update these properties (i.e. when switching document or changing the selection).
This isn’t ideal but better than a potential crash (following the next edit). A better solution will have to wait to a larger refactoring (which should also consider multiple editors working on the same buffer).
Closes#186.
When user drag-selects and moves mouse outside the viewport, we do not want to use ‘ensureSelectionIsInVisibleArea:’ because that method looks only on the selection, particularly the non-anchored end-point (and works differently for unanchored selections). Instead we want to scroll the point corresponding to the mouse position inside the viewport.
Fixes#475.