Commit Graph

207 Commits

Author SHA1 Message Date
Allan Odgaard
fe400c1487 Disable font smoothing for dark themes
If you wish to always have font smoothing enabled you can run:

    defaults write com.macromates.TextMate.preview fontSmoothing 1

Setting the value to 0 causes it to always be disabled and deleting the key (or setting it to 2) has it disabled only for dark themes.
2013-04-21 19:17:06 +07:00
Allan Odgaard
ced23336de Harmonize a few properties
This is just implementation detail.
2013-04-21 19:15:05 +07:00
Allan Odgaard
974e263588 Remove instance data from OakTextView.h 2013-04-21 19:15:05 +07:00
Sergey Chikuyonok
72dd8e2047 Extended OakTextView API
Added `scopeAsString` method to retrieve current scope as NSString
2013-04-21 12:20:07 +07:00
Allan Odgaard
773891cd47 Introduce global setting to disable typing pairs
This is presently only settable via the ‘disableTypingPairs’ user defaults key:

    defaults write com.macromates.TextMate.preview disableTypingPairs -bool YES

Closes #609.
2013-04-10 10:13:01 +07:00
Allan Odgaard
7f933bfc57 Disable auto-pairing when recording macros
Since auto-pairing can be adjusted via user customization we disable it for both macro recording and replay. Old macros will need to be updated (but this was already the case, as 2.0 never did pairing as part of replay).

A better solution is to record each implicit action of the auto-pairing in the macro. This can however be added later without breaking existing macros, as the macro player will remain the same.

Closes #130.
2013-04-10 10:13:01 +07:00
Allan Odgaard
0bf02dbeff Move divider line functions to OakUIConstructionFunctions.h 2013-04-02 04:11:32 +07:00
Allan Odgaard
d72baacff4 Move divider image creation to OakUIConstructionFunctions.h 2013-04-02 04:11:32 +07:00
Allan Odgaard
1aedd95ef5 Find dialog actions are now recorded (for replay)
Presently though replaying “Replace and Find” is not implemented.
2013-03-27 17:19:10 +01:00
Allan Odgaard
b0726652db Record find actions via primary selector
Still lack recording for Find dialog actions.
2013-03-27 16:27:54 +01:00
Allan Odgaard
3dc05d9fc9 Implement Save Macro functionality
Closes #459.
2013-03-27 14:32:22 +01:00
Allan Odgaard
7b115dc212 Always show tool tip when command fails 2013-03-26 13:46:36 +01:00
Jacob Bandes-Storch
37e98655ec Implement filter through command
Closes #131
2013-03-21 22:12:08 +01:00
Jacob Bandes-Storch
65eb9c271f Clean up formatting of selection string 2013-03-21 11:41:31 +01:00
Jacob Bandes-Storch
98a7cd1e08 Add an etched effect to the status/action bar dividers 2013-03-21 04:59:14 -05:00
Allan Odgaard
149d335335 Setup exception handler around editor_t::perform
The implementation of kPaste seems to generate an exception for some users, but I don’t know exactly why, so this should provide some better diagnostics info.
2013-03-20 11:30:41 +01:00
Allan Odgaard
315908e2d8 Update menu item titles in Text menu
These now reflect whether or not the action works on the selection.
2013-03-16 17:49:48 +01:00
Allan Odgaard
3a75199e9d Use menu validation to update bundle menu item titles
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.
2013-03-16 17:49:48 +01:00
Allan Odgaard
d8cf1e3591 Gather UI construction code and harmonize fonts 2013-03-13 12:38:11 +01:00
Allan Odgaard
be65671e52 Fix shell quoting for selected files
There would be a pair of redundant single quotes after each quoted path.
2013-03-10 16:07:09 +01:00
Allan Odgaard
14cfedb287 Implement Replace [and Find] bound to ⌥⌘G
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.
2013-03-07 16:21:57 +01:00
Allan Odgaard
5ad6d0c5c0 Simplify implementation of OakTextViewFindServer 2013-03-07 16:21:56 +01:00
Allan Odgaard
02f32977f2 Introduce Replace [and Find] in find protocol
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.
2013-03-07 16:21:47 +01:00
Boris Dušek
f4e2de14f2 Present the document view as a group to VoiceOver/accessibility
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.
2013-03-03 15:53:04 +01:00
Boris Dušek
944e1e32fa Make macro recording an NSToggleButton
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).
2013-03-03 15:42:18 +01:00
Boris Dušek
21c70057b4 Fix initial accessibility of symbol pop-up
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).
2013-03-03 15:41:54 +01:00
Boris Dušek
baf2839299 Add AXDescription to pop-ups to tell about their purpose 2013-03-03 15:41:48 +01:00
Boris Dušek
c3f57b0235 Add AXDescription to image buttons 2013-03-03 15:40:39 +01:00
Steven Clukey
7892eac2d4 Add “scroll past end” option to the View menu
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.
2013-03-03 15:14:29 +01:00
Allan Odgaard
f7f3fc3638 Copy incremental search string
Fixed #631 (again).
2013-03-02 09:26:35 +01:00
Allan Odgaard
acd3bdf234 Convert leading em-spaces in symbol menu to item indent
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.
2013-02-20 18:08:24 +01:00
Allan Odgaard
77f53c3e3e Use a const reference for gutter colors 2013-02-18 15:38:27 +01:00
Allan Odgaard
22b00f2848 Remove unused ‘textColor’ parameter 2013-02-18 15:38:26 +01:00
Allan Odgaard
95b4055772 Fix debug output
Also add leak-watching to OakTextView.
2013-02-16 10:43:55 +01:00
Allan Odgaard
d127483dcc Fix retain cycles
Fixes #794
2013-02-16 10:43:55 +01:00
Michael Sheets
ecd666f24a Improve constraint widths for status bar.
- 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.
2013-02-15 07:09:48 -06:00
Allan Odgaard
3669e671c7 Strip “offset” from selection string in status bar 2013-02-14 11:31:21 +01:00
Allan Odgaard
83505a47e2 Change status bar’s “caret” property
We now use a selection string so status bar doesn’t need to know about what it actually contains.
2013-02-14 11:31:21 +01:00
Allan Odgaard
94f0c803f7 Limit status bar redraw
The NSPopUpButton itself will not bypass redisplay even if it’s title is set to the current title.
2013-02-14 11:31:20 +01:00
Allan Odgaard
43fa57ae22 Don’t draw status bar background on window border 2013-02-14 11:31:20 +01:00
Allan Odgaard
9338109452 Fix NSTimer related crash
The timer might be the only thing keeping us retained, so we can’t release it until the very end of the method.
2013-02-14 11:31:20 +01:00
Michael Sheets
05af681717 Truncate the selection string when it grows too long. 2013-02-14 11:27:53 +01:00
Allan Odgaard
8f3e99bc79 Gutter height now accounts for horizontal scrollbar
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.
2013-02-13 10:51:07 +01:00
Allan Odgaard
3bc3db00aa ARC: Update OakTextView framework 2013-02-12 23:06:48 +01:00
Allan Odgaard
f886b0cb13 Update text view status bar to use system controls 2013-02-12 21:55:56 +01:00
Allan Odgaard
402e1f79b1 Use one bundle menu delegate for all menus
This avoids the problem of keeping the delegate retained while the menu is up (the menu item exists).
2013-02-12 20:11:50 +01:00
Allan Odgaard
4a812117e7 Fix memory leak 2013-02-11 15:17:30 +01:00
Allan Odgaard
a9e59f5308 Set spelling language for current folder when changed via UI
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.
2013-02-11 14:21:23 +01:00
Allan Odgaard
bdadf0f17f Let text view reset cut/copy menu item titles
This is necessary since opening the Edit menu with focus in file browser may update the titles to reflect files that would be cut or copied.
2013-02-11 14:21:23 +01:00
Allan Odgaard
f5541b2a1c Don’t try to toggle caret with no layout 2013-02-11 14:21:21 +01:00