Commit Graph

1276 Commits

Author SHA1 Message Date
Allan Odgaard
9ebcfcbd79 Support to_s for most integer types
Here “most” refers to signed and unsigned 16, 32, and 64 bit integers.
2013-02-22 15:53:05 +01:00
Allan Odgaard
972348687c Make fs-events wrapper thread safe
Previously this wasn’t used from multiple threads, but with the new testing system it can be.
2013-02-22 15:51:51 +01:00
Allan Odgaard
8041b71d98 fixup! Exclude file browser width from new windows’ width 2013-02-22 15:51:03 +01:00
Allan Odgaard
455ecafdb5 Make debug logging thread safe 2013-02-22 15:50:37 +01:00
Allan Odgaard
39d568e146 Rework items and key equivalents in File menu
Adding New File / Folder and Close All Tabs to the menu.
2013-02-21 22:38:06 +01:00
Allan Odgaard
7c8ad2df66 Show key equivalents in file browser action menu
Also change New Document → New File. Such title makes more sense when shown in the main menu.
2013-02-21 22:36:23 +01:00
Allan Odgaard
e974f165a2 Add newFolder: forwarding to document controller 2013-02-21 22:08:52 +01:00
Allan Odgaard
5e24b8554c Remove ‘InSelectedFolder’ suffix from action method
This makes it more suitable as action for a menu item in the File menu.
2013-02-21 22:00:15 +01:00
Allan Odgaard
1f0a558adc Add performCloseAllTabs: action method
Closes #808.
2013-02-21 21:58:32 +01:00
Allan Odgaard
2190b14ee2 Disable swipes if not at min/max X 2013-02-21 21:46:58 +01:00
Allan Odgaard
cbb0a7864d Drop ‘ng’ namespace for scm 2013-02-21 17:39:55 +01:00
Allan Odgaard
af4f1e16a1 Remove old SCM API 2013-02-21 17:01:24 +01:00
Allan Odgaard
c3e9fafb2d Include scm.h instead of scm_ng.h
Since scm.h includes scm_ng.h this is effectively the same.
2013-02-21 16:58:22 +01:00
Allan Odgaard
3f4f09dcd8 Update SCM tests to new API
This is both the new test system and the new (non-blocking) SCM API.
2013-02-21 16:54:00 +01:00
Allan Odgaard
15f922a148 Let to_s(fs::snapshot_t) return std::string
Previously it would dump the datatype to stderr.
2013-02-21 16:52:22 +01:00
Allan Odgaard
8e0e35bf3b Add API to wait for SCM status
This is only meant for tests where we wish to block execution until SCM status has been collected.
2013-02-21 16:43:43 +01:00
Allan Odgaard
e2ee734fd6 SCM background workers enabled by default
Normally we enable these on application launch when we receive an ‘application did become active’ notification, for tests though, this notification is lacking, but we do want it enabled for tests, and while we could do a constructor in the tests to enable it, it seems better to just enable it by default.

One issue is that if TextMate is launched “in the background” then it will still do SCM status gathering. Though long-term I may actually want to always have it enabled, even when TextMate is not active.
2013-02-21 16:39:26 +01:00
Allan Odgaard
01417054cb Add test system supporting grand central dispatch
The motivation for introducing a new test generator is that CxxTest cannot be used with tests that (indirectly) schedule code to run in the main queue.

There are a few other advantages of breaking with CxxTest:

 1. Less boilerplate: A test file need only contain a
    function named with a ‘test_’ prefix. No classes,
    inheritance, or similar. If you need fixtures, use the
    multitude of ways that C/C++ allows that (constructor
    functions or non-POD types with static storage).

 2. Concurrent tests: Test functions are scheduled with
    ‘dispatch_apply’ and will thus run concurrently. If
    you need serial execution you can wrap your tests in a
    block and schedule that to run in the main queue.
    Though you should catch exceptions and re-throw these
    in the test’s original queue, as the test assertions
    are using exceptions.

 3. Easier output of custom types: The assertion macros
    will call ‘to_s’ on the arguments given, so the only
    thing required to make these output nicely is to
    provide a ‘to_s’ overload for your custom type /
    enumeration. I know that the standard way to do this
    is overloading operator<< for a stream, but the
    TextMate code-base already uses the ‘to_s’
    convention.

Long-term I can see a few other advantages, like calling preprocessor on the input files to support #if/#else/#endif to disable tests, better support for Cocoa code (NSRunLoop), and introducing test timeouts.
2013-02-21 15:54:37 +01:00
Allan Odgaard
acd3bdf234 Convert leading em-spaces in symbol menu to item indent
By using the menu item’s indentation level property it is possible to “type to select” items, which previously would not work for items that had leading em-space as a prefix.

Closes #806.
2013-02-20 18:08:24 +01:00
Allan Odgaard
7a45f6949a Don’t use NSFileManager to trash symlinks
NSFileManager will resolve the link and move the original file to trash, which is generally not desired (or expected).
2013-02-20 13:04:20 +01:00
Allan Odgaard
a7c33be67e Remove cf::color_t
This wrapper is no longer used.
2013-02-20 12:54:52 +01:00
Allan Odgaard
4bae908d49 Move CGColorRef helper functions
These only have one user, so let’s make them private helper functions instead.
2013-02-20 12:54:26 +01:00
Allan Odgaard
0d8ccd17f0 Exclude file browser width from new windows’ width
Closes #679.
2013-02-19 22:08:13 +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
Michael Sheets
40f728ff8f Correct height of header when tabs above document is enabled
Previously this appeared correct because once you clicked the minimum height of the pop-up menu set it to the correct height. Corrects an issue noted by @fatiotus in #728.
2013-02-18 20:46:55 -06:00
Allan Odgaard
6c48d1d9d7 Always set variable for commands with requirements
Previously we would only set the variable if the command couldn’t be found via PATH. By always setting the variable, we remove redundancy from commands, as they can now rely on the variable instead of needing fallback code (to load via PATH).

The downside is that there are cases where a command may wish to know if the user explicitly set the variable, for example the Run command for Python will ignore the script’s shebang if the user explicitly set TM_PYTHON. As this command doesn’t use the requirement system, it’s not an actual problem. Should it want to specify the requirement, it can do so by using a variable like TM_PYTHON_AUTO and then in the locations array, set TM_PYTHON, this would allow the command to test if TM_PYTHON is set and if not, still have ‘python’ available via the TM_PYTHON_AUTO variable — although, should python not be found, the error dialog will tell the user to set TM_PYTHON_AUTO.

Issue #767
2013-02-18 21:55:59 +01:00
Allan Odgaard
4d32aa7d9f Checkin release notes v2.0-alpha.9383 2013-02-18 16:18:16 +01:00
Allan Odgaard
a1b9c305da Move version knowledge outside upload script 2013-02-18 16:11:12 +01:00
Allan Odgaard
593dddfed6 Add line, type, and display name flags to rmate 2013-02-18 15:39:48 +01:00
Allan Odgaard
06b60dc04e Show colorSpaceName entry in bundle editor
Also add this to the template for new themes (set to sRGB) and a default semantic class.
2013-02-18 15:38:27 +01:00
Allan Odgaard
d70ccc7cdf Allow theme colors to use the sRGB color profile
This is enabled by adding the following to your theme:

    colorSpaceName = sRGB;

The default color space used for themes is “Apple Generic RGB” which is a bad choice for interoperability with other software (e.g. exporting a theme to CSS, creating theme colors in Photoshop, and similar).

Related to issue #768.
2013-02-18 15:38:27 +01:00
Allan Odgaard
08534e737f Change gutter colors to CGColorRef 2013-02-18 15:38:27 +01:00
Allan Odgaard
77f53c3e3e Use a const reference for gutter colors 2013-02-18 15:38:27 +01:00
Allan Odgaard
75f3a0bfa2 Add cf::to_s for CGColorRef 2013-02-18 15:38:27 +01:00
Allan Odgaard
deeff330ee Change cf::color_t → CGColorRef
This change is required to introduce support for different color profiles.
2013-02-18 15:38:27 +01:00
Allan Odgaard
461756bc09 Avoid typecasts 2013-02-18 15:38:27 +01:00
Allan Odgaard
274a658f6f Make encoding “hex view” wider
Since switching to Menlo the lines were being wrapped.
2013-02-18 15:38:26 +01:00
Allan Odgaard
d2035f1a79 Remove commented code 2013-02-18 15:38:26 +01:00
Allan Odgaard
248c9efd03 Use CGColorRef instead of cf::color_t
This is mainly to encapsulate cf::color_t creation in the theme framework, though this code change is at worst a run-time optimization.
2013-02-18 15:38:26 +01:00
Allan Odgaard
22b00f2848 Remove unused ‘textColor’ parameter 2013-02-18 15:38:26 +01:00
Allan Odgaard
01f39b77a6 HTML view status bar divider now match the others 2013-02-18 15:38:26 +01:00
Allan Odgaard
c26a61a749 Remove “grammar changed” callback
This would cause a crash if grammar changed on disk for a document which was closed but not disposed.
2013-02-18 15:38:26 +01:00
Allan Odgaard
63beedc6f4 Handle ⌥⌘⇠ / ⌥⌘⇢ in main menu subclass
This means they work (as alternatives for ⌘[ / ⌘]) in all windows with tabs.

We now also trigger menu-flashing for when pressing the keys.
2013-02-18 15:38:26 +01:00
Allan Odgaard
f0523c3b43 Only update Go To Tab on ⌘1-n
It’s expensive to update this menu since we use (uncached) file icons. Always updating it had a noticeable performance effect on caret movement.
2013-02-18 15:38:26 +01:00
Allan Odgaard
72e54020e6 Add menu validation for Select Next / Previous Tab 2013-02-18 15:38:25 +01:00
Allan Odgaard
e62ef9cf6d Re-use file icon image
These are expensive to create and it was noticeable when lots of files matched and the menu had to be created (as it would when the user press a potential menu key like ⌘W).
2013-02-18 15:38:25 +01:00
Allan Odgaard
81f8cc4e29 Use current indent for lines matching the “ignore” pattern
This is only when explicitly asking TextMate to indent the current line / selection.

Previously these lines would remain at their current indent, this is useful for preprocessor commands, but majority of ignored lines should use current indent. It might be useful to introduce a new pattern for “zero indent” lines.
2013-02-18 15:38:25 +01:00
Allan Odgaard
0277e82b5c Ensure proper ‘isDirectory’ flag for NSURL objects
This is important when we wish to select or edit the URL (in the file browser) as URLs with different values for this flag will not compare as equal, and URL objects created before there is a file on disk will always have this flag set to NO.
2013-02-18 15:38:25 +01:00
Allan Odgaard
e530c3c501 Update dialog plug-ins
This fixes result of menu command which would previously be thrown off by non-selectable items.
2013-02-18 15:38:25 +01:00
Allan Odgaard
c0afcb9e03 Checkin release notes 2013-02-16 10:44:45 +01:00