Commit Graph

2190 Commits

Author SHA1 Message Date
Allan Odgaard
e3ca295150 Set ‘attr.test.rspec’ for projects with an ‘.rspec’ folder
This scope can be used for the Re-Run mentioned in rspec/rspec-tmbundle#90.
2014-08-08 19:42:30 +02:00
Allan Odgaard
bc65a57957 Use OakIsEmptyString where appropriate 2014-08-08 19:42:30 +02:00
Allan Odgaard
8fa83238c1 Set key equivalent view to have “shared focus” with table view 2014-08-08 14:53:44 +02:00
Allan Odgaard
fbacbe246b Better first responder observing for shared focus with table view 2014-08-08 14:53:44 +02:00
Allan Odgaard
6810c2c883 Render bundle item table view as focused for key equivalent input
This is only when we are not recording a key, and the table view will be properly rendered as highlighted in this mode.
2014-08-08 14:53:44 +02:00
Allan Odgaard
357c66b4d1 Refactor how we send text field movement keys to a table view
The code is now easier to reuse.
2014-08-08 14:53:44 +02:00
Allan Odgaard
5bb42e8bc6 Setup the OakChooser controller as window’s next responder
This means any unhandled keyDown: ends up being overridable by OakChooser.
2014-08-08 14:53:44 +02:00
Allan Odgaard
673736e325 Table view sends ‘selection changed’ accessibility notification
Since we have the ‘drawAsHighlighted’ property it makes sense to make it post the accessibility notification when this property is set to YES and we do not have focus, rather than have the controller which change our selection be responsible for this.

A minor disadvantage is that there are multiple ways to change a table view’s selection. We assume that ‘selectRowIndexes:extend:’ is the canonical way to do it (and all code that wants to trigger VO notifications should use that method).
2014-08-08 14:53:43 +02:00
Ronald Wampler
3934f1be46 Use dictionary literals 2014-08-08 14:53:43 +02:00
Ronald Wampler
dab45a5c08 Remove no longer used option for the Commit Window
Originally, the "--ask" option was used in the previous commit window to change the NSTextField above the text view; however, no SCM bundles (in textmate's repos) currently uses it.
2014-08-08 14:53:43 +02:00
Allan Odgaard
afbc364fc3 Move highlight_ranges.h to ui subfolder
Only sources in the ui folder use this code and was previously including it from a parent folder, which breaks the hierarchical ordering of sources: you can include child folders, not ancestors.
2014-08-07 12:03:21 +02:00
Allan Odgaard
6e864a917d Avoid clash with NSCell’s keyEquivalent property
The rationale for the ‘string’ suffix is that our properties are things to be displayed rather than behavioral properties.
2014-08-07 12:03:21 +02:00
Allan Odgaard
0d496ea58c Look for process id file from 2.0-alpha.9553 and earlier
This is only when updating from an earlier version: Previously we would not find the pid file from the old instance and thus not tell it to quit.
2014-08-07 12:03:21 +02:00
Allan Odgaard
271608a7b0 Use NSTextInputContext instead of NSInputManager
The latter has been deprecated since 10.6 but hasn’t given any deprecation warnings (and it’s not like I’m eager to touch the NSTextInput protocol implementation, as I just barely understand how this stuff is supposed to work).
2014-08-07 12:03:21 +02:00
Allan Odgaard
0890b2aab0 Use local event monitor for key equivalent view
This ensures we get all key events, for example in the bundle item chooser window the pop-up button’s menu would previously see the key down event before the key equivalent view, so enabling recording and pressing ⌘1-3 would not record that key equivalent, but instead activate the corresponding (pop-up) menu item.
2014-08-07 12:03:21 +02:00
Zete Lui
17128edfc1 Loop select items in Chooser
If `enableLoopFilterList` is set to `YES`:

- when at top, pressing <Up> selects the last item on bottom
- when at bottom, pressing <Down> selects the first item on top
2014-08-03 09:15:34 +02:00
Joachim Mårtensson
2eaa97b1dc Remove compiler error 2014-08-03 09:05:37 +02:00
Allan Odgaard
c0c193ce7f Update some ruby shebangs 2014-08-03 09:04:57 +02:00
Allan Odgaard
10b6941e13 Extend bundle item chooser’s search capabilities 2014-07-31 15:36:19 +02:00
Allan Odgaard
fef0ed8fc5 Use ruby18 shebang in bundle command template 2014-07-31 15:36:19 +02:00
Allan Odgaard
833d724779 Check for failure when creating CTLineRef related objects 2014-07-31 15:36:19 +02:00
Allan Odgaard
bb3b997a56 Do not create temporary CTLineRef for lines without tabs
This also avoids creating the paragraph style object for these lines.
2014-07-31 15:36:19 +02:00
Allan Odgaard
082c665457 Do not create tab stop at location zero
I do not understand what the point of this tab stop is.
2014-07-31 15:36:19 +02:00
Steven Clukey
98dfefb5e0 Add space invisible
The implements the space invisible using the new method of drawing the invisibles so it does not affect right-to-left text.
2014-07-31 15:36:18 +02:00
Steven Clukey
e0c6e14de0 Make CoreText manage the tabs
Rather than putting tabs in their own node, leave them in the text nodes and allow core text to handle the size. This fixes the issue with using tabs in right-to-left text.
2014-07-31 15:36:18 +02:00
Etienne Samson
a52fc3493b Make the Find and HTML window switch back to a Space TM is actually in 2014-07-30 18:18:02 +02:00
Allan Odgaard
421f087b18 Do not destroy shared authorization rights
Each time we used an authorization right in the privileged helper tool, TextMate would lose the right since the helper tool destroyed it after use.
2014-07-30 17:40:23 +02:00
Allan Odgaard
795909748b Only report privileged helper tool outdated when a new one exists
This is so that we can use the privileged helper tool from tests, assuming it has already been installed.
2014-07-30 15:15:47 +02:00
Allan Odgaard
135667b655 Add file type extension to document backups 2014-07-29 23:48:37 +02:00
Allan Odgaard
86dd335024 Don’t read bundle sources or signing keys from disk
This was to allow third party indexes but we newer got anywhere with that, so it’s just unnecessary code complexity and the potential for problems if the files on disk are wrong.
2014-07-29 22:33:24 +02:00
Allan Odgaard
acaf24dca0 Remove unused code
This should have been removed in 36cfb177a5.
2014-07-28 21:57:44 +02:00
Boris Dušek
ae373343c1 Implement basic accessibility for OakKeyEquivalentView
I experimented a lot with different combination of attributes, this one works
reasonably well compared to the others (even though it is less feature
complete). I may revisit experimenting with it at some later point.
2014-07-28 17:10:15 +02:00
Boris Dušek
279ac58bf4 Improve accessibility for OakBundleItemCell
More specifically item's displayed keyboard shortcut or tab trigger is now
announced by VoiceOver.

Implementation of accessibilityAttributeValue:forParameter: returns nil for
some attributes. This is a hack to avoid doing tedious adjustments of certain
parameterized attributes (like AXStringForRange, AXAttributedStringForRange,
AXBoundsForRange, AXRTFForRange) for string AXValue that is extended (appended)
by extra information at its end in accessibilityAttributeValue:. To get an idea
how tedious this is (even though our case is a bit simpler by not *prepending*
anything before the AXValue, and not being an editable field), look at
OakLinkedSearchFieldCell. This looses the ability for the user to interact with
the text, but considering how seldom this will be used (if at all), for now
this seems acceptable.

This is needed because VoiceOver asks for the *StringForRange attributes and if
implemented, will never query AXValue (which is where our custom behavior is).

In the future when tables will be migrated from cell-based to view-based ones,
the tab trigger or shortcut could be a separate NSView, which would probably
allow for much more elegant solution to this problem.
2014-07-28 17:10:15 +02:00
Boris Dušek
2d554bd7bc Use AXValue of OakChooser's cells for accessibility announcements
Previously we used [NSCell stringValue], which is not suited for cells with
custom implementation for AXValue accessibility attribute.
2014-07-28 17:10:15 +02:00
Jeremy Whitlock
f3b6c07bfb Make ⌘F default to 'Selection' for multi-line selection
Previously using ⌘F with a multiline selection would automatically set the “in”
pop-up to “Document”. This is no longer the case, but can be brought back by
running: `defaults write alwaysFindInDocument -bool YES`
2014-07-27 22:55:39 -06:00
Allan Odgaard
2d09d503ee When clearing marked range, ensure pending range is also cleared
This fixes an issue with complex input managers.

Using Chinese pinyin input and entering ‘ci’ followed by ‘1’ to insert first glyph would insert the glyph (‘刺’) and then set the pending marked range (0-2), which would have caret end up in the middle of a multi-byte sequence.
2014-07-24 22:37:38 +02:00
Allan Odgaard
cc7f149f52 Avoid using Application Support for temporary file
Since the user’s library folder might be on a network we should probably avoid writing to it unless strictly necessary.
2014-07-24 22:37:38 +02:00
Ronald Wampler
d2b3610059 VariablesPreferences: Abort editing before deleting a row
This prevents `tableView:objectValueForTableColumn:row:` from throwing an exception (index beyond bounds) when the user deletes the last row while it is being edited.
2014-07-19 14:14:22 +02:00
Ronald Wampler
ad37b94e3f VariablesPreference: Disable delete button when table is empty 2014-07-19 14:14:21 +02:00
Boris Dušek
7e01bab12a Optimize Zoom support a little bit
This makes Zoom support avoid doing all 2 conversions between UTF-8 to UTF-16,
and replaces call to rect_for_range with call to rect_at_index, which is
more efficient.

Note that this is a typical micro-optimization not resulting from any
actual performance measurement, but just from a desire to have a lean
code not doing redundant work.
2014-07-19 14:14:21 +02:00
Boris Dušek
17c5df94ca Fix textmate/bugs#5
When setSelectionString is called during editing of text (like inserting
or deleting a character), it catches layout in a semi-consistent state
where horizontal position of individual characters cannot be determined.
Therefore during such events, we cannot pass the correct screen position
to the call to UAZoomChangeFocus.

So let's do the UAZoomChangeFocus call after this iteration of run loop.
This ensures everything in layout that had to update has updated when
calling UAZoomChangeFocus, thus enabling us to provide correct horizontal
screen position.
2014-07-19 14:14:21 +02:00
Boris Dušek
e08a40a507 layout: Fix bol_as_eol for case where range length is 0
bol_as_eol was meant for non-empty ranges, but the only place where
empty ranges were attempted with bol_as_eol was for Zoom tracking,
and it seems like I did not re-test Zoom after making the bol_as_eol
commit.

Fixes textmate/bugs#4
2014-07-16 23:21:21 +02:00
Allan Odgaard
1d57e46493 Let OakChooser decide when to render table view as having focus 2014-07-10 23:43:20 +02:00
Allan Odgaard
922f9c13af Add ‘drawAsHighlighted’ public table view property
This allows factoring out the decision of when to draw as highlighted.
2014-07-10 23:43:20 +02:00
Allan Odgaard
81e47090cc Call recalculateKeyViewLoop after current event loop iteration 2014-07-10 23:43:20 +02:00
Allan Odgaard
36cfb177a5 Leverage the default implementation of bindings 2014-07-10 23:43:20 +02:00
Allan Odgaard
4f19370458 Let key equivalent field pass unused key down events to super 2014-07-10 23:43:20 +02:00
Allan Odgaard
01fe210895 Key equivalent field no longer activate recording on return
This is to allow using the control in windows with a “default” button (which gets the return key).
2014-07-10 23:43:20 +02:00
Allan Odgaard
bfb33e6144 Let bundle item chooser’s ranker remember user corrections 2014-07-09 22:14:41 +02:00
Allan Odgaard
d4ca90724a OakChooser: Reselect first item when filter string is changed 2014-07-09 22:14:40 +02:00