Commit Graph

154 Commits

Author SHA1 Message Date
Allan Odgaard
9a9614e264 Workaround for “format string is not a string literal” warning 2014-03-13 20:51:15 +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
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
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
91096c12f3 Ask user to skip session restore if abnormal exit is detected 2014-03-01 08:38:01 +07:00
Allan Odgaard
162ba1649c Rename project-state.db → RecentProjects.db 2014-02-19 18:01:00 +07:00
Allan Odgaard
10f14a74f3 Support referencing documents via UUID
This support is to allow using ‘mate’ to change caret/selection for open untitled documents.
2014-02-11 16:38:58 +07:00
Allan Odgaard
7f65abfe5b Do not hardcode year interval for bundle changes
Previously we would not show any changes done after 2013. We now show changes for the current and last two years.
2014-02-10 20:26:08 +07:00
Allan Odgaard
5256a8e9ae Add file icon to favorites / recent projects 2014-02-10 20:10:39 +07:00
Allan Odgaard
9246e014b0 Minor refactor 2014-02-10 20:00:59 +07:00
Allan Odgaard
bef5e5d88c LRU sort recent projects and disambiguate display names 2014-02-10 16:57:10 +07:00
Allan Odgaard
d9f0cf6563 Skip non-existing recent projects
Long-term it would make sense to also delete them if they haven’t been used for e.g. a month.
2014-02-10 13:53:10 +07:00
Allan Odgaard
d912b4272e Allow using ‘quit’ to terminate an (r)mate session
This is useful when testing socket connections as it seems nicer than simply killing the connection.
2014-02-08 16:28:16 +07:00
Allan Odgaard
48e3796f87 Add delete action to Open Favorites
This only works for Recent Projects (not Favorites).

Also, the key equivalent for this is ⌘⌫. The Edit → Delete menu item will not work (as it’s being sent to the input field).
2014-02-07 19:53:28 +07:00
Allan Odgaard
6ab6c3f43b Add “Recent Projects” to “Open Favorites” dialog 2014-02-07 19:53:28 +07:00
Allan Odgaard
888ccbed16 Remove use of NSPointToCGPoint
This is not required when building in 64 bit mode or when defining NS_BUILD_32_LIKE_64.
2013-11-18 22:43:50 +07:00
Allan Odgaard
f515d92bb4 Rescan favorites folder when re-opening favorites chooser
Previously we only scanned the folder when creating the favorites chooser singleton which meant items added or removed after the chooser had been used, were not reflected before a relaunch.

Fixes #1182
2013-11-09 19:27:24 +07:00
Allan Odgaard
0976c048b3 Add learning to Open Favorite 2013-10-28 23:04:32 +01:00
Allan Odgaard
d70f4ad3c0 Update Open Favorite to use OakChooser 2013-10-28 23:03:24 +01:00
Allan Odgaard
c5558d0574 Remove a few std::shared_ptr typedefs 2013-10-04 16:51:26 +02:00
Allan Odgaard
76dc76b57a Fix typo in debug output 2013-09-22 12:55:42 +02:00
Allan Odgaard
3f055aa318 Clear all web view delegates during dealloc 2013-09-12 23:46:04 +02:00
Allan Odgaard
1c308c810d Use map::emplace instead of inserting std::pair (C++11) 2013-09-05 20:59:11 +02:00
Allan Odgaard
e4e80a946c Use std::make_shared 2013-09-03 12:27:20 +02:00
Allan Odgaard
bd2f7aa44e Decode plus characters in txmt URLs
This is done by using decode::url_part instead of stringByReplacingPercentEscapesUsingEncoding:
2013-08-29 13:27:26 +02:00
Allan Odgaard
8feaba809e Include unhandled C++ exceptions in crash report 2013-08-28 15:27:42 +02:00
Allan Odgaard
de03c27a63 Update network::tbz_t API
The main issue with the old API was inability to capture error output from the tar process.
2013-08-25 21:13:06 +02:00
Allan Odgaard
d2305654ac Make redirect of stderr opt-in 2013-08-25 21:13:06 +02:00
Allan Odgaard
a52165694c Move crash reporter info support to own framework
This is to avoid cyclic dependencies since it was previously in a somewhat high-level framework, so everything that framework depended on, could not augment crash reports.
2013-08-12 19:32:23 +02:00
Allan Odgaard
a7771287ef Listen on IPv6 interface instead of only IPv4 (rmate)
Fixes textmate/rmate#19
2013-07-31 15:03:19 +02:00
Allan Odgaard
83946bd3cf Treat relative txmt: URLs as relative to home folder
This is supported to be compatible with TextMate 1.x.

Fixes #1047.
2013-07-22 11:01:27 +02:00
Allan Odgaard
9b325e54d1 Setup margins based on paper size before printing
Also show paper size/type popup and scale factor in print dialog.
2013-06-27 23:26:11 +02:00
Allan Odgaard
e28b346d70 Bind Page Setup… to our application controller
For unknown reasons, the NSApplication object will not respond to this method, even though it should implement it.
2013-06-27 23:24:23 +02:00
Allan Odgaard
d1d63308b6 Limit printing to web views and use sheet for dialog
File → Print… (⌘P) now sends the “printDocument:” action method (instead of “print:”).

Rather than implement “printDocument:” for the various HTML windows (command output, about window) we provide a general implementation in the application delegate that checks if there is a WebDocumentView conforming view in the responder chain.
2013-06-26 12:13:19 +02:00
Allan Odgaard
eae48c1a66 Add OS and program version to s/w update URL
The server previously grabbed this from the user agent string but this is more fragile and doesn’t work with caching.
2013-06-23 22:53:21 +07:00
Allan Odgaard
6ec5bf2697 Set ⌥ as modifier for Edit → Select → Toggle Column Selection 2013-06-23 11:23:42 +07:00
Allan Odgaard
b9076acdaf Remove leading/trailing whitespace from license owner name 2013-06-22 21:02:45 +07:00
Allan Odgaard
10c212cbd6 Improve error dialog when failing to add license 2013-06-22 21:02:45 +07:00
Allan Odgaard
7060e4e358 Allow user to “add license” in About → Registration 2013-06-18 15:10:57 +07:00
Allan Odgaard
c3f79e2e05 Improve code to find license key 2013-06-18 13:43:18 +07:00
Zete Lui
63b86c5221 Enable "Inspect Element" in web preview 2013-06-15 16:13:22 +07:00
Allan Odgaard
12b26a5810 Update text in “TextMate is outdated” dialog
Several users confused this with TextMate expiring because of a missing license key.
2013-06-15 16:13:22 +07:00
Allan Odgaard
2568503056 Fix executing bundle items via UI for non-main window
This affected executing bundle items via the Bundles menu (including the Select Bundle Item… dialog) in the text view used in the bundle editor.
2013-05-26 15:15:51 +08:00
Allan Odgaard
126ff16b58 Increase TextMate’s lifetime
We now warn 45 days after the compilation date and refuse to work 90 days after the compile date.
2013-05-17 16:18:22 +07:00
Allan Odgaard
ce4ae62547 Change ‘variables_for_path’ API
We now accept the a directory in addition to the path. If a directory is provided, the path is only used to filter variables rooted at the directory.
2013-05-12 11:09:18 +07:00
Allan Odgaard
8b3f05485d Change argument ordering for ‘scope_variables’
Generally we should always provide a base environment, since the scoped variables are format strings. The filtering scope selector is however optional, and we do not have one when executing commands outside an fi;e/editor context.
2013-05-12 11:09:17 +07:00
Allan Odgaard
02f688a525 Explicit variable setup for app controller commands 2013-05-12 11:09:17 +07:00
Allan Odgaard
f68a1cd280 Fix non-working link arrows in bundle item chooser
Since we released sender (via aliased pointer) before querying it, we would fail to obtain the item clicked.
2013-05-02 16:38:56 +07:00
Allan Odgaard
acaff3e352 Add expiration date to TextMate
The user will get daily reminders when the application is more than a month old, and it will stop working when it’s two months old.

Normally not a fan of expiring software but a significant amount of the requests sent to api.textmate.org (posting crash reports, updating bundles) are from versions more than a month old. Adding to that, the expiration date serves as a fallback for potentially broken software update checking.
2013-04-28 11:46:35 +07:00
Allan Odgaard
d45adf2fed Ask for confirmation to skip session restore
Sometimes shift is held down while TextMate is being launched for other reasons than to skip session restore, so to be safe, we are now asking the user to confirm their intent.
2013-04-10 10:13:01 +07:00