Commit Graph

2300 Commits

Author SHA1 Message Date
Allan Odgaard
7f11230655 Checkin release notes v2.0-alpha.9517 2014-03-04 16:13:30 +07:00
Allan Odgaard
3d4d75c543 Update about window text 2014-03-04 16:03:05 +07:00
Allan Odgaard
947b352952 Set pasteboard history search field to fire immediately 2014-03-04 10:40:05 +07:00
Allan Odgaard
a6f6185123 Add NSError info to crash report 2014-03-04 10:24:05 +07:00
Allan Odgaard
c38a1a64af Add to_s overload for NSError 2014-03-04 10:23:01 +07:00
Allan Odgaard
f5ba564c41 Update copyright to 2014 2014-03-04 08:57:56 +07:00
Allan Odgaard
2b28f5a165 Use NSHumanReadableCopyright in about window
This avoids having the copyright (which includes the current year) in multiple places.
2014-03-04 08:57:28 +07:00
Allan Odgaard
1840f5b7fa Improve utf8::find_safe_end implementation
Previously calling the function with invalid UTF-8 could cause it to iterate over all the data and, if built in debug mode, could cause an assertion failure.

Now we return the sequence’s end when the data appears to be malformed and we never look at more than the last 6 bytes in the sequence.
2014-03-03 13:48:12 +07:00
Allan Odgaard
ede827546c Update dialog plug-in (submodules) 2014-03-03 10:35:07 +07:00
Allan Odgaard
c2397484b8 Use C++11 for loop
Majority of the edits done using the following ruby script:

    def update_loops(src)
      dst, cnt = '', 0

      block_indent, variable = nil, nil
      src.each_line do |line|
        if block_indent
          if line =~ /^#{block_indent}([{}\t])|^\t*$/
            block_indent = nil if $1 == '}'
            line = line.gsub(%r{ ([^a-z>]) \(\*#{variable}\) | \*#{variable}\b | \b#{variable}(->) }x) do
              $1.to_s + variable + ($2 == "->" ? "." : "")
            end
          else
            block_indent = nil
          end
        elsif line =~ /^(\t*)c?iterate\((\w+), (?!diacritics::make_range)(.*\))$/
          block_indent, variable = $1, $2
          line = "#$1for(auto const& #$2 : #$3\n"
          cnt += 1
        end
        dst << line
      end
      return dst, cnt
    end

    paths.each do |path|
      src = IO.read(path)

      cnt = 1
      while cnt != 0
        src, cnt = update_loops(src)
        STDERR << "#{path}: #{cnt}\n"
      end

      File.open(path, "w") { |io| io << src }
    end
2014-03-03 10:34:13 +07:00
Allan Odgaard
1781f4a605 Use proper iterate macro for temporary 2014-03-03 00:20:02 +07:00
Allan Odgaard
d700447d8b Remove unused API 2014-03-02 21:10:15 +07:00
Allan Odgaard
be92d71c46 Allow disabling indent corrections when typing on empty lines
This is generally desired when the indent of a new line does not (necessarily) depend on lines above it, but where we otherwise do want indent corrections, e.g. HTML.
2014-03-02 20:06:31 +07:00
Allan Odgaard
a180c24539 Run will/did save and activate/deactivate callbacks in sequence
Previously only the most specialized callback(s) would run. For example creating a command scoped to “source” with “callback.document.will-save” for semantic class would never run for Ruby, Python, etc. because the Source bundle has a “Make Script Executable” callback scoped specifically to “source.ruby”, “source.python”, etc.
2014-03-02 13:15:34 +07:00
Allan Odgaard
4609378cdc Introduce bundles::kItemTypeMost constant 2014-03-02 13:13:04 +07:00
Allan Odgaard
e71be609e0 Use new pasteboard history browser
Closes #481
2014-03-02 12:13:06 +07:00
Allan Odgaard
0e0a6e0252 Fallback on system pasteboard when history is empty
This is for the next/previous methods, the method that returns current already would fallback on the system pasteboard.
2014-03-02 12:13:06 +07:00
Allan Odgaard
95508d9757 Add new pasteboard history browser 2014-03-02 12:12:57 +07:00
Allan Odgaard
5d089803b8 Disable session saving if we terminate before having restored it
Previously if TextMate had expired, we would terminate, which would cause the current session state to be saved, and since it hadn’t yet been restored, we would write out empty session state (and overwrite the user’s previous session state).
2014-03-01 08:48:49 +07:00
Allan Odgaard
34d9a6770f Add API to (temporarily) disable session saving 2014-03-01 08:48:28 +07:00
Allan Odgaard
91096c12f3 Ask user to skip session restore if abnormal exit is detected 2014-03-01 08:38:01 +07:00
Allan Odgaard
7483829245 OakPasteboard: Setting currentEntry now updates system clipboard 2014-02-28 19:20:21 +07:00
Allan Odgaard
72f4811d0b Use @property with @dynamic for ‘primitiveOptions’ property 2014-02-28 19:18:28 +07:00
Allan Odgaard
c0c8a073b9 Avoid property access in fetch predicate 2014-02-28 14:33:20 +07:00
Allan Odgaard
79a47ee277 Don’t store pasteboard entries in an ordered collection
Instead we date stamp each entry and do a sorted fetch (with a limit of one) to find next/previous entry (when required).

The reason for moving away from an ordered collection is twofold, the main reason is that NSArrayController does not support ordered collections, so we lose one of the advantages of switching to CoreData. The secondary reason is that using an ordered collection requires that we use an index for “current item” (or maybe liberal use of indexOfObject:) and it’s problematic to ensure that the index is kept 100% in sync with the entries in the collection (especially with bindings and delayed actions).
2014-02-28 14:28:03 +07:00
Allan Odgaard
13e810e8be Add exception handler for NSManagedObjectContext’s save: method
If an exception is thrown, a dialog is shown. This isn’t very user friendly, but the goal is to call attention to the problem, as I wouldn’t expect any exceptions to be thrown by this method, but I have seen multiple “optimistic locking failure” exceptions despite single-app / single-thread access to the persistent store.
2014-02-27 12:36:33 +07:00
Allan Odgaard
c9f1cd2a84 Enable “Uncommitted Documents” in file chooser 2014-02-27 11:41:26 +07:00
Allan Odgaard
2389e2c589 Recreate SCM info when re-opening file chooser
This is required for showing SCM status for “Open Files”. Previously, closing the file chooser with “Open Files” selected and re-opening it, would not have SCM info for the open files.
2014-02-27 11:30:45 +07:00
Allan Odgaard
56ae96982d Refactor file chooser source selection 2014-02-26 23:00:59 +07:00
Allan Odgaard
1a4314fce2 Wrap initialize code in dispatch_once
This is only done for code where running it twice would actually cause a problem.

Dispatch_once is favored over a static boolean only because it seems to carry slightly more semantic information.
2014-02-26 19:36:54 +07:00
Allan Odgaard
0663a39bcf Abort copy file if target is child of source 2014-02-26 08:29:42 +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
4e1cdb4c9e Snippets with overlapping fields could cause multiple carets
For example in ruby inserting ‘env⇥’, deleting the initially selected letter, and typing B or S, would insert an additional caret (it was actually inserted in the previous step, but not visible since it was overlapping the existing caret).

The API lack proper support for returning the new caret range so we are using a heuristic to figure out which of the returned ranges correspond to our caret. Ideally the API would be updated.
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
fa16dff870 Do not call abort (on failure) in pretty_plist.cc
Instead we return one of the constants from sysexits.h — the problem with abort() is that, for users with the feature enabled, it will trigger a core dump. That is a bit extreme for somewhat expected problems (like empty input file).
2014-02-23 21:41:16 +07:00
Allan Odgaard
6ec2f26d2c Don’t access user’s contacts during launch
Instead we access it when either we need to submit a crash report, when the preferences window open (where the contact address is shown), or when creating a new bundle (where email is also used for the bundle’s contact).
2014-02-23 17:10:31 +07:00
Allan Odgaard
2d9a680f63 Checkin release notes v2.0-alpha.9515 2014-02-23 15:04:56 +07:00
Allan Odgaard
4c09310c14 Update Projects preferences pane, adding 3 new options 2014-02-23 14:45:26 +07:00
Allan Odgaard
faedd67299 Move some user defaults keys to Preferences/Keys.h 2014-02-23 13:36:47 +07:00
Allan Odgaard
3baea707e2 Fix typo 2014-02-23 08:33:38 +07:00
Allan Odgaard
ae26988b39 If any folding pattern is set as a scoped setting, use it
Previously we would fallback on the grammar’s folding patterns unless ‘foldingStartMarker’ was set, which meant setting just the stop marker or indented folding patterns, would be ignored.
2014-02-22 16:00:00 +07:00
Allan Odgaard
60e8af92e4 Delay saving of pasteboard history by 30 seconds
Since we save the history during applicationWillTerminate: there is (in theory) no reason to periodically save the history, but in case of a crash or similar, we would not get to applicationWillTerminate:.
2014-02-22 15:51:45 +07:00
Allan Odgaard
9fcde0791e Add CoreData index to pasteboard entry content 2014-02-21 22:04:02 +07:00
Allan Odgaard
8b44ab2c41 Avoid duplicate entries on find/replace pasteboard 2014-02-21 21:36:13 +07:00
Allan Odgaard
bf1f1ef4f6 Checkin release notes v2.0-alpha.9513 2014-02-21 17:44:08 +07:00
Allan Odgaard
fbafcfb87e Ignore links when recursively expanding file browser items
Symbolic links can point to ancestor items and cause cycles, which would cause the (recursive) expansion to newer terminate.
2014-02-21 11:51:11 +07:00
Allan Odgaard
4015859bd3 Allow inline expansion of symbolic links (in file browser)
This is enabled by running: defaults write com.macromates.TextMate.preview allowExpandingLinks -bool YES
2014-02-21 11:48:34 +07:00
Allan Odgaard
8956207789 Avoid detached objects in core data store 2014-02-20 22:40:20 +07:00
Allan Odgaard
56a906a0ac Use temporary pasteboards when replaying macros
This applies to search, replace, and (unless disabled) regular pasteboard.
2014-02-20 22:22:55 +07:00
Allan Odgaard
aec82de6e2 Implement kReplace / kReplaceAndFind actions
These are used when replaying macros.
2014-02-20 22:09:36 +07:00