Commit Graph

2317 Commits

Author SHA1 Message Date
Allan Odgaard
bf4e1d8cee Find in folder window’s title could switch to “Untitled”
This is because we are using an NSDocument to perform the folder searching (as that’s a decoupled way to have the window indicate “unsaved changes” and present a warning sheet).

The downside is that by using an NSDocument we get some undesired implicit behavior, like automatically changing the window title or trying to re-open the “document” after relaunch.
2014-03-09 10:01:51 +07:00
Allan Odgaard
a4ad676c37 Add debug output to WebView delegate 2014-03-09 10:01:51 +07:00
Allan Odgaard
50ab241838 Open new window for HTML output links with target="_blank"
Since switching to ARC we need to ensure the NSWindow is “over-retained” as we rely on “setReleasedWhenClosed:YES”.

Also add ability to close such windows from JavaScript.
2014-03-09 10:01:51 +07:00
Allan Odgaard
09e5d88437 Refactor OakHTMLOutputView 2014-03-09 10:01:51 +07:00
Allan Odgaard
166bfad140 Fix include paths 2014-03-07 00:10:35 +07:00
Allan Odgaard
c7ae7d1337 Add test for snippets with overlapping fields
See 4e1cdb4c9e for details.
2014-03-07 00:10:35 +07:00
Allan Odgaard
337dc1a221 Update sizing code for snippet pop-up menu
We now rely on the table view to obtain the entries and setup the data cell, which should make the code easier to use for other table views with a different data source implementation.
2014-03-06 10:15:09 +07:00
Allan Odgaard
5e1f86a7c2 Setting disableIndentCorrections to ‘1’ was not treated as :true 2014-03-06 10:15:09 +07:00
Allan Odgaard
7079071139 Update Dialog plug-in (pop-up menu improvements) 2014-03-06 10:15:09 +07:00
Allan Odgaard
0e16132725 Bundle item chooser key equivalent search now sort based on scope
For example searching for items bound to ⌃H will show the fallback item in the Shell Script bundle last (as it’s not scoped). Previously items were alphabetized.
2014-03-05 21:18:59 +07:00
Allan Odgaard
6ded0873a3 Remove (somewhat) redundant code 2014-03-05 21:18:59 +07:00
Allan Odgaard
8e63d2729f Setting current pasteboard entry to itself lose auxiliary options
An example where this is desired is when doing a folder search for “foo”, then going to first match and using ⌘E to copy the match to the find pasteboard. This is effectively a no-op except for dropping the auxiliary options that contain other documents with matches (which is what causes ⌘G to advance to next document).
2014-03-05 21:18:59 +07:00
Allan Odgaard
c5c88843e8 Let OakFileIconImage be lazy wrt. stat’ing and obtaining SCM info
There are situations where we create an OakFileIconImage that won’t be drawn, for example when using it with an NSMenuItem. In that case, we previously paid a somewhat noticeable price in the initializer doing work that was not required.
2014-03-05 16:39:55 +07:00
Allan Odgaard
83aabbf53c Move properties from OakFileIconImageRep to OakFileIconImage 2014-03-05 16:39:55 +07:00
Allan Odgaard
1e11a30a53 Remove redundant storage keywords for @property
These were required prior to the new 64 bit run-time.
2014-03-05 16:39:54 +07:00
Allan Odgaard
f26145e6cc Only print download progress when stderr is a tty 2014-03-05 16:39:53 +07:00
Allan Odgaard
fb036b840c Remove bitdeli badge
This no longer works, and GitHub offers traffic analysis under “Graphs”.
2014-03-04 21:20:45 +07:00
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