Commit Graph

3624 Commits

Author SHA1 Message Date
Allan Odgaard
f5c3693752 Checkin release notes v2.0-beta.9.2 2016-05-25 09:51:37 +02:00
Allan Odgaard
039b787d37 Use same newline heuristic for open document and find in folder
Previously the heuristic used (when files mix LF, CR, and CRLF) for searching files on disk (find in folder) was not identical to the heuristic used when opening files.

This meant that in rare situations a match could be found at what the find in folder determined to be the n’th line, but when opening the file, it was the m’th line (where m != n).
2016-05-24 21:56:00 +02:00
Allan Odgaard
91a7fa0ad2 Change heuristic to detect line endings
Only if there is consistent use of CR or CRLF will we treat the file as such, otherwise it is treated as LF delimited.
2016-05-24 17:11:24 +02:00
Allan Odgaard
0e7a04cede Don’t treat extraneous CRs when converting from CRLF
Our previous method of converting CR/CRLF files to LF representation was somewhat heuristic in that we would convert all CRs to LF and skip any LF following a CR.

While files should generally not mix and match line endings, it does occasionally happen in practice, and in that case, we do not want to “lose information” by converting too many newline characters to LF.
2016-05-24 16:51:36 +02:00
Allan Odgaard
b202ad3e02 Support arbitrary newlines for search result excerpts
Previously we expected only LF to mark a newline but in theory we can receive CRLF or CR separated text (from files on disk) which would cause incorrect excerpt for matches crossing line boundaries.
2016-05-24 16:49:54 +02:00
Allan Odgaard
7c074b92e5 Show carriage return in search results as <CR> using light grey 2016-05-24 16:39:17 +02:00
Allan Odgaard
2f2451cd5e Refactor code to generate attributed string for search results
This makes it easier to make other transformations than the current tab → em-space.
2016-05-24 16:37:08 +02:00
Allan Odgaard
3a2fc26c79 Handle return key for text view in Unknown Encoding sheet
Without full keyboard access enabled (System Preferences → Keyboard) the text view in the Unknown Encoding dialog would be the initial first responder, and while it’s read-only, pressing return would make the text view give up focus, rather than send the key to the window’s default button.
2016-05-22 22:32:58 +02:00
Allan Odgaard
0a9c70e7cb Fix bad indent (was using spaces instead of tabs) 2016-05-17 10:59:15 +02:00
Allan Odgaard
17ea3ec568 To open document in new project the null UUID must be used
Previously when providing a project UUID while opening a document, and no project used this UUID, TextMate would create a new project (with this UUID).

This was both a way to force a file to open in its own project, and to open multiple files in the same project, even though they did not share project folder.

The problem is that `mate` will read the `TM_PROJECT_UUID` environment variable and use as target project, which is generally desired, but incase we launch a new application from TextMate, and this application later opens a file via `mate`, it will use the old `TM_PROJECT_UUID` value, which might no longer exist.

We still allow forcing files to open in their own project by introducing a special “null UUID”, but with this change, it is no longer possible to use multiple invocations of `mate` to open unrelated files in the same project. Should this be desired, we can re-introduce this feature but require that `mate` is given the UUID via its -p/--project argument.

Fixes textmate/latex.tmbundle#150
2016-05-09 16:31:06 +02:00
Allan Odgaard
0ca13d8f25 Opening document on non-active desktop gave key to wrong window
When our application is activated and our key window is on a non-active desktop with windows on the active desktop, the system will give focus to one of the windows on the active desktop.

To workaround this we make our window key after our application has become active.
2016-05-08 23:24:20 +02:00
Allan Odgaard
59ef52b1f6 Don’t special-case bringing window to front when app is hidden
It used to be that if we called unhideWithoutActivation followed by makeKeyAndOrderFont:, and finally activateIgnoringOtherApps: then we would end with only the key window on top of other windows in the desktop space.

E.g. from a terminal (with TextMate hidden) using “mate -w” would cause only a single window to open on top of the terminal window, which seemed like desired behavior.

Unfortunately Apple have changed the behavior so there is no need to explicitly call unhideWithoutActivation as this is implied by activateIgnoringOtherApps:.
2016-05-08 23:17:26 +02:00
Allan Odgaard
417193e089 Update link dependencies for all targets
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.

The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.

Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
2016-05-07 13:00:55 +02:00
Josh Bernitt
263da53c81 Optionally draw a horizontal line for every tab stop
This can be toggled using View → Show/Hide Indent Guides or controlled per file type via the `showIndentGuides` setting in `.tm_properties`.
2016-05-02 19:58:01 +02:00
Per Persson
c5d7aa112d Add font size selection to print dialog 2016-04-27 22:08:36 +02:00
Allan Odgaard
2adf6aaf3c Enable layout constraints for the print panel auxiliary view
If this is not done, we get an “unable to simultaneously satisfy constraints” warning on 10.11.4 and possibly earlier versions. This is likely because the print dialog was redone to use layout constraints, but I don’t know which version of OS X nor do I know how this change affect the print dialog prior to the introduction of layout constraints.
2016-04-27 21:42:06 +02:00
Allan Odgaard
e38f529ba0 Checkin release notes v2.0-beta.9.1 2016-04-19 11:10:31 +07:00
Allan Odgaard
70d7587967 Change Jump to Next/Previous Mark shortcuts to F3/⇧F3
This is consistent with Next/Previous Bookmark shortcuts bound to F2/⇧F2.

The problem with ⌘> and ⌘< is that these keys are used to cycle through windows on some keyboard layouts.

Discussion at issue #1316.
2016-04-18 20:17:21 +07:00
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
Allan Odgaard
cd49f0e051 Checkin release notes v2.0-beta.9 2016-03-05 16:58:00 +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
42b6c04089 Load plug-ins before bundles
The reason is that if there are no bundles, we will extract the default set to Application Support, and in doing so, we call tar which implicitly sets up the command environment, which is re-used for all successive commands.

The problem is that loading a plug-in may add to the environment (e.g. setting the DIALOG environment variable), so if plug-ins are loaded after the call to tar (as would be the case for on a clean system), the DIALOG variable will be missing from the environment.

Kudos to René Schwaiger for discovering this issue.
2016-02-25 09:51:14 +07:00
Allan Odgaard
ac3e69b443 Group themes using their semantic class
The semantic class must be of the form: `theme.«group»[.«whatever»]*`.

If a theme lacks a semantic class, or the semantic class does not have a `theme.` prefix then the theme gets into the “unspecified” group.

In theory we could analyze the themes for dark/bright background, but manually classifying themes seems more flexible, for example some themes have a transparent background, which we could put into their own group.
v2.0-beta.8.6
2016-02-05 17:37:06 +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
272f691163 Edit->Spelling->System using system language
This sets '' (empty identifier) in Global.tmProperties that switches to system
specified spelling language (usually Automatic by Default which is OS X
default). It serves as a way back to the default when user picks any other
language than default from the menu for current buffer (effectively for
documents's directory).
2016-02-04 23:27:46 +07:00
Allan Odgaard
0a8360a8aa Add helper function to obtain the name for a locale identifier
E.g. da → Dansk, pl → Polski, etc.
2016-02-04 23:27:45 +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
a7d069fb40 Build with Travis 2016-01-15 12:07:16 +01:00
Martin Kühl
597a49015d Run tests synchronously by default
Running tests in parallel (which is the default)
results in spurious failures in the `scm` git tests,
probably due to an undiagnosed race condition.

This change lets tests run serially by default,
but provides a flag `-p` (or `--parallel`)
which enables running them in parallel again.

It also adds a variable `test_flags`
which is passed to each test run,
and which can be set by running

    env test="-v" ./configure
2016-01-15 12:07:16 +01:00
Martin Kühl
bbced5c3f3 Protect gen_credits against invalid responses
The `gen_credits` scripts can spuriously fail
raising this error in the `user_by_email` method

    NoMethodError: undefined method `[]' for nil:NilClass

when `YAML.load(response.body)` returns nil.

This change protects the build against these failures
by returning nil early.
2016-01-15 12:07:16 +01: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
2ec4e0d50c Update copyright to 2016 2016-01-15 12:07:16 +01:00
Allan Odgaard
ac08ce04f7 Disable app transport security
This is only required for the WebView which many bundle commands use to show online documentation and similar.

It’s impractical to maintain a whitelist of allowed domains.
v2.0-beta.8.5
2015-12-07 07:19:38 +07:00
Allan Odgaard
ce4572ef2b Convert TextMate’s Info.plist from old-style to XML
This is required for storing boolean values which the new NSAppTransportSecurity setting must use. It does not work using `YES` or `1` to represent `<true/>`.
2015-12-07 07:15:43 +07:00
Allan Odgaard
33f945eb02 Checkin release notes v2.0-beta.8.4 2015-12-06 20:12:23 +07: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