Commit Graph

169 Commits

Author SHA1 Message Date
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
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
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
Allan Odgaard
3c79f275f1 Use constants for settings keys 2012-08-23 17:15:12 +02:00
David Howden
b8b25a46c8 Extend gutter theming to selection foreground
New theme setting: gutterSelectionForeground
2012-08-23 14:42:11 +02:00
Michael Sheets
925f9fb729 Add scope attributes for Ant, CMake, Maven and Scons projects. 2012-08-23 00:18:40 -05:00
Allan Odgaard
aa06fa8b7b Add encoding options to Chinese localization
This isn’t localized.
2012-08-23 00:44:24 +02:00
Allan Odgaard
031fe94fd0 Fix missing underline for misspelled words
As we are using a CGImage for this, we miss out on the retina version, so this code should be revised.
2012-08-22 21:35:55 +02:00
Gerd Knops
e13f1ec13f Remember Bundle Editor column widths 2012-08-22 21:15:18 +02:00
Gerd Knops
d19e2fa49e BundleEditor: follow truncated names with ellipsis 2012-08-22 21:15:17 +02:00
Joachim Mårtensson
ab310cbdab Use cf::color_t RGBA constructor when converting color_info_t 2012-08-22 17:06:56 +02:00
Gerd Knops
9d17d74b1b File Browser will now remember it's width
This closes issue #5.
2012-08-22 15:48:34 +02:00
David Howden
f2dd19f2a3 Extend support for theming the gutter
New theme setting: gutterSelectionBackground
2012-08-22 15:10:21 +02:00
Jacob Bandes-Storch
f24462a523 Use URL-based (modern?) NSWorkspace method 2012-08-22 15:01:38 +02:00
Jacob Bandes-Storch
caf77cc40c ⌘+click a file browser icon to show in Finder 2012-08-22 15:01:38 +02:00
Jacob Bandes-Storch
a611fc213d Prevent horizontal scrolling of search results 2012-08-22 15:01:37 +02:00
Jacob Bandes-Storch
b24f2294fb Clean up find results view positioning
The left and right borders are no longer visible, so the results are flush with the edges of the find window.
2012-08-22 14:43:09 +02:00
Paul Wilde
cd84a864d2 Added Retina icons for bottom bar and file browser
As all the icons have been remade some of them should look better on non-retina also.

This closes issue #42.
2012-08-22 14:34:25 +02:00
Allan Odgaard
7b4bf9c893 fixup! Move border drawing to OakDocumentView
Drawing the border did not account for auxiliary views (presently used by incremental search). See issue #240.

It also did not properly layout the views when adding/removing such views, causing the border to disappear after having used incremental search.
2012-08-22 14:34:25 +02:00
Allan Odgaard
4e9d9414f1 Add encoding options to save dialogs
A minor caveat is that if there are encoding or newline (folder specific) settings in effect for the chosen path, these trump what’s selected in the save dialog.

If we wish to solve this, the best would be to update the options (shown in the save panel) based on selected folder/filename (and the settings in effect for that).

This closes issue #163.
2012-08-21 23:45:45 +02:00
Allan Odgaard
6fa92db265 fixup! Prune redundant items from SCM data source 2012-08-21 23:45:45 +02:00
Allan Odgaard
566d9b27dc Expose encoding variables for document_t 2012-08-21 23:45:45 +02:00
Dennis Vennink
fc9767b520 Community effort to redesign and retinafy the gutter icons. 2012-08-21 23:45:45 +02:00
Allan Odgaard
0d4185bfeb Don’t remove existing mate on install
The reason for this is that we might be able to overwrite mate even if we do not have write access to the parent directory. This will avoid us having to prompt the user for an admin password (when updating mate).

It should be mentioned though that incase mate is not a regular file, we do need to remove it first, because if e.g. it is a symbolic link, our install would write to where the link points to.
2012-08-21 21:32:40 +02:00
Allan Odgaard
53bcc664b3 Update installed mate if required 2012-08-21 21:23:41 +02:00
Allan Odgaard
fcaa957d4b fixup! Add support for theming the gutter
Theme was no longer initialized by OakTextView, instead we relied on OakDocumentView to provide us with a theme, but if the user had no themes installed, it would never do so, leading to a crash when OTV uses a theme member function to obtain colors.

This closes issue #222.
2012-08-21 20:11:21 +02:00
Allan Odgaard
80bf684510 Don’t disallow snippet expansion in last placeholder
This was (temporarily) disallowed by previous commit. We do however need to allow it in the last placeholder since that is used for chaining snippets. See issue #182.
2012-08-21 19:43:30 +02:00
Allan Odgaard
40822e87e6 Limit recursive snippet expansion
If caret is at the first position of a place holder then we no longer look for tab expansions, should the user press tab.

This address the issue where a placeholder has optional content and the word to the left of this optional content is a tab trigger. Previously deleting the placeholder text and pressing tab would insert a new snippet, which would generally not be expected.

This closes issue #226.
2012-08-21 19:43:10 +02:00
Allan Odgaard
621c821689 Don’t register existing value transformers
It can happen that we register the same value transformer twice, e.g. if we register it in an initialize method (since these are not guaranteed to only be called once).

This isn’t a problem per se, but there is no reason to create the new instance.
2012-08-21 18:21:40 +02:00