Commit Graph

1367 Commits

Author SHA1 Message Date
Allan Odgaard
fddec119fe Print debug info when saving from bundle editor 2013-07-23 13:14:50 +02:00
Allan Odgaard
5fc03a8630 Don’t ignore save errors for multi-file search/replace
For this change I have made the FFDocumentSearch class inherit from NSDocument. This way, we can register it with the window controller and will get callbacks when the window is about to close, with the option to cancel closing of the window. This approach seems much simpler than the alternative, which would be to introduce our own callback/delegate system for window closing, or have the window controller know about saving files.
2013-07-22 03:00:13 +02:00
Allan Odgaard
8b32837a39 Force cache invalidation when deleting bundle items
This is to workaround missing fs-events. Ideally the bundle item itself would do the cache invalidation, since it’s complicated to deduce what paths need rescanning after a delete.
2013-07-21 22:54:12 +02:00
Allan Odgaard
97caace4d2 Some further tweaks related to stopping search
We now show “Stopped.” as status text when search is prematurely terminated.
Closing window also cause search to stop.
The stop button has ⌘. as key equivalent (the standard “cancel” key).
Don’t let the stop action go via the search action dispatcher.
2013-07-21 22:54:12 +02:00
David Howden
cfb2335761 Added “Stop Search” button to Find dialog
Previously wasn't possible to stop a search in progress (even
when closing the Find window).
2013-07-21 17:36:16 +02:00
Jacob Bandes-Storch
b533df1a40 Bar button positioning tweaks 2013-07-21 13:42:43 +02:00
Allan Odgaard
25ed8b4e62 Highlight pairs can now be regular expressions
These settings are also consulted for “pair movement”, i.e. ⌃↓/⌃↑ and ⇧⌘B, so by using regular expressions we can match begin/end tags and navigate between these.
2013-07-21 13:25:30 +02:00
Allan Odgaard
920d75b2e7 Remove warning from regexp test
The problem is with the underlying library and has been reported to its issue tracker.
2013-07-21 13:25:30 +02:00
Allan Odgaard
3a359ca52d Limit resources copied to target bundle
Without the ‘.png’ extension we would match the ‘Header Icons’ folder, and (recursively) copy that to our target, so the contents of the folder would exist in two places in the target (with and without the folder).
2013-07-21 13:25:29 +02:00
Allan Odgaard
27eee5ed59 Remove oniguruma 5.9.2 files 2013-07-21 13:25:29 +02:00
Allan Odgaard
e0c7a3df57 Switch regexp library: oniguruma → onigmo 2013-07-21 13:25:29 +02:00
Allan Odgaard
81d065ab8e Use oniguruma’s default character type (OnigUChar)
This introduces a bunch of typecasts but means that less patching is required when updating the library.
2013-07-21 13:25:28 +02:00
Allan Odgaard
8987f3e483 Remove unused function: pattern_t::indices_for_group 2013-07-21 13:25:28 +02:00
Allan Odgaard
3026001988 Fix issue with merging delta property lists 2013-07-21 13:25:28 +02:00
Allan Odgaard
491fc8a3e3 Add missing semi-colons after assertion 2013-07-21 13:25:28 +02:00
Allan Odgaard
2c307cabce Allow setting a tab as “sticky”
Presently this can only be done by right-clicking the tab and selecting the “Sticky” option — if a tab is sticky then it will not be closed when executing any of the batch close actions (Close All Tabs, Close Other Tabs, Close Tabs to the Right, and holding option down while opening a file via file browser or file chooser).

Closes #1038.
2013-07-21 13:25:28 +02:00
Allan Odgaard
32e18b2697 Improve code to find “paired character ranges”
The algorithm now handle overlapping character ranges like: ‘(f{o)o}’ and unpaired characters surrounded by character pairs.

This is for selecting (⇧⌘B) and moving to the begin or end of the range (⌃↓/⌃↑).
2013-07-21 13:25:28 +02:00
Allan Odgaard
ad02f214ac Improve readability of brace movement tests 2013-07-21 13:25:27 +02:00
Allan Odgaard
60d07b061e Use ruby 1.8 in the shebang for new commands
Using the ruby found via PATH would require the command to be tested with ruby 1.8, 1.9, 2.0 and possibly alternative ruby implementations (rubinus, jruby, …) so best to be explicit about which version the command is written for.
2013-07-21 13:25:27 +02:00
Allan Odgaard
1b61c9c688 Fix “unused variable” compiler warning 2013-07-21 13:25:27 +02:00
Allan Odgaard
ba85697ac4 Change “counterpart” to “related file”
This applies both to the action method and the settings key, the latter is now relatedFilePath to indicate that it’s a full absolute path (neither relative or a glob pattern).
2013-07-21 13:25:27 +02:00
Allan Odgaard
0afa234ee6 Add new file types
This includes a new “braces” icon for use in the file browser, presently only used by ‘.go’ files.
2013-07-21 13:25:27 +02:00
Allan Odgaard
61bb49ad6e File browser icon bindings were semi-case-sensitive
We compared the lowercased extension or file name with the case-preserved entry in the bindings.plist file, meaning e.g. ‘Makefile’ never got the intended icon.
2013-07-21 13:25:26 +02:00
Allan Odgaard
34f13d5837 If no counterpart is found, create tab with custom path
This way, if we specify that ‘*.go’ has a counterpart of ‘*_test.go’ but no test file exist (and no other files with same base name) then ⌥⌘↑ will create a new tab using the test file path as default save path.
2013-07-11 13:44:48 +02:00
Allan Odgaard
698f08ab35 Allow customizing what is used for ‘Go to File Counterpart’ (⌥⌘↑)
The user can now set ‘counterpart’ in .tm_properties to the absolute path of what should be used for ⌥⌘↑. If the file does not exist (on disk or as an open tab) then TextMate will fallback to searching the current folder for a file with same name.

To switch between go source and go test files one could add the following:

   [ *.go ]
   counterpart = "${TM_FILEPATH/(_test)?\.go$/${1:?:_test}.go/}"

Here the regular expression transformation will remove ‘_test’ from the file name if it exists, otherwise add it.

One could also do multiple settings like:

   [ *.go ]
   counterpart = "${TM_FILEPATH/(?=\.go$)/_test/}"

   [ *_test.go ]
   counterpart = "${TM_FILEPATH/_test(?=\.go$)//}"

Here ‘*.go’ files get the ‘_test’ added to their name, though files matched by the ‘*_test.go’ glob will instead have it removed.
2013-07-11 00:23:25 +02:00
Allan Odgaard
3198a8cdb1 Use weak pointer for block-accessed run loop
I am seeing some crashes related to this code. My best guess is that a command execution (with exit handler) is created and then cancelled from JavaScript, which would invoke the cleanup block that uses the (now destroyed, but non-nilled) run loop.
2013-07-02 18:43:46 +02:00
Allan Odgaard
115838949a Do not resolve broken symbolic links
Links that would point “above” the root (e.g. ‘/foo’ → ‘../../bar’) would cause an infinite recursion and eventually crash.
2013-07-02 18:43:46 +02:00
Allan Odgaard
33a47898e1 Remove revision field from version_info_t 2013-07-02 18:43:46 +02:00
Allan Odgaard
9adac35f86 Use complex version string during software update checks
While it is simpler to compare a monotonically increasing integer (the revision), we always use the semantic version string in the user interface, meaning that this version string should change together with the revision, which effectively means we are maintaing two version numbers.

We previously embedded the revision in the version string (2.0-alpha.$revision) but when going from alpha → beta, it would be nice to reset the visible counter, so that first beta becomes 2.0-beta.1, furthermore, test versions could benefit from a more descriptive version string, e.g. “2.0-alpha.9439.2+debug” would be the second (semi-public) debug build after “2.0-alpha.9439”.
2013-07-02 18:43:46 +02:00
Allan Odgaard
6c2ed2053d Trim version string received from server 2013-07-02 18:43:46 +02:00
Allan Odgaard
dc1a53aa38 Add code for comparing complex version strings 2013-07-02 18:43:46 +02:00
Allan Odgaard
8b696444c6 Invalidate bundle item (disk) cache when saving in bundle editor
Normally the cache is automatically invalidated via fs-events, but that is sadly unreliable.

Should fix #1034.
2013-06-29 12:42:34 +02:00
Allan Odgaard
ffc622c63d Deleting a bundle would only delete the contained info.plist 2013-06-29 12:42:34 +02:00
Allan Odgaard
598e80f06b Resolve path for a bundle item after it has been created
We may save to a symlinked path but generally always work with resolved paths (for cache lookups, fs-events, etc.).
2013-06-29 12:42:34 +02:00
Allan Odgaard
59a67be348 Handle creating a new bundle with name of existing bundle
Previously we would ensure that /path/to/info.plist inside the bundle was unique when we should have ensured that the actual bundle name was unique.
2013-06-29 12:42:34 +02:00
Allan Odgaard
f88454b6ae Fix issue with remembering expanded file browser items
Previously each file browser would have its own array of expanded items, read from user defaults, and written back during application termination.

This meant that the last file browser to write its array, would eclipse the other file browsers.

Now we have all but the first file browser append its list of expanded items. Additionally each file browser will only append items which are actually visible.

Fixes #873.
2013-06-28 23:32:20 +02:00
Allan Odgaard
48339e306b Remove outdated “upgrade” code
We used to store selected URLs in the user defaults and added this code to remove potentially items.
2013-06-28 23:32:20 +02:00
Allan Odgaard
fd6e47b023 Let a document search clear the folder results used by ⌘G
If the user does a folder search then ⌘G will step through all the matches, opening documents as required. Previously the user would have to do a new search, using a different search string, to stop ⌘G from moving to a new document. It is now possible to stop the behavior using ⌘F followed by ↩.
2013-06-28 21:50:07 +02:00
Allan Odgaard
27e0abfa39 Add support for printing
Closes #517.
2013-06-28 19:32:56 +02:00
Allan Odgaard
c22ed7ce09 Make layout_t::update_metrics public 2013-06-28 17:21:11 +02:00
Allan Odgaard
b8b00b5fe8 Make OakCreateCheckBox a public function 2013-06-27 23:26:46 +02:00
Allan Odgaard
ecede39eeb Don’t pass (https) scheme to the reachability API
The reachability API does a DNS lookup on the literal string and prior to this commit, could stall for as long as it takes to lookup a non-existing host name via DNS.
2013-06-26 12:33:43 +02:00
Allan Odgaard
4480684421 Prevent (some forms of) overlapping selections 2013-06-25 19:36:32 +02:00
Allan Odgaard
f5d28f2dd1 Let file chooser read ‘followSymbolicLinks’ from .tm_properties
Set this to ‘true’ if you want the file chooser (⌘T) to follow symbolic links.

The reason for making it a ‘.tm_properties’ setting is only because I am not yet sure how to best integrate this into the UI. The find dialog has an identical UI option which is global option — it would make sense to coalesce these two options, and while doing that, make the find dialog’s version a project/path setting rather than have it be global.

Closes #984.
2013-06-25 17:43:45 +02:00
Allan Odgaard
1e970fad97 Select table view row before initiating the field editor
If we don’t ensure the row is selected then tab (from the cell with the field editor) will not advance to the row’s next column.
2013-06-24 09:02:14 +07:00
Allan Odgaard
306fc7406f Update syntax to use a dictionary literal (Objective-C 2) 2013-06-23 22:53:22 +07:00
Allan Odgaard
9638e4b70c Allow setting arbitrary activation strings for menu items
The implementation is presently geared toward only setting various activation strings, as unsetting e.g. a key equivalent won’t restore a potential (previously set) tab trigger etc.
2013-06-23 11:23:42 +07:00
Allan Odgaard
44ce84f79c Support setting menu item’s modified state to NO 2013-06-23 11:23:42 +07:00
Allan Odgaard
5c4a2025a3 Add menu item to toggle column selection
The motivation for this is mainly to make the ⌥ shortcut visible in the UI, which presently, it is not, as we need to “hack” the menu item to show it.
2013-06-23 11:23:42 +07:00
Allan Odgaard
0c26060f1c Find dialog now responds to findAllInSelection:
This is the action method sent by the Edit → Find → Find All (⌥⌘F) menu item, and is now treated as an alias to the existing findAll: action method (that the Find All button in the find dialog sends).
2013-06-23 11:23:42 +07:00