Commit Graph

266 Commits

Author SHA1 Message Date
Allan Odgaard
8c9c6fc892 Add preliminary bundle install support. v2.0-alpha.9290 2012-08-26 20:33:33 +02:00
Allan Odgaard
9c89911576 Checkin release notes 2012-08-26 20:32:22 +02:00
Allan Odgaard
fc13d2021d Tweak gutter colors
Use the text foreground color for icons when the theme doesn’t provide a color and introduce ‘gutterSelectionIcons’ for the color of selected icons (defaults to selected foreground color).

Also changed the gutter selection border color to match the divider color (when it isn’t specified by the theme).
2012-08-26 18:52:25 +02:00
Dennis Vennink
5a80fcea95 Replace PNGs with resizable PDF template images 2012-08-26 18:26:34 +02:00
Dennis Vennink
6e02f55fff Add gutterSelectionBorder and gutterIcons theme keys 2012-08-26 18:26:34 +02:00
Lukasz Czekaj
19457ad2e8 Fixed negative height bug in htmlOutputView
After dragging the HTML Output window down below the bottom of the main
window it cannot be dragged back and negative height of HTML Output is
saved to file.
2012-08-26 17:48:47 +02:00
Allan Odgaard
c7678e9f67 If file is not on disk, use tmProperties for encoding
This happens e.g. if we do ‘ls|mate’ — here we do have content which got a charset and newline mode assigned during “load”, but from the user’s POV he is saving a new file (if he saves the buffer) so should get his configured encoding.
2012-08-26 17:33:26 +02:00
Allan Odgaard
6f45ee4a9c Use encoding::type for open related API 2012-08-26 17:06:38 +02:00
Allan Odgaard
d1de4a8854 Use encoding::type for save related API
There is also a new document_t::encoding_for_save_as_path which returns the encoding that would be used for the document, if saved at the given path. If the document was loaded from disk, it will return the encoding used during load, otherwise it will check tmProperties for which encoding should be used for the path provided. Save dialog for untitled documents will be pre-populated with the result of the above function.
2012-08-26 16:13:20 +02:00
Allan Odgaard
b0250f94b4 Introduce encoding::type
This wraps charset, byte order mark, and newline character(s).
2012-08-26 14:44:35 +02:00
Allan Odgaard
b0c2b69a3d Don’t consult tmProperties in file::save
The main reason to avoid this is to give a more predictable API. Encoding should be read (from tmProperties) prior to calling file::save and then given as argument.
2012-08-26 14:04:26 +02:00
Allan Odgaard
5e3d973c9b Use global tmProperties for file bindings
This includes a minor improvement to handling of virtual paths (i.e. files opened via rmate).

It also slightly changes the logic related to finding file type. It now prefers an explicit user binding (only when there is a path) falling back on content match, then path match via grammar, then user binding for untitled files, and finally user binding for unrecognized files.
2012-08-26 12:18:09 +02:00
Allan Odgaard
15ba1374ca Add settings_t saving tests 2012-08-26 01:26:16 +02:00
Allan Odgaard
92b3c9e2c5 Remove hardcoded paths from settings_t
Mainly this is because when we run tests, we do not want global or default settings from TextMate, so now TextMate.app explicitly sets the path to the default and global settings (unlike when running tests).
2012-08-26 01:26:16 +02:00
Adam Strzelecki
9f72b75827 Use gutter divider color for selection rectangle 2012-08-25 23:48:41 +02:00
Allan Odgaard
7ecc0a8731 Add new settings to project page
This includes the previously hidden initial file browser location, whether or not to permanently show the tab bar, placement of file browser and command output.
2012-08-25 23:26:11 +02:00
Allan Odgaard
0ca407b72c Move user defaults keys to Keys.{mm,h} 2012-08-25 23:14:15 +02:00
Allan Odgaard
b55a0cefff Fix typo 2012-08-25 21:09:37 +02:00
Allan Odgaard
846357c52f Code aesthetics 2012-08-25 21:04:22 +02:00
Allan Odgaard
8e1aa09d17 Colors are now transparent against background
Previously if the color for X (where X is e.g. foreground or invisibles) had an alpha value other than 1.0 (fully opaque) it would be blended against the less specifically scoped color for X rather than the background.

There was no real logic behind the previous design other than to treat all color blending the same and it would cause a problem for 1.x themes using transparency for selection or invisible characters.

Closes issue #285.
2012-08-25 20:56:36 +02:00
Allan Odgaard
d259c07bd5 Change default font size to 12 2012-08-25 20:29:22 +02:00
Allan Odgaard
360f7a33bd Add context menu to tab bar
This can be used to close current, other, and tabs on the right. Additionally to create a new tab (to the right of the tab showing the menu) or open the tab in a new window.

Closes issue #191.
2012-08-25 17:54:24 +02:00
Allan Odgaard
19f1909ff3 Add menuForTabBarView: to delegate protocol 2012-08-25 17:42:13 +02:00
Allan Odgaard
81eda77ee2 Add tagForLayerContainingPoint:
This is meant for subclasses which need to translate an NSPoint to a layer and cannot rely on the normal handling of this in the superclass.
2012-08-25 17:41:09 +02:00
Allan Odgaard
1c9640f00b fixup! File Browser will now remember it's width
Since the framework doesn’t depend on itself, it cannot include its exported headers.

This closes issue #282.
2012-08-25 16:10:27 +02:00
Allan Odgaard
7d93ed0028 Move rightMouseDown: to subclass
The problem is that when we implement rightMouseDown: then we won’t receive menuForEvent:, but some OakControl subclasses (like OakTabBarView) may want to show a context menu.
2012-08-25 16:04:02 +02:00
Allan Odgaard
8d13174001 Gracefully handle ‘svn info’ failure
This command would e.g. fail if the repository format is of a newer date (in which case the code expecting a result would do “out of bounds” access).

Rather than split on newline, split third element on colon, and then take second element of that result, we now parse the output into a map and look for the ‘URL’ key.
2012-08-25 15:15:00 +02:00
Allan Odgaard
895dd9a1bd Use escape sequence for line endings
This is to make the tmProperties file more transparent (should the user wish to manually inspect it).

As the variable part in the settings is treated as a format string, we can use ‘\r’ and ‘\n’ for CR and LF respectively.
2012-08-25 14:54:47 +02:00
Allan Odgaard
00ed4cab68 Improve flexibility in settings API
If we only provide key and value, we set the setting globally.

If we provide an additional file type, we set it for that file type and parent file types (i.e. “text” is parent of “text.plain”) plus globally. An exception is when we give an “attr” scope as file type (then we do not cascade upward).

If we provide a path / glob, we set it for that path / glob and, as file type we can provide NULL_STR to limit it to just that path / glob, the empty string ("") to also set it globally, or a file type (which is treated as above).
2012-08-25 14:54:47 +02:00
Allan Odgaard
629630c648 Proper escaping in section headers (tmProperties) 2012-08-25 14:54:46 +02:00
Allan Odgaard
cbbebd879a Also save spelling language in settings
Missed this one in a previous commit.
2012-08-25 14:54:46 +02:00
Allan Odgaard
23576923fd fixup! Extend gutter theming to selection foreground
Previous solution didn’t handle soft wrapped lines.

This solution also scales better, as we no longer need to break up ranges and create an entry per selected line.
2012-08-25 14:54:46 +02:00
Jeremy Whitlock
ed534778a7 New svn executable based Subversion scm driver
* Rewrote the Subversion SCM driver to use the svn executable
* Badges work just like Mercurial
* TM_SCM_BRANCH is set to the full repository URL for the working copy

See issue #273.
2012-08-25 02:06:22 +02:00
Allan Odgaard
91993822a1 Disable soft tabs for the project
Incase the user has it “globally” enabled.
2012-08-25 02:06:22 +02:00
Allan Odgaard
c0de81d943 Label the build.ninja target
This is to prettify the build output (for the cases where build.ninja needs to be regenerated).
2012-08-25 02:06:22 +02:00
Allan Odgaard
9ad4bbd35f Hookup document type in Preferences window
All UI settings in TextMate should now work and be sticky.

Closes issue #162.
2012-08-25 02:06:04 +02:00
Allan Odgaard
68ec6f0d62 Don’t do upward cascading when storing ‘attr’ settings
Used in tmProperties this is to target untitled files, files with unknown encoding, and similar, so unlike text or source scopes, we do not want to set the option broader than the exact scope.
2012-08-25 02:06:04 +02:00
Allan Odgaard
9425bbeadf Hookup Preferences window to tmProperties
Presently the new file type is not setup to use tmProperties as the way this is specified (in tmProperties) needs special-casing. Will likely change that.
2012-08-25 02:06:04 +02:00
Allan Odgaard
5140dc730c Quote variables when writing Global.tmProperties
We also eliminate variables which have same value as in Default.tmProperties.
2012-08-25 02:06:04 +02:00
Allan Odgaard
a134b213eb Add settings_t::raw_get
This allows getting a variable from the global domain without any variable interpolation (for settings that use $variables or \escapes).

This is required to provide a UI for editing preferences values (here we want to edit the unexpanded value, and the version in the global domain).
2012-08-25 02:06:03 +02:00
Allan Odgaard
32be6b4800 Add kSettingsLineEndingsKey
Presently not used (by the loader/saver).
2012-08-25 00:57:48 +02:00
Allan Odgaard
13026c70ca Add format_string::escape
This produces a string where all format string characters have been properly escaped.
2012-08-25 00:57:48 +02:00
Allan Odgaard
fbfc42be34 Remove unused settings keys
More will follow as we hookup the preferences window to TextMate’s property system.
2012-08-24 16:57:32 +02:00
Allan Odgaard
b1e8efcd01 Preserve various OakTextView settings
All the settings are now taken exclusively from the property files, so no more user defaults. This means users will have to set their theme and font again.
2012-08-24 16:57:32 +02:00
Allan Odgaard
b86cde21f3 Set default font to Menlo and add theme setting
Despite Menlo having been the new system font for fixed width text in the past several OS versions, NSFont’s userFixedPitchFontOfSize: still return Monaco, unless we build with the 10.8 SDK (and no, setting the deployment target to 10.7 does not produce something that actually runs on 10.7, at least not last I checked).

The disadvantage with Monaco as default font is that we lack bold and italic styles (since CoreText doesn’t synthesize these, unlike the legacy text rendering API TextMate 1.x used).
2012-08-24 16:57:32 +02:00
Allan Odgaard
839aa5c1e3 Set default soft tabs settings for ninja and make
See issue #275.
2012-08-24 16:57:32 +02:00
Allan Odgaard
0b3e361e54 Add code to save Global.tmProperties
Instead of storing things in user defaults we will store them in ~/Library/Application Support/TextMate/Global.tmProperties.

This just makes things a lot easier than having to mix NSUserDefaults with our .tm_properties files, especially since changing a setting in the UI should sometimes be global, sometimes be for the current file’s type, and sometimes just for the current document (e.g. spelling language).

These features are already available with the .tm_properties.
2012-08-24 16:57:32 +02:00
Allan Odgaard
3415d775c5 Use symbolic name for FD_CLOEXEC
Unsure why I was using ‘1’ — perhaps the symbolic name was missing in the older SDK.
2012-08-24 16:52:45 +02:00
Allan Odgaard
f5c7301ba7 Use O_CLOEXEC when possible
This avoids having to do a fcntl(fd, F_SETFD, FD_CLOEXEC) to set the “close on exec” flag.
2012-08-24 16:52:42 +02:00
Allan Odgaard
16b3fcecd7 Format string parser: fix infinite loop
This would happen if given an (incomplete) format string like: ‘${1:/’.
2012-08-23 17:15:12 +02:00