Commit Graph

2760 Commits

Author SHA1 Message Date
Allan Odgaard
c032abb7e7 Checkin release notes v2.0-alpha.9559 2014-08-17 22:47:38 +02:00
Allan Odgaard
ecc2f3ad90 Strip ANSI escapes when mate reads from stdin
A warning will be written to stderr when this happens. The user can provide -e/--preserve-escapes to disable the behavior.

Use -e0/--preserve-escapes=0 to suppress the warning.
2014-08-17 22:24:23 +02:00
Allan Odgaard
2e4603bc8c Alphabetize getopt_long() options
This makes it easier to see what letters are still available.
2014-08-17 22:24:23 +02:00
Allan Odgaard
4669dbaa28 Remove commented fprintf statements 2014-08-17 22:24:23 +02:00
Allan Odgaard
babaf4d26e Deselect other when selecting bundle item source with option down 2014-08-15 23:24:13 +02:00
Allan Odgaard
bc31da8f03 Do not set a special initial title for dynamic menu items
Having an initial title that is different from what the user will see makes it harder for them to change the key equivalent, since they most know what this initial title is.

For more info see http://lists.macromates.com/textmate/2014-January/036949.html
2014-08-15 23:24:13 +02:00
Allan Odgaard
60f125eedc Use proper deallocator for SecKeychainItemCopyAttributesAndData 2014-08-15 23:24:13 +02:00
Allan Odgaard
ffa628f328 Opening folder after session restore would not see it as open
When opening a folder we test against the ‘projectPath’ property (on already open window controllers), but this is not setup until we have an open document, and documents are opened using a background queue, so code running in the same event loop cycle as the session restore, will not get the proper value for this property.

The problem this fixes is: open /path/to/foo and quit TextMate. Now drag /path/to/foo to TextMate’s app icon. TextMate would first restore session (which includes /path/to/foo) and then open /path/to/foo (not seeing the restored folder as being /path/to/foo due to the uninitialized ‘projectPath’ property).
2014-08-15 22:37:38 +02:00
Allan Odgaard
54270827ff Opening bundle item chooser will reset selection to first row 2014-08-15 22:37:38 +02:00
Ronald Wampler
df38101798 Use proper deallocator for SecKeychainItemCopyAttributesAndData
This was found using clang's static analyzer.
2014-08-15 15:21:12 -04:00
Allan Odgaard
d39ae2a7df Our grow calculation would fail to grow when given a size of one 2014-08-14 20:37:38 +02:00
Allan Odgaard
b1e40e6203 Fix placement of bundle item chooser when there is no window 2014-08-14 20:37:38 +02:00
Allan Odgaard
fb5a50135a Add status bar to bundle item chooser
This shows the semantic class or scope selector, when we are filtering on that field. Filtering on other fields results in an empty status bar.
2014-08-14 20:37:38 +02:00
Allan Odgaard
c8f6c1d440 Set content hugging priority to high for our buttons
None of our layouts rely on the buttons not hugging their content, so we set the hugging priority so that we do not have to worry about wether or not the constraints capture this requirement.

Curiously, if only the hugging priority is set (to high) for the horizontal orientation then the find dialog can end up with an undesired layout, although all constraints are met.
2014-08-14 20:37:38 +02:00
Allan Odgaard
9062154be5 Bundle item chooser: Disable ‘Edit’ button for menu items 2014-08-14 17:43:27 +02:00
Allan Odgaard
df5b6b7a88 Setup bundle item chooser actions before causing content reload
Triggering a content reload will update the ‘enabled’ state of our buttons. These will be disabled if we have no actions set.

Of course the API should be so that the ‘enabled’ state is also updated when setting the actions, but I am being lazy here.
2014-08-14 17:43:26 +02:00
Allan Odgaard
f88d6f5425 Don’t search for crash reports generated on 10.6 or lower 2014-08-14 17:43:26 +02:00
Allan Odgaard
f1c5d4f581 Learn abbreviations for menu items (in addition to bundle items)
Since the menu item’s title can change (e.g. Word or Selection) and multiple menu items can have the same title (e.g. Tab Size » 4, Toggle Foldings at Level » 4) we store the menu item’s action + tag for the abbreviation.
2014-08-14 17:43:26 +02:00
Allan Odgaard
a6eab1afe6 Use menu item as sender when triggering its action
This is required so that the receiver can ask the menu item (sender) for its tag value.
2014-08-14 17:43:26 +02:00
Allan Odgaard
4a20bfebaa Table cell: Use highlight color for key equivalent / tab trigger
Previously we would use highlight color if the table view was first responder. Now we use the highlight color if the cell’s background is set to NSBackgroundStyleDark, which then works when we use the cell in a table view which “shares focus” with a text or key equivalent field.
2014-08-14 17:43:26 +02:00
Allan Odgaard
44aece5a07 Change format of menu items in bundle item chooser
Changed from “submenu » item — Main Menu” to “item — Main Menu » submenu”.
2014-08-14 17:43:26 +02:00
Allan Odgaard
e8c0978192 Include menu items in bundle item chooser 2014-08-13 22:26:46 +02:00
Allan Odgaard
aea1abb977 Set NSLineBreakByTruncatingMiddle for bundle item cell
This is relevant when there is no filter string, as we then show a regular NSString which does not have an associated line break mode (unlike a string with marked up ranges).
2014-08-13 22:26:46 +02:00
Allan Odgaard
9da4c65c2d Remove unused ‘sender’ parameter 2014-08-13 22:26:46 +02:00
Allan Odgaard
8d26144668 Override doCommandBySelector: to avoid beep from super 2014-08-13 22:26:45 +02:00
Allan Odgaard
227b138112 Move table view movement helper to OakAppKit 2014-08-13 22:26:45 +02:00
Allan Odgaard
84e00599af Rework how we forward (movement) events to table view 2014-08-13 22:26:45 +02:00
Ronald Wampler
22cec6bb6b Do not use convertBaseToScreen: and convertScreenToBase:
These methods were deprecated in 10.7. Use `convertRectToScreen:` and `convertRectFromScreen:` instead. This is required for proper high resolution support.
2014-08-13 11:24:40 +02:00
Ronald Wampler
57f662c551 Do not use convertPointToBase: and convertPointFromBase:
These methods were deprecated in 10.7 and log warnings in the console when called. The documentation says to use `convertPointToBacking:` and `convertPointFromBacking:`, respectively, instead; however, these methods should not really be used in this case. We just want to store the top left position (point) of the OakChoiceMenu's frame in the OakDocumentView's coordinate systems so we can update its frame to the new position when OakDocumentView's bounds change. We do not need exact pixel alignment. The original choice to use the above deprecated methods was probably based on the use of `convertBaseToScreen:` and `convertScreenToBase:`, but these were also deprecated in 10.7. They can be replaced with the equivalent `convertRectToScreen:` and `convertRectFromScreen:`, respectively.

So instead, for this case, `convertRect:toView:` and `convertRect:fromView:` suffices and actually yields better tracking. (We could have used the corresponding "point" methods, as well, but we needed to convert the point to a NSRect to use `convertScreenFromRect:`, etc.)

With the original code, when the view bounds change, the position of the OakChoiceMenu would extend well below/above the placement of the caret.
2014-08-13 11:20:10 +02:00
Allan Odgaard
9dc869488b Use NSZeroSize instead of NSMakeSize(0, 0) 2014-08-13 11:19:49 +02:00
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.
v2.0-alpha.9557
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
Ronald Wampler
9fece6576c Retrieve the sheet delegate if present in main window 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
Joachim Mårtensson
2df7620b8d Add Ruby 2.0 support for build scripts 2014-08-03 09:05:33 +02:00
Allan Odgaard
d422a21006 Do proper string conversion of non-string values
Only values from the root target goes through this code, so it wasn’t causing a problem, as none of those keys had a multi-element array, but in ruby 2.0 embedding an array in a string seems to use inspect instead of to_s:

	Ruby 1.8: "#{['foo']}" #=> foo
	Ruby 2.0: "#{['foo']}" #=> ["foo"]
2014-08-03 09:05:09 +02:00