Commit Graph

2932 Commits

Author SHA1 Message Date
Allan Odgaard
337ac1219d Preserve indent ignore matches for start/stop fold markers
See issue at http://lists.macromates.com/textmate/2016-January/039183.html

This is a continuation of 536ea62f2d
2016-04-18 20:10:17 +07:00
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
Allan Odgaard
e80f1ff49f Leaving out mark type will search for next/previous of any type
This commit is based on work by Ronald Wampler.
2016-02-25 13:11:12 +07:00
Allan Odgaard
26bee58d20 Use proper (NSInteger) type when dealing with Objective-C 2016-02-05 16:52:49 +07:00
Ronald Wampler
87df09684f CommitWindow: Force update of constraints after animation is completed
This is necessary to prevent resizing of the document view when removing and then immediately adding a new constraint to the document view.
2016-02-04 23:51:50 +07:00
Adam Strzelecki
83653f7b89 Settings: Empty string should be serialized as ''
Otherwise we get syntax error reading back the value from Global.tmProperties.
2016-01-29 08:46:18 +07:00
Adam Strzelecki
e59db8375f Use panel language unless spellingLanguage is specified
This partially reverts changes of 3fdc72b93a:
Support spell checking being “automatic by language”.

Before 3fdc72b spellingLanguage .tm_properties setting (default "en") was the
only way to set spelling language for file (buffer). English was default
language for all files. 3fdc72b introduced change that when “automatic by
language” was selected in system's spelling panel then TextMate was ignoring
spellingLanguage setting and was using automatic by language.

However because “automatic by language” is default on OS X, effectively 3fdc72b
makes spellingLanguage setting no longer effective. To make it work one needs
to set explicit spelling language either in System Preferences or in spelling
panel upon each TextMate run (since this is getting reset after application
restart) - which is counter-intuitive, can be treated as regression and it is
vaguely described in ChangeLog:

 * Support spell checking being “automatic by language”. This is set via the
   spelling panel.

This change presents alternative approach, introducing new empty
spellingLanguage setting "" (which is now default), which makes use system
panel language setting, including “automatic by language”.

From now on all files will be checked against system panel selected language
(or automatic), unless .tm_properties project specifies explicitly language for
given file using, eg.:

    [ locale-en_US.ini ]
    spellingLanguage = en_US

    [ locale-pl_PL.ini ]
    spellingLanguage = pl_PL

Or automatically depending on file name:

    [ locale-*.ini ]
    spellingLanguage = '${TM_FILEPATH/^.*locale-([a-z]+_[A-Z]+).*$/$1/}'
2016-01-29 08:46:18 +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
Martin Kühl
5960f139a0 Add prototype for bug macro
Compiling code that uses the `bug` macro
while the `NDEBUG` symbol is defined
(which it is by default)
results in “expression result unused” warnings
for each argument to the `bug` call.

This change adds the parameter declaration
from the debug version to the non-debug version,
which silences these warnings.
2016-01-15 12:07:16 +01:00
Allan Odgaard
78da1357fd File browser no longer refuses first responder on mouse clicks
Previously we would only accept first responder if clicking an already selected item, this was so that the user could select items in the file browser without losing focus from the text editor.

Unfortunately after switching to a view-based file browser, clicking an already selected item (even when the file browser does not have focus) brings up an edit-in-place text field which is undesired.

Worse is that it is brought up after a delay, so a user may for example click the file browser (to give it focus) and instantly initiates an action like duplicate, which brings up the edit-in-place text field for the new copy, but then after a short delay, will move the edit-in-place text field to the originally clicked item.
2015-12-06 19:56:57 +07:00
Allan Odgaard
b83f312e53 Remove dummy initializer method
With the 10.11 SDK we get a warning about this initializer not calling super, however, we do not intend for instances of this class to be created, which is why we had the dummy initializer.

We should remove this class entirely, as it’s a workaround for a problem that was fixed a long time ago, but I haven’t yet tested if there are still bundles using the (legacy) tm-file: URL scheme.
2015-11-20 13:33:01 +07:00
Allan Odgaard
edb38b0568 Refactor code to avoid overloading a system method
We were getting a warning because our method was called with nil, but the system method should be called with a non-nil argument.
2015-11-20 13:30:05 +07:00
Allan Odgaard
5af24f2c5e Call super’s init in designated initializer
This is to silence new warnings.
2015-11-20 13:25:02 +07:00
Allan Odgaard
bdbf82837f Add typecast to suppress warning with 10.11 SDK 2015-11-20 13:14:40 +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
edf2923f3a Allow obtaining character rectangle placed on the baseline 2015-11-19 22:29:27 +07:00
Allan Odgaard
1e10ef8ac2 Workaround for 10.11 regression 2015-11-18 09:57:29 +07:00
Allan Odgaard
bdcba4d66e Change --amend option to --commit-button-title Amend
This allows us to set arbitrary titles, should we need it in the future.

It also changes the code slightly so that there is only one method to create the full button title.
2015-10-29 09:30:23 +07:00
Allan Odgaard
e1bbc9f358 Change --rebase-in-progress option to --show-continue-button
Also change the property accordingly.
2015-10-29 09:03:16 +07:00
Jacob Carlborg
d988cf18c2 Support "Amend" as button title in the commit window
When the --amend flag is passed to the "commit" command, the commit
window will used "Amend" instead of "Commit" as the title for the
commit button.
2015-10-29 08:54:06 +07:00
Jacob Carlborg
cc7e2e8322 Add support for commit and continue in the commit window
The use case for this feature is when an interactive rebase is in
progress and be able to, in one command, amend the current commit
and continue with rebase.

By default, if the --rebase-in-progress flag is passed when the
"commit" command is invoked the commit button will be in a
"commit and continue" state. This is indicated by the title of the
commit button now being "Commit & Continue". If the option (⌥) key
is being hold down the state will revert back to the standard "commit"
state and the title will change to "Continue".

If the butten was clicked when it was in the "commit and continue"
state the "commit" command will print "TM_SCM_COMMIT_CONTINUE=1"
(without the quotes) to stdout as the last line. If the button was
clicked when it was in the standard "commit" state the output may
contain "TM_SCM_COMMIT_CONTINUE=0", or the "TM_SCM_COMMIT_CONTINUE"
string will be absent.
2015-10-29 08:54:06 +07:00
Allan Odgaard
8d8c539313 Truncate environment variables that exceed ARG_MAX
Previously we only logged an error when this happened, but (recently?) exceeding the limit will cause execve().
2015-10-28 15:38:18 +07:00
Allan Odgaard
57d0f29cdc Replace in folder would lose byte-order-mark for UTF-8 documents
This would only happen for documents not already open when performing the search and replace (in folder).
2015-10-28 15:37:04 +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
9490ff8967 Don’t re-use FSItems for expanded folders during reload
The problem is that the URL property for all descendents of this item are pointing to the old path.

Ideally we should recursively update the descendents, because the current workaround loses the expanded state of the folder.
2015-10-23 17:21:41 +07:00
Allan Odgaard
1cdf087e96 Reset target property when re-using file system item 2015-10-23 17:20:54 +07:00
Allan Odgaard
c8fce64ad6 Account for NSOutlineView expand animations when revealing item
To reveal an item we need to expand all parents, but after switching to a view-based outline view, expanding items will be done animated, and updating the outline view’s bounds won’t happen until after all animation has completed.

I tried adding a completion handler to the current animation context, but this ran before the bounds had been updated.

I also tried to disable expansion animation (when we have an item to reveal), but I was unable to make that work. What I did was group the expandItem:expandChildren: call in a new animation context for which the duration had been set to zero.
2015-10-18 10:34:53 +07:00
Allan Odgaard
cb75d41db3 Prevent opening two tabs for the same file
This could previously be done by creating a symbolic link and then selecting both the symbolic link and the original file, and selecting to open both at once.

Since the two tabs would have same identifier, the NSView for one of the two tabs could be left behind in the tab bar when manipulating the tabs.
2015-10-17 17:42:19 +07:00
Allan Odgaard
1597e68714 Do not show ‘0’ when holding command (⌘) in search results
The numbers indicate the key equivalent that can be used to jump to the document, but since cb1c516 we no longer support ⌘0.
2015-10-16 20:02:24 +07:00
Allan Odgaard
e621685fc1 Add makeTextStandardSize: action method 2015-10-16 19:53:16 +07:00
Allan Odgaard
cb1c51692c Bind Go to Tab → Last Tab to ⌘9 instead of ⌘0
Also avoid binding to ⌘0 in all other ⌘1-n contexts.

This frees up ⌘0 to “Reset Font Size”.
2015-10-16 19:52:47 +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
Michael Sheets
b06f20ca72 Add project scope for Cargo (Rust) projects (attr.project.cargo) 2015-10-10 19:30:22 -05: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
Ronald Wampler
a23b5225b1 Don't undefine/redefine "DEPRECATED" macro
We no longer use Apple's headers for `openssl` so this isn't necessary.
2015-10-03 17:33:21 +07:00
Ronald Wampler
5bbcf42487 Require LibreSSL instead of relying on the system provided openssl
Apple deprecated `openssl` in 10.7 and the headers are now removed in 10.11. Since we use some low level functions that are not provided in Apple's crypto frameworks, we now require are own version.
2015-10-03 17:33:21 +07:00
Ronald Wampler
3f5575cfe4 Directly convert the URL received from NSOpenPanel to a path
We call `fileURL` here but the method doesn't actually exists (it's actually a property with the getter `isFileURL`). The URLs we obtain from NSOpenPanel are paths so it's probably safe to get the path without checking if it's a proper file URL.
2015-09-21 09:50:49 -04:00
Ronald Wampler
75d3c74f05 OFBOutlineView: Rename draggedItems → draggedOFBItems
This property's name was conflicting with a private instance variable in our superclass (NSOutlineView) for the 10.11 SDK.
2015-09-21 09:50:49 -04:00
Ronald Wampler
f29ddf6500 Declare new protocols when building for 10.11
These were informal protocols prior to 10.11.
2015-09-21 09:50:20 -04:00
Ronald Wampler
9e4e88ce76 Explicitly cast back to the CGEventFlags typedef
The SDK for 10.11 (Xcode 7 GM and Xcode 7.1 beta) declares this enum using CF_ENUM instead of CF_OPTIONS, which forces us to explicitly cast back to the typedef type. <rdar://22743357>

Hopefully, we can revert this after OS 10.11 is officially released.
2015-09-21 09:50:04 -04:00
Allan Odgaard
10b1f3bfea Always clear SCM info when changing document
For a project window where only some tabs are under version control, switching from one tab with version control info, to one without, would use the info from the previous tab with the new one (proxy icon badge and scope attributes).
2015-09-10 14:24:28 +02: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