Commit Graph

454 Commits

Author SHA1 Message Date
Orta Therox
34fa11ab3d Add a horizontal 2px margin on the Folding closed indicator 2016-04-15 00:25:24 +07:00
Brian T. Kelley
2dd825515e Double Click to Select Typing Pairs
TextMate highlights certain character pairs (e.g. { }) when the caret passes over either of the characters. It can be useful to double click to select the text in between and including the character pairs for deleting code, copying code, for visually differentiating the affected code, etc. Add a select_unit_type, kSelectionExtendToWordOrTypingPair, to select the inclusive bounds of a typing pair if a match is found, or otherwise select a word as normal.

This patch is free and released into the public domain.
2016-04-15 00:25:24 +07:00
Ronald Wampler
18a79d3a3c Inactivate corresponding navigation menu items if no marks are present 2016-02-25 13:20:47 +07:00
Ronald Wampler
04af5fa295 Add menu items to allow navigating to arbitrary marks 2016-02-25 13:20:10 +07:00
Allan Odgaard
61ed07e2c3 Refactor 2016-02-25 13:18:20 +07:00
Ronald Wampler
9c3923b485 Ensure path exists when adding document to Recent menu
It's possible that the path on the document is set even though it does not exist on disk. E.g., when using `mate` to create a new document from the command line.
2016-01-29 08:46:18 +07:00
Vincent Bénony
041967d547 Fix dictionary lookup crash when looking up an empty string
It seems that the "showDefinitionForAttributedString:" can accept a nil argument, but not an empty string. The inserted test is preventing the call when the extracted string contains no characters.
2016-01-29 08:43:50 +07:00
Allan Odgaard
3478457098 Pass non-null arguments where the 10.11 SDK requires it 2015-11-20 13:12:16 +07:00
Allan Odgaard
bef024c73c Support using “force click” to look up words
This must be set in System Preferences → Trackpad → Look up & data detectors.
2015-11-19 22:34:54 +07:00
Allan Odgaard
b55ef5b09a Save all xibs with Xcode 7.1 (7B91b)
This was done in an attempt to prevent the warning saying “This file is set to build for a version older than the project deployment target.”

Unfortunately saving all the xibs did not get rid of the warning, even though tehy are all set to have 10.7 as their build target.

The latest xib format does however remove about 10.000 lines of XML.
2015-10-26 23:26:17 +07:00
Allan Odgaard
e621685fc1 Add makeTextStandardSize: action method 2015-10-16 19:53:16 +07:00
Allan Odgaard
9a1e05f489 Showing bundle menu with no status bar would cause infinite loop
This is because we were forwarding the message to ‘nil’ rather than the status bar, and ‘nil’ here would be first responder, i.e. ourself.

Fixes textmate/bugs#17
2015-10-16 19:14:36 +07:00
Ronald Wampler
054747974b Refresh when unfolding on mouse down event
This seems to be necessary when the document occupies less space than the visible document window.
2015-10-03 17:33:21 +07:00
Allan Odgaard
b6a7529d97 Bind tab size dialog to OakDocumentView instead of OakTextView
This ensures the setting is saved and also (sort of) follows the principle of least knowledge.
2015-09-10 14:20:51 +02:00
Allan Odgaard
871e013ed9 Add tabSize property to OakDocumentView
Going via this property ensures that the setting is saved.
2015-09-10 14:19:10 +02:00
Allan Odgaard
b1fa6524cb Save with Xcode Version 6.4 (6E35b) 2015-09-10 13:06:36 +02:00
Ronald Wampler
ac56d6e896 Move OakFlagState enum declaration out of method
Also, changed the `newFlagState` property to use the enum type.
2015-08-11 21:01:07 +02:00
Allan Odgaard
05e087f087 Use view-based table view in pop-up menu usable from snippets
Starting with 10.10 (I think) the text was no longer drawn in the proper highlight color. Switching to a view-based table view fixed that issue.
2015-08-08 11:34:06 +02:00
Allan Odgaard
b2c76df2da Fix incorrect type declaration 2015-08-05 12:27:06 +02:00
Allan Odgaard
9efde6d41b Don’t place a caret when ⌘-clicking a selection 2015-08-05 12:24:39 +02:00
Allan Odgaard
35e78feafc Check if we have an editor instance in input client methods
I’m seeing a few crashes where the most likely explanation is that input client methods are called either before setting up an editor instance, or after disposing it.
2015-08-05 12:23:06 +02:00
Allan Odgaard
828f6fdd37 Remove reference to OakView.h 2015-07-23 21:50:47 +02:00
Allan Odgaard
a13b75ebc4 Use isEqualToXYZ: or isEqual: instead of isEqualTo: 2015-07-20 12:10:05 +02:00
Allan Odgaard
b3ec7b4c05 Setup key view loop manually for main window
The auto-calculated key view loop includes everything, which means dynamically added elements such as the close buttons for tab view items, but worse, the subviews of a view-based table view. So this change is required before switching to a view-based file browser.
2015-07-20 11:40:59 +02:00
Allan Odgaard
a69711755f Read the line number scale factor from user defaults
If you dislike the downscaling of the line numbers then run the following in a terminal:

    defaults write com.macromates.TextMate.preview lineNumberScaleFactor -float 1
2015-06-25 17:09:54 +02:00
Allan Odgaard
86dc42fdf4 Add ability to unlearn words (as being spelled correctly)
This option is available in the context menu when bringing it up for previously learned words.
2015-06-24 00:42:05 +02:00
Allan Odgaard
f5fca8eb02 Refactor how we create context menu 2015-06-24 00:08:59 +02:00
Allan Odgaard
1767842229 Skip looking for shift/option modifier changes when mouse is down
Also skip updating the state if there has been no change (to the modifiers we’re interested in).
2015-06-18 19:21:52 +02:00
Allan Odgaard
265bdb6713 No need to queue an auto-refresh in the flagsChanged: method 2015-06-18 19:11:39 +02:00
Allan Odgaard
1919bce337 Delay context menu to next event loop cycle when using keyboard
This also failed prior to the recent refactoring. Might have started with 10.10, as I haven’t noticed this until recently.
2015-06-17 21:56:41 +02:00
Allan Odgaard
5d30498be2 Provide full line of context when asking for spelling suggestions 2015-06-17 21:41:10 +02:00
Allan Odgaard
70ef4c94c1 Remove use of deprecated NSSpellChecker API
We do not provide the full line to the new API, this will require a bit of refactoring.
2015-06-16 16:31:35 +02:00
Allan Odgaard
1ac59e2553 Update OakTextView to use NSDraggingSession API (10.7) 2015-06-16 16:20:39 +02:00
Allan Odgaard
980b0b9796 Double-tapping shift will now “deselect last” 2015-06-12 14:18:12 +02:00
Allan Odgaard
d17f509536 Implement a “deselect last” action method
If there are multiple (discontinuous) selections then this action will drop the last one.

If there are multiple carets (with no selections) then this action will drop all but the first caret.
2015-06-12 14:17:06 +02:00
Allan Odgaard
f4089e76fd Using Check Spelling at the end of a word now checks that word
This supports the workflow of typing a misspelled word and then using Check Spelling (⌘;) to fix it.
2015-06-12 14:16:12 +02:00
Allan Odgaard
b826f34584 Disabling anti-alias will now also apply to the line numbers 2015-06-12 14:14:39 +02:00
Allan Odgaard
9a7203cae1 Eliminate redundant anti-alias user defaults constant 2015-06-12 14:12:47 +02:00
Allan Odgaard
74ef6697ba Our doCommandBySelector: override should beep for unknown actions 2015-04-30 15:15:58 +02:00
Allan Odgaard
6c07075cc0 Improve behavior of command-clicking
When command-clicking an existing selection we remove the selection and insert a single caret.

When double/triple-clicking we remove existing carets/selections in the range that gets selected.
2015-03-24 18:26:01 +07:00
Allan Odgaard
7a7f5a9676 Preserve font scale factor when switching theme 2015-03-24 13:37:18 +07:00
Allan Odgaard
30be46a166 Support discontinuous selections in command input API 2015-03-08 14:21:59 +07:00
Allan Odgaard
0c9735c767 Show a heads-up display when changing font scale factor 2015-03-05 16:38:10 +07:00
Allan Odgaard
4a825499d6 Introduce font scale factor property
Previously increasing/decreasing font size would simply change the base font, making it non-trivial to know the current scale factor and/or reset it.
2015-03-05 16:38:10 +07:00
Allan Odgaard
40879d5683 Replace sizeofA macro with range-based for loop or std::begin/end 2015-03-05 16:38:09 +07:00
Allan Odgaard
b51f7f44af Rename bundles::item_t::full_name → name_with_bundle
Although not perfectly clear, it does better match what is actually returned from this member function.
2015-03-05 15:34:16 +07:00
Allan Odgaard
fcaa683a09 Do not invoke “did save” callback for untitled documents
The problem is that when something is saved, the text view is responsible for invoking the callbacks, but it might not show the document that was saved (e.g. in the case of Save All where background tabs are saved).

Long-term this should be improved so that OakTextView is not responsible for executing these commands; the challenge is that OakTextView supply a lot of the environment (like some of the TM variables), potentially the input, and is also the potentially receiver of the output.
2015-03-05 15:34:16 +07:00
Allan Odgaard
292e6eabb3 Macro recording would not replay inserted text
This broke when we changed from insertText: → insertText:replacementRange: as the latter selector is not replayable.

We now record this action simply as insertText: and ignore the “replacementRange” argument. This argument can be used by advanced input managers, so there might be an issue with text recorded using such manager, however, to properly support this we need to translate the “replacementRange” into something relative, which is left as an exercise for a rainy day.
2015-01-31 12:05:44 +07:00
Allan Odgaard
cca1f607fd Introduce updateDocumentMetadata as public OakTextView method 2015-01-29 14:38:29 +07:00
Allan Odgaard
b84cb097da Add Ignore Case and Wrap Around checkboxes to incremental search 2015-01-19 10:12:18 +07:00