Commit Graph

1130 Commits

Author SHA1 Message Date
Allan Odgaard
2c2ef93521 Don’t keep mutex locked longer than required 2013-03-20 11:30:41 +01:00
Allan Odgaard
42cd2f93df Make fs::tree_t member data private 2013-03-20 11:30:41 +01:00
Allan Odgaard
3ceefce2e4 Improve renaming files with hidden extension
We now clear the “hidden extension” flag if the user manually adds it.

We also ensure the hidden extension is not ignored by comparing base name with display name. The flag is ignored under certain circumstances.

Comparing base name with display name alone may give a false positive for localized file names.
2013-03-20 11:30:41 +01: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
2c85ef9ac2 Move crash reporter info to utility.h 2013-03-20 11:30:40 +01:00
Allan Odgaard
e1e0e5a8a5 Re-use download window if already visible
This is useful if a new update arrives after TextMate has downloaded the previous update but before the user relaunched TextMate.

Fixes #909.
2013-03-19 16:24:56 +01:00
Allan Odgaard
769831f629 Use Objective-C literals 2013-03-19 15:49:18 +01:00
Allan Odgaard
bd34c84253 Remove support for disabling file browser status updating
This preference was introduced as a workaround for poor performance when displaying large folders, this however should no longer be an issue.
2013-03-19 15:02:32 +01:00
Allan Odgaard
d68e6a0499 Dragging last tab from window w/o file browser will close window
Closes #904.
2013-03-19 14:56:23 +01:00
Allan Odgaard
281bccd969 Remove outdated TODO 2013-03-19 14:56:23 +01:00
Allan Odgaard
957d6d018d Don’t treat directories as executables
Related to issue #907.
2013-03-19 14:56:22 +01:00
Allan Odgaard
beb5348e32 Don’t abort when failing to run subcommand
Fixes #907.
2013-03-19 14:56:22 +01:00
Allan Odgaard
b3c9276f9c Find dsym archive using new naming convention
We gracefully fallback on the old naming convention.
2013-03-19 14:56:22 +01:00
Allan Odgaard
21bf41b0c6 fixup! No longer support deleted items in bundle’s info.plist
We still need to cache the ‘deleted’ key since delta items use this to indicate keys deleted in the local version.
2013-03-18 14:34:08 +01:00
Allan Odgaard
916725b0d2 Use constant for version of property cache format 2013-03-18 14:34:08 +01:00
Allan Odgaard
b96a4975e6 Use array for cached settings names
We previously used a dictionary so that initializing a bundle item object wouldn’t need to know the difference between a full property list and a cached subset. Technically though the previous code had an implicit assertion on the bundle item not being able to rely on the settings values being useful, which is now gone.

The main advantage though is a smaller and more correct cache format.
2013-03-18 14:34:07 +01:00
Allan Odgaard
12e5693361 Delete cached bundle items when changed on disk
Effectively it doesn’t change much as cached items are fetched with a file date, but in theory it should now be possible to omit that date (if we can trust that fs-events has always notified us about disk changes).
2013-03-18 14:34:07 +01:00
Allan Odgaard
f0fd87bf66 Only use cache file if at version 1
Since it’s not unlikely that a user will downgrade from a nightly build, we should be prepared to see cache files using a newer (incompatible) file format.
2013-03-17 16:03:11 +01:00
Allan Odgaard
062f78118a Don’t (re)scan when creating fs::node_t
Also make it optional to provide a map pointer (for collecting changes) when rescanning.
2013-03-17 16:03:11 +01:00
Allan Odgaard
04142cbf69 Bundle loading no longer done by static member function 2013-03-17 16:03:11 +01:00
Allan Odgaard
7d6763eee7 Avoid member data access when constructing bundles::item_t 2013-03-17 16:03:11 +01:00
Allan Odgaard
594bfcb29d No longer support deleted items in bundle’s info.plist
Recording that an item is deleted in the bundle’s info.plist is necessary for TextMate 1.x because it merges all installed bundles, so if the user has a local version, he will still see items from the default version, unless these are indicated to be deleted in the local version.

With 2.0 only delta bundles get merged with a less-local bundle, and when deleting a default item, a delta item is written with the ‘isDeleted’ key set to true.
2013-03-17 16:03:10 +01:00
Allan Odgaard
f888376e05 Move bundle loading to own file 2013-03-17 16:02:30 +01:00
Allan Odgaard
0f9b15b916 Show error when property list fails to parse 2013-03-17 15:44:07 +01:00
Allan Odgaard
c6375e2ed9 Add success/failure to plist::parse_ascii API 2013-03-17 15:44:07 +01:00
Allan Odgaard
5dcbbde817 Let user know if saving in bundle editor fails 2013-03-17 15:44:07 +01:00
Allan Odgaard
0d2af1fbfa Don’t use posix_spawnattr_setpgroup
This appears to fail in rare circumstances and there is no reason why the io::exec code sets up a process group, so easier to just remove this.
2013-03-17 15:44:07 +01:00
Allan Odgaard
dfee671b6a Don’t use POSIX_SPAWN_CLOEXEC_DEFAULT on 10.7
Using this flag on 10.7.5 seems to cause a kernel panic.

Fixes #896.
2013-03-17 15:44:06 +01:00
Allan Odgaard
398e55cdbe Add helper functions to get OS version
We need this in a few places and while calling Gestalt() isn’t that much code, that function is deprecated in 10.8 and the alternative is a lot more code, so we don’t want to repeat that once we update the code.
2013-03-17 15:44:06 +01:00
Allan Odgaard
45dc49eb29 Retire compiler workaround
Previously we could get a compiler error when using std::map<std::string, std::string>() as a default argument.
2013-03-16 17:49:49 +01:00
Allan Odgaard
15c27135fd Change folder pop-up to pull-down
The menu contains two (non-selectable) “actions”. If we use a pop-up, we have to change the selection after the user select one of these actions, which isn’t the case with a pull-down menu.
2013-03-16 17:49:49 +01:00
Allan Odgaard
b0a0df831a Add ability to set project folder via file browser
For now it is done via a new menu item in the top folder pop-up. It might be useful to also show this menu item in the general action menu.
2013-03-16 17:49:49 +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
5caca35fc7 Use menu validation in OakShowMenuForBundleItems 2013-03-16 17:49:48 +01:00
Allan Odgaard
04e8eb44a2 Introduce updateTitle: for NSMenuItem
Since we create an attributed title when the menu item has a tab trigger or “inactive” key equivalent, we can’t later update the title via the title property.
2013-03-16 17:49:48 +01:00
Allan Odgaard
8313dcb407 Remove status bar graphics
This is no longer used since the OakStatusBar class has already been deleted.
2013-03-16 17:49:48 +01:00
Allan Odgaard
29e0a2fec5 Make the rmate listen port a string instead of integer
When using an integer it got “pretty printed” by NSTextField (to have a thousand separator). If the user would “commit” this version, the version with the thousand separator would be stored in user defaults, which would make TextMate fail t listen to the desired port.
2013-03-16 17:49:47 +01:00
Allan Odgaard
2d4d4729d2 Remove ‘rmate’ submodule
With the script installable via rubygems there is no longer any reason to include it with TextMate.app and thus keep it as git submodule.
2013-03-16 17:47:19 +01:00
Allan Odgaard
6ac4aab910 Use custom menu item title for key equivalents
The rendering doesn’t mimic the system 100%, for example the key equivalents are not centered on the split between modifiers and the key, nor are F-keys rendered using a smaller font / menu glyph.

On the plus side though, now all keys are rendered. Previously keys shared with other (non bundle) menu items would only be shown for one of the items sharing the key, and some keys would simply not be shown (e.g. ⌃#).

Also, bundle menu items no longer “eclipse” regular menu items, which could previously happen even when the bundle menu item wouldn’t fire (as it was scoped for something else than the current context).

Fixes #894.
2013-03-14 10:14:46 +01:00
Allan Odgaard
619c19e8ed Space can be used instead of slash in file chooser (⌘T)
This enables full path search.

Closes #893.
2013-03-14 10:14:45 +01:00
Allan Odgaard
34bf85d8d1 Remove whitespace when shifting text left
Previously shifting text left/right would ignore blank lines (as noted in issue #419).

When shifting left though it does make sense to delete whitespace, especially as the same code is used to re-indent when pasting.

Fixes #810.
2013-03-13 12:38:12 +01:00
Allan Odgaard
0075b46c82 Introduce zeroIndentPattern
This will give the matched lines zero indent but without affecting the following lines.

Probably the only use-case for this is C preprocessor directives.
2013-03-13 12:38:12 +01:00
Allan Odgaard
d16f3bcc1e Use per-line indent patterns when estimating indent
This solves the problem where we need to estimate the current line’s indent, but the lines above it is a multi-line block comment. Previously we would fetch indent patterns based on the current scope, then find the first line above caret, for which the patterns can be used to estimate the indent. The problem is that the commented lines without comment markers would be treated as code, and used for the indent.

With the new approach, we can set different patterns for ‘comment.block’ (the C bundle already does this), which basically ignore all the lines, which will cause TextMate to use the code above the comment to estimate indent.

This commit closes textmate/c.tmbundle#3 and also closes textmate/php.tmbundle#24.
2013-03-13 12:38:12 +01:00
Allan Odgaard
b5eb83d383 Refactor code 2013-03-13 12:38:12 +01:00
Allan Odgaard
d8cf1e3591 Gather UI construction code and harmonize fonts 2013-03-13 12:38:11 +01:00
Allan Odgaard
9f8b7bf27c Improve layout constraints for labels
The widest should now be exactly 20 pixels from the window’s left border, and the others are right-aligned with this label.
2013-03-13 12:37:23 +01:00
Allan Odgaard
b5136bcdc7 Set window’s defaultButtonCell
This is instead of setting the key equivalent to ‘\r’ for the button that should be default.
2013-03-13 12:37:22 +01:00
Allan Odgaard
c44e85f258 Avoid delayed window resize 2013-03-13 12:37:22 +01:00
Allan Odgaard
7acf168904 Keep title and enabled state of Replace All button updated 2013-03-13 12:37:22 +01:00