Commit Graph

71 Commits

Author SHA1 Message Date
Allan Odgaard
cf8f796053 Do not use va_start macro with variable reference
This is undefined according to the standard and is a warning with clang-503.0.38.
2014-03-13 20:51:15 +07:00
Allan Odgaard
2b847730fd Make the preferences window restorable
This is not overly useful but the code serves as copy/paste for future endeavors into restoring non-document windows.

The feature requires that “Close windows when quitting an application” is disabled in System Preferences → General (I think that option is enabled by default, at least on 10.9).
2014-03-09 10:01:52 +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
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
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
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
95b834ac0a Grammars with no root scope are no longer shown in the UI
Only injection grammars should have an empty root scope, and if so, it does not make sense to allow the user to pick it as document grammar.
2014-02-20 13:14:36 +07:00
Torsten Trautwein
a88f9baf5f Preference to auto-reveal the current file in the project browser
An option called "Auto-reveal open file in project browser" has been
added to the Projects preference pane. When checked, the currently open
file will be revealed in the project's file browser. By default, the
option is not checked and thus the behavior is as it was before.
2014-01-20 20:15:25 +07:00
Torsten Trautwein
5048ecc9b0 Saved with Xcode 5.0.2 (5A3005) 2014-01-20 13:52:41 +01:00
Allan Odgaard
908ca3f5ab Allow zooming icon animation to be disabled
To disable, run the following in a terminal: defaults write com.macromates.TextMate.preview fileBrowserOpenAnimationDisabled -bool YES

Closes #109
2013-10-30 21:50:07 +01:00
Allan Odgaard
4c40d6b6b9 Allow opening files by single-clicking text (rather than icon)
This is enabled via: defaults write com.macromates.TextMate.preview fileBrowserSingleClickToOpen -bool true

Closes #187
2013-10-26 12:57:38 +02:00
Ryan Goulden
52e6b326c4 Allow sorting bundles by installed 2013-10-10 02:17:19 -04:00
Allan Odgaard
81006920c2 Simplify binding setup for encoding pop-up button 2013-10-06 23:09:12 +02:00
Allan Odgaard
1c308c810d Use map::emplace instead of inserting std::pair (C++11) 2013-09-05 20:59:11 +02:00
Jacob Carlborg
7c6d5680af Add source list style setting for the file browser
When this setting is enabled it will render the file browser with the source list style, that is, the same style as the sidebar in Finder.

To enable run: defaults write com.macromates.TextMate.preview fileBrowserStyle SourceList
2013-07-25 11:23:43 +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
b489687403 Disable AuthorizationExecuteWithPrivileges deprecation warning
The “proper” replacement for this API is to use the ServiceManagement framework’s SMJobBless() to bless our helper tool. In two of the three use-cases our helper tool is however regular shell commands, so it seems redundant to wrap these shell tools as helper tools we can install as launchd jobs.
2013-05-06 14:51:31 +07:00
Allan Odgaard
5f1cdb947a Clicking link arrows should not select rows 2013-05-02 15:07:10 +07:00
Allan Odgaard
ded37a128c Add link arrows to Preferences → Bundles
This takes the user to the bundle’s home (generally a GitHub page) which should make it easier to clone the source repository or report issues via the bundle’s issue tracker.
2013-05-02 15:07:10 +07:00
Allan Odgaard
13af5d8604 Make click-sorting non-content columns a no-op 2013-05-02 15:07:10 +07:00
Allan Odgaard
cdb75619ca Add completion callback to installBundle: 2013-04-23 18:52:08 +07:00
Steven Clukey
32a972da03 Make bundles in bundle preferences table sortable 2013-04-13 22:37:51 +07:00
Allan Odgaard
ee4f7a48a2 Make s/w update status text resizable 2013-04-09 15:39:38 +07:00
Allan Odgaard
ac23c9538e Bind to updated BundlesManager binding properties 2013-03-25 20:31:48 +01:00
Allan Odgaard
29e0a2fec5 Make the rmate listen port a string instead of integer
When using an integer it got “pretty printed” by NSTextField (to have a thousand separator). If the user would “commit” this version, the version with the thousand separator would be stored in user defaults, which would make TextMate fail t listen to the desired port.
2013-03-16 17:49:47 +01:00
Allan Odgaard
2d4d4729d2 Remove ‘rmate’ submodule
With the script installable via rubygems there is no longer any reason to include it with TextMate.app and thus keep it as git submodule.
2013-03-16 17:47:19 +01:00
Allan Odgaard
c561d2447b Add UI setting for disabling auto-resize
The auto-resize is when toggling the file browser.
2013-03-11 17:48:20 +01:00
Allan Odgaard
104ed0e325 Treat ‘nil’ as empty string
With bindings, clearing a text field results in its value being set to nil.
2013-02-22 18:15:11 +01:00
Allan Odgaard
0bf5a85a1c Resize window when toggling file browser
If you dislike this it can be disabled using:

    defaults write com.macromates.TextMate.preview disableFileBrowserWindowResize -bool YES
2013-02-19 21:13:53 +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
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
af67a1a6f6 Check version of installed mate in background 2013-02-03 10:48:45 +01:00
Adam Strzelecki
60965ce6c3 Tab bar above document option
This change adds new option for showing tab bar only above document, so the
file browser header lines up with tab bar.

File browser header height reduced by 1 pixel to match tab bar height. It also
draws optional top divider when in same line as tab bar
2013-01-28 12:42:28 +01:00
Allan Odgaard
a883854145 Use divider lines in root view
Previously we placed the views with a one point gap between them and had the superview fill the background. This works fine, but has the somewhat theoretical disadvantage that the superview then needs to implement drawRect: and for performance reasons declare that it is “opaque” which means subviews can’t use the (true) window background, should they want to.

Also add a preferences key for “tabs above document” (issue issue #214), but not hooked up in this commit.
2013-01-28 12:42:28 +01:00
Allan Odgaard
ece57c79b8 Tab bar collapsing now disabled by default 2013-01-25 17:44:17 +01:00
Steven Clukey
d25c07f3a4 Added ability to set default type to use for unknown documents. 2013-01-24 12:13:24 +01:00
Allan Odgaard
f0f64ccde4 Change some default settings
- File browser placed on right.
- HTML output placed in new window.
- Theme set to Twilight.
2013-01-23 18:56:32 +01:00
Allan Odgaard
645f8d91e1 Let OS handle keys for Go to Tab submenu
My memory is a little vague here, but I believe the point of handling the menu keys was to workaround a bug in NSMenu.

The bug was that NSMenu would look at (the target of) cached menu items, probably for UI validation, so potentially sending methods to unretained objects, which could lead to a crash. Several workarounds were attempted (like clearing the target property after the menu had been displayed) but the only effective one was overloading key handling.

I’m quite sure though that this bug is no longer relevant.
2013-01-22 11:00:27 +01:00
Allan Odgaard
cbe38c92ce Initialize encoding pop-up (Preferences)
Previously this would always show UTF-8 and cause an existing setting to be overwritten (with UTF-8) when bringing up the preferences window.
2013-01-21 05:54:28 +01:00
Allan Odgaard
e834b68343 Remove duplicate of public symbol 2013-01-08 22:48:07 +01:00
Allan Odgaard
47fa0f040c Use Objective-C literals for YES/NO 2013-01-02 01:46:48 +01:00
Allan Odgaard
93776ca9a1 Use Objective-C literals 2013-01-02 01:46:47 +01:00
Allan Odgaard
9e332438e7 Use block-based alert API 2013-01-02 01:46:47 +01:00
Allan Odgaard
71be61cbbb Enable ARC by default
We now explicitly disable it for targets that hasn’t yet been upgraded to ARC. This way, it’s easier to get an overview of which targets hasn’t yet been upgraded and ensures new targets has ARC enabled.
2012-12-19 19:42:36 +01:00
Allan Odgaard
78d0effb5a ARC: Update Preferences framework 2012-10-24 18:19:18 +07:00
Allan Odgaard
1fafbecd54 Remove Chinese translation
It’s not feasible to maintain the old-style xib translations while we work on the UI. We’ll soon move fully to constraint-based layout which should allow translations to be purely string-based.
2012-09-16 11:41:23 +02:00
Jacob Bandes-Storch
dfdde3283f Use 64-bit: explicit visibility where required 2012-08-28 21:32:47 +02:00