53 Commits

Author SHA1 Message Date
Allan Odgaard
1b09d05221 mate: We no longer need to link with the ‘cf’ framework
This is since commit a31dd336b4.
2020-04-29 08:02:02 +07:00
Allan Odgaard
a31dd336b4 Change away from deprecated API
Although one of the new API methods is deprecated starting with macOS 10.15, but that change is minor, and the replacement wasn’t introduced before macOS 10.15.
2020-04-21 15:05:50 +07:00
Allan Odgaard
5bcb4ea4f9 Enable Objective-C for mate executable
This is so that we can move away from deprecated APIs.
2020-04-21 15:05:50 +07:00
Andreas
5a58f05a1a Syntactic Typo 2020-02-28 12:54:02 +07:00
Allan Odgaard
36dc1374f9 Revert "Add debug output when TextMate is activated via mate"
This reverts the following 3 commits:

- commit 306d46ec71
- commit eecfe6e619
- commit 2ffc74ad8b
2019-08-26 21:19:17 +02:00
Allan Odgaard
2ffc74ad8b Add debug output when TextMate is activated via mate
Some users report a significant delay from executing mate until the TextMate window is brought to front.

The debug information can be extracted by running the following in a terminal:

    log show --predicate 'subsystem = "com.macromates.TextMate" && category = "BringToFront"'

Alternatively use `stream` instead of `log` to get a live stream of debug output.

See `man log` for options such as `--start date/time` (to limit the query to e.g. the last 10 minutes)
2019-07-13 10:20:09 +02:00
Allan Odgaard
9078ae7771 Use __DATE__ instead of (custom) COMPILE_DATE macro
I prefer the YYYY-MM-DD format of our custom macro, but it has a problem with precompiled headers in that the macro changes value daily, and so, if specified when precompiling headers, they become invalid the next day.

Previously we solved it by declaring the macro only for application targets, but the new build system is not hierarchical in the same way and does not currently support this.
2019-06-26 23:32:54 +02:00
Allan Odgaard
7031dfd415 Escape newlines and backslashes in parameters sent by mate to TextMate 2018-06-11 08:13:26 +02:00
Allan Odgaard
ddb7a63074 Update mate’s help text to show mark’s value as optional 2017-03-10 12:22:35 +07:00
Allan Odgaard
204c735079 Change bundle identifier to com.macromates.TextMate 2016-10-23 00:21:09 +07:00
mathbunnyru
440414f96c Use nullptr in all C++ files instead of NULL
This brings us a bit of extra type safety, for example where an integer is expected, nullptr should be disallowed by the compiler (unlike NULL).
2016-10-22 21:40:14 +07:00
mathbunnyru
0b034f9a9d Use std::string’s compare to avoid searching beyond the prefix length 2016-10-17 10:50:18 +02:00
Allan Odgaard
46fb745bbe Use perrorf when printing errors with dynamic strings
Also revise error messages to be more consistent.
2016-08-28 17:25: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
Allan Odgaard
8c3177113f Add missing newline to error output 2015-03-26 12:19:19 +07:00
Ronald Wampler
5841528b23 Update mate usage information for setting marks 2014-11-27 08:03:00 +07:00
Allan Odgaard
c7c789a57b Don’t treat --set/clear-mark argument as a comma separated list 2014-11-04 13:52:23 +01:00
Allan Odgaard
f16e83fb4f Get rid of APP_REVISION
This was just mirroring the last part of our version number so redundant and it wasn’t monotonically increasing as we switched from alpha.n → beta.1 (with n > 1), so it probably did more harm than good.
2014-10-30 20:49:10 +01:00
Allan Odgaard
65e72d9ed2 Allow both --clear-mark and --set-mark in one invocation of mate
The advantage is that TextMate will update the marks in a single refresh cycle, so there is no redraw after clearing the old marks and before setting the new, which could cause a short flash.

When using both, the --line arguments specified are used for --set-mark.
2014-10-17 13:42:08 +02:00
Allan Odgaard
a570395480 Add --set-mark/--clear-mark options to mate 2014-10-14 22:15:03 +02:00
Allan Odgaard
c91837ce1b Use string instead of double for mate’s version number
With a double we can’t use version numbers like 2.8.1 or 2.10.
2014-10-14 14:36:25 +02:00
Allan Odgaard
10be561065 Improve mate usage information 2014-10-13 23:20:24 +02:00
Allan Odgaard
29019d536b Read mate options from the MATEFLAGS environment variable
This is useful for users who want to permanently set things like --[no-]recent and --[no-]escapes.
2014-10-03 21:49:09 +02:00
Allan Odgaard
c7ef9d2d78 Fix typo 2014-09-02 21:16:43 +02:00
Allan Odgaard
2aae17aeb3 fixup! Add items to recent menu when ‘mate’ is called without -w option 2014-09-01 17:36:57 +02:00
Allan Odgaard
7d448c993f Remove --change-dir from mate’s usage information
I don’t think anyone uses it, so consider it deprecated and subject for removal.

Also update the short options list to the currently valid options.
2014-08-30 16:19:23 +02:00
Allan Odgaard
db1fa96114 Add items to recent menu when ‘mate’ is called without -w option
One can force adding to the recent menu by using --recent or disable it (for files we do not wait on) using --no-recent.
2014-08-30 08:51:33 +02:00
Allan Odgaard
4afbf0c0e3 Remove incorrect text about -w being ignored for multiple files
Also update it in an attempt of improving it.
2014-08-28 22:02:49 +02:00
Allan Odgaard
9c5557b442 Boolean mate options are now --[no-]option to force on/off 2014-08-28 22:02:49 +02:00
Allan Odgaard
b624726f9f Remove unused option 2014-08-28 22:02:49 +02:00
Allan Odgaard
14211e5f29 Change all local variables to use camelCase 2014-08-28 22:02:49 +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
8d9a2f5426 Improve lifetime of the authorization wrapper used by mate
While the memory was released during exit, we didn’t free the authorization right, which is shared between multiple processes, unsure if that would actually leak any resources.
2014-07-30 17:40:23 +02:00
Allan Odgaard
c272afaff2 Cleanup/harmonize whitespace
Leading indent should consist only of tabs, beyond that, only spaces should be used.
2014-04-25 16:55:31 +07:00
Allan Odgaard
6359a2ef7c Use symbolic exit success/failure constants 2014-04-21 17:05:35 +07:00
Allan Odgaard
5b47dca1e6 Add ‘sysexits.h’ as a precompiled header 2014-04-14 08:55:06 +07:00
Allan Odgaard
69c83e56df The ‘const’ keyword should be to the right of its type
The standard doesn’t care which side the keyword is placed on, but placing it on the right makes it easier to read types.

E.g. reading “int const* const” from right to left we get “const pointer to const integer”.
2014-03-31 08:27:19 +07:00
Allan Odgaard
db13d4c1f9 Use std::string::back() instead of operator[] with size()-1 2014-03-31 08:27:18 +07:00
Allan Odgaard
6cbf04547e The mate command will only default to UUID when stdin is empty
This is a minor change of the behavior introduced in 18d9aa030, which made it default to the new --uuid mode when TM_DOCUMENT_UUID was set, and no files were given. This meant that commands (executed from TextMate) could not do something like:

    echo foo|"$TM_MATE"

Since there is no way to know if data is actively being sent to mate, we check if the length of data read is zero, and treat that as “no data was sent to mate”, but in theory a command could pipe potential empty user data to mate, which would lead to the wrong behavior. A command that may do this, should unset the TM_DOCUMENT_UUID environment variable.
2014-02-26 08:29:42 +07:00
Allan Odgaard
6c31a849b1 Use constants from sysexits.h for mate failure codes 2014-02-23 23:18:52 +07:00
Allan Odgaard
18d9aa030b Add -u/--uuid option to mate shell tool
If no files are specified, the -w flag is not used, and TM_DOCUMENT_UUID is set, then this argument defaults to the value of the TM_DOCUMENT_UUID environment value.
2014-02-11 16:45:39 +07:00
Shane Becker
b1fe3b7561 Added a possessive apostrophe to mate -h
TextMate's, not TextMates.
2013-10-24 16:04:35 +02:00
Grant Hollingworth
fa1f4254cb Remove obsolete help text for mate -n 2013-07-21 13:25:14 +02:00
Allan Odgaard
17ef6ef5d0 Use path::is_absolute instead of custom code 2013-03-14 10:14:45 +01:00
Allan Odgaard
e75e7ec8e5 Change text::format → std::to_string (C++11) 2013-02-08 11:20:34 +01:00
Allan Odgaard
216bcb61ac mate: don’t disable untitled document when called w/o files 2013-02-03 10:48:44 +01:00
Allan Odgaard
84587dccc9 mate: disable untitled document via user defaults
This is instead of setting an environment variable. Since there already is a user defaults setting for whether or not we want an untitled document created at startup, it seems nicer to have mate set that, instead of effectively introducing an alias for the setting.
2013-02-03 10:48:43 +01:00
Allan Odgaard
eb3e7dd8f2 Fix running mate via sudo
Since we now use the (numeric) user ID as part of TextMate’s named socket (to allow multiple users on the same system to each run an instance of TextMate), mate needs to know this.

Running ‘mate’ via ‘sudo’ has getuid() return zero (root), hence why we need to specifically handle this.
2012-08-31 23:16:39 +02:00