Commit Graph

1136 Commits

Author SHA1 Message Date
Allan Odgaard
cd2a3d7b98 Checkin release notes v2.0-alpha.9375 2013-02-08 16:33:47 +01:00
Allan Odgaard
ddc85708f8 Allow disabling auto-indent for snippets
Snippets are normally inserted with indent matching that of the caret. This isn’t always desired, which is why TM 1.x allowed this feature to be disabled. This is now also supported for 2.0.

Closes #387.
2013-02-08 13:55:10 +01:00
Allan Odgaard
44b0da80b1 Look at entire line when auto-pairing characters
When inserting paired characters where the pair consists of the same two characters, we look if the line is already balanced, and if so, insert a pair, and if not, only insert a single character. Previously we only looked at what was left of the caret, though TextMate 1.x looked at the full line, which we now also do in 2.0.

Closes #508.
2013-02-08 13:55:10 +01:00
Allan Odgaard
9c42d1ae9f Moving focus to file browser now select first item
This is only when using the special Navigate → Move Focus to File Browser (⌥⌘⇥) command and is mainly because there is no other visual feedback (other than the text view being rendered in its inactive state).

I could see sometimes not wanting a selection in the file browser, this however seems like a general problem (i.e. the solution should likely be to introduce a way to “deselect all”).
2013-02-08 13:55:09 +01:00
Allan Odgaard
deac51c7a1 Expose outlineView property of file browser 2013-02-08 13:55:09 +01:00
Allan Odgaard
a36146235a Support disabling “keep bundles updated”
We still update the sources because the user may manually install bundles, and in this case he should install from a recent bundle index.
2013-02-08 12:01:21 +01:00
Allan Odgaard
8c9adfc198 Move some user defaults key to respective framework
Initially I wanted all keys in a single header file but to avoid circular dependencies then this header would need to be in a framework that doesn’t depend on anything else, and the main benefit was only to have a single place to look for which keys exist, but now that we consistently prefix settings keys with ‘kUserDefaults’ then it’s easy to extract all keys via search.
2013-02-08 12:01:20 +01:00
Allan Odgaard
2e0d93e5f1 A file suffix in file chooser would rank too high 2013-02-08 11:20:36 +01:00
Allan Odgaard
abf13e913a Show notification when posting crash reports (10.8)
This is both to remind the user that crash reports are automatically submitted and to make it easy for them to point us to a specific crash, as notification center will now work as a list of recent crashes; click on one of them to see the online version.
2013-02-08 11:20:36 +01:00
Allan Odgaard
609c332e0a Parse headers received in post_to_server 2013-02-08 11:20:35 +01:00
Allan Odgaard
b139ac5097 Change push_back → emplace_back (C++11)
This is mainly motivated by readability, so I only did a few select replacements.
2013-02-08 11:20:35 +01:00
Allan Odgaard
bcbd055137 Use exp2(x) instead of pow(2, x) 2013-02-08 11:20:35 +01:00
Allan Odgaard
fd60fd25c7 Change strtol → std::stol (C++11)
I initially wanted to do this change globally, but std::stoX will throw an exception if it fails to parse something and we use strtoX a few places where parsing nothing (and getting back zero) is fine.
2013-02-08 11:20:35 +01:00
Allan Odgaard
ebc4fa26af Use regexp::match_t::operator[]
Also bypass NSString/c_str() by using std::stod().
2013-02-08 11:20:35 +01:00
Allan Odgaard
9eb4044fdb Switch to simpler regexp::search 2013-02-08 11:20:35 +01:00
Allan Odgaard
8b8e02d6da Add minimal tests for regex::search 2013-02-08 11:20:35 +01:00
Allan Odgaard
a8f1c9ef06 Add convenience API for searching std::string 2013-02-08 11:20:34 +01:00
Allan Odgaard
0ee796d7a7 Implement regexp::match_t::operator[]
This can be used to access the n’th capture (as a std::string). If there is no capture, NULL_STR is returned.
2013-02-08 11:20:34 +01:00
Allan Odgaard
e75e7ec8e5 Change text::format → std::to_string (C++11) 2013-02-08 11:20:34 +01:00
Allan Odgaard
3ef473b1be Use std::chrono::steady_clock instead of oak::date_t
This is a better choice for durations, as it’s clearly defined as independent of wall clock time.
2013-02-08 11:20:34 +01:00
Allan Odgaard
1f1883db28 Regular expression searches no longer ignore case 2013-02-08 11:20:34 +01:00
Allan Odgaard
001888c1cb Close Other no longer closes untitled but modified tabs
We would previously bring up an “Do you want to keep unsaved changes?” sheet for these, so no convenience (i.e. batch closing several modified tabs) is really lost (on the contrary).
2013-02-08 11:20:34 +01:00
Allan Odgaard
bb6d003e4f Read environment variable whitelist from user defaults
This is read using the ‘environmentWhitelist’ key and the value should be a colon-separated list of variables that should be inherited from TextMate’s parent process. If the variable includes an asterisk then it is matched as a glob.

Example:

    defaults write com.macromates.TextMate.preview environmentWhitelist '$default:MANPATH:*EDITOR'

Here ‘$default’ will expand to TextMate’s default whitelist.

Normally TextMate will setup HOME, PATH, TMPDIR, LOGNAME, and USER. If you whitelist any of these, then the variable (if set) will instead be inherited from the parent process.

Closes #718.
2013-02-08 11:20:34 +01:00
Allan Odgaard
4a03284979 fixup! Handle case changes on insensitive file systems 2013-02-06 22:58:40 +01:00
Allan Odgaard
fce82f0759 Fix potential crash
Even though the code is running on the main thread, it might still run after the owning (C++) object has been destroyed.
v2.0-alpha.9373
2013-02-06 18:25:01 +01:00
Allan Odgaard
cafb518be8 fixup! Fix infinite loop for documents outside project folder 2013-02-06 18:24:50 +01:00
Allan Odgaard
75adb03039 Checkin release notes v2.0-alpha.9371 2013-02-06 16:48:18 +01:00
Allan Odgaard
67af1bc7fe Make divider lines opaque
Without this, it is possible to move the window when clicking directly on the line (since none of the parent views are opaque).
2013-02-06 16:43:40 +01:00
Allan Odgaard
22465873ac Handle case changes on insensitive file systems
NSFileManager only provide a move function which fails with “file exists” if we make case changes on a case-insensitive file system, therefor we now explicitly test for that error and use <x-man-page://2/rename> if the source and destination refer to the same file, but the path differ.

Fixes #769.
2013-02-06 14:50:05 +01:00
Allan Odgaard
a55e485f56 Reference ‘self’ instead of asking for singleton
In theory we could be calling this method on the non-default file manager.
2013-02-06 14:50:05 +01:00
Allan Odgaard
a913a512e5 Let directory data source observe the “did change” notification
This means we instantly reload after performing a file system operation.
2013-02-06 14:50:05 +01:00
Allan Odgaard
63c0300ed8 Post “directory did change” notifications
This is both to speedup file browser updates (as there is a bit of lag waiting for fs-events) and to work with file systems that doesn’t support fs-events (issue #745).
2013-02-06 14:50:04 +01:00
Allan Odgaard
37f130fe42 Don’t set gradient view as opaque
This is so that a potential NSTextField will correctly render itself as inactive when using NSBackgroundStyleRaised.
2013-02-06 14:50:04 +01:00
Allan Odgaard
fbb2f972f9 Don’t mark parent views as opaque
The reason for this is that NSTextField will draw itself in the “faded” state (for non-key windows) unless some of its parent views are marked opaque.

The previous problem with not having the parent views opaque (see da3a91a7bb) seems to have been solved by setting the autohidesScrollers property to YES.
2013-02-06 14:50:04 +01:00
Allan Odgaard
642b009ec9 Add to existing content view instead of replacing it
The window border drawing seems to be done by the root content view so it’s best to keep it around (as it may also do other things that we are unaware of).
2013-02-06 14:50:04 +01:00
Allan Odgaard
ad750b0b76 Auto-hide the text view’s scroll bars
This is for users who have set “show scroll bars” to “always” (or auto and am using a mouse).

Closes #527.
2013-02-06 14:50:04 +01:00
Allan Odgaard
0507bf4bed Remove all but the default bundle index
The other bundle sources have been merged into the default index.
2013-02-06 14:50:03 +01:00
Allan Odgaard
3c0e1de557 Ensure ‘self’ is kept retained
This shouldn’t be necessary, as we have a ‘retainedSelf’ instance variable that isn’t cleared until ‘[self.window close]’ (the last line of the accept: method), nonetheless I am seeing (rare) crashes from this method, and it appears to be reading the ‘self.window’ property in the last line, so adding this extra safety and will monitor crash reports.
2013-02-06 14:50:03 +01:00
Allan Odgaard
6950ebee9a Ensure all methods can handle a missing document
This fixes a crash bug when menu validation is invoked before the controller has set up a document. Hardening the other methods is just a precaution (as we generally shouldn’t make assumptions about the state of public properties.
2013-02-06 14:50:03 +01:00
Allan Odgaard
ebdb8c9364 Directly read a few instance variables
This is instead of going through ‘self’ and was done to harmonize the code. Since two of the three variables are C++ types we cannot use dot syntax (self.property) when we wish to call a member function on the result, but using [self property] is ugly and would require us to then also use [self setProperty:value] (for consistency), hence why I went with direct access.

Since the selectedTabIndex property is closely related to documents and selectedDocument, I applied the same changes to this property.
2013-02-06 14:50:03 +01:00
Allan Odgaard
c351b89324 Checkin release notes v2.0-alpha.9367 2013-02-05 21:06:15 +01:00
Allan Odgaard
41ea4b1888 Move instance data to implementation file 2013-02-05 20:59:54 +01:00
Allan Odgaard
446f219c7a Reload updated folders on reactivation
This is done by stat’ing all visible folders and is a fallback for when fs-events is not working (e.g. network file systems).
2013-02-05 20:59:54 +01:00
Allan Odgaard
e46be6b2a2 Add memory address to FSItem description
Since table views use the memory address, and these items are for use in table views, it’s useful to see the address when printing an item.
2013-02-05 20:59:54 +01:00
Allan Odgaard
c951e00a06 File browser: Dispose all children on collapse
Previously we kept the children which had been expanded, as these had an associated record for tracking file system changes and SCM info.

However, when expanding we weren’t actually re-using the item from the cached record, so not only was this wasteful, but it caused a problem because we effectively created a new item but used the old record with the old item, and while the two items would compare is equal when using isEqualTo:, they didn’t have the same memory address, so the outline view would not consider them equal, and would thus not react on reload requests when using the older item.
2013-02-05 20:59:54 +01:00
Allan Odgaard
032cb19320 Use proper cursor image for output view right of text
Fixes #763.
2013-02-05 20:59:53 +01:00
Allan Odgaard
1fb7d8a6d3 Fix infinite loop for documents outside project folder
Fixes issue #557 (part two).
2013-02-05 15:26:31 +01:00
Allan Odgaard
759e4d9720 Introduce path::is_child(child, parent)
This also returns true when ‘child == parent’ so perhaps a better name should be chosen for this function.
2013-02-05 15:25:45 +01:00
Allan Odgaard
b2ae4196c3 Update database of contributor email hashes 2013-02-05 15:05:26 +01:00
Allan Odgaard
c182d08c5d Only access SCM info when available
Fixes #756.
v2.0-alpha.9365
2013-02-05 09:45:11 +01:00