Commit Graph

25 Commits

Author SHA1 Message Date
Allan Odgaard
fae30ed6e8 Use wrapper for getpwuid() to avoid crash
Based on crash logs this problem still exists on 10.8.2 <rdar://10261043>.
2013-01-10 23:48:46 +01:00
Josh Goebel
dc34d5c9d9 Allow disabling document status in file browser
Disabling this is achieved by setting `fileBrowserDocumentStatus` to `false` in `.tm_properties`.

Disabling it should remove potential delays after opening, closing, and saving files when file browser is showing a lot of files. It is meant as a temporary workaround until the performance issues are addressed.
2012-11-12 13:28:34 +07:00
Ole Gammelgaard Poulsen
ca25560f19 Added tm_query CLI that returns settings and variables for a file 2012-09-24 21:32:29 +02:00
Allan Odgaard
a45c2f6ea9 Improve “is scope selector” heuristic
A root scope can also be followed by a comma, e.g. “text, source”.
2012-09-16 18:00:35 +02:00
Allan Odgaard
923dab6375 Scoped properties are now applied last
This is so that a global setting for ‘source.ruby’ takes precedence over a local ‘source’ setting.

A minor downside is that a local properties file cannot use scoped settings outside a scope selector section.
2012-09-16 11:41:24 +02:00
Allan Odgaard
ba28b9e1ae Set TM_APP_IDENTIFIER
This is for bundles that need to read TextMate’s preferences file (should only be those using a nib with user defaults bindings for their preferences dialog).
2012-09-12 18:30:37 +02:00
Allan Odgaard
4f017345fc Add file/folder exclude keys for search and file chooser
This is just for completeness.
2012-09-12 18:30:36 +02:00
Allan Odgaard
b2fa6ff377 Remove UUID from settings API
Don’t recall what the intent was with this.
2012-09-11 00:05:05 +02:00
Allan Odgaard
c332ae69e6 Allow disabling SCM status from .tm_properties
This is done by adding the following (which can be limited to a folder):

    scmStatus = false
2012-09-02 17:53:50 +02:00
Jacob Bandes-Storch
d4ce498f60 Use 64-bit: numeric type fixes
Unfortunately a printf precision specifier (‘%.*s’) can not come with a width specifier so we have to cast to int. The width specifier ‘t’ is used for ptrdiff_t.
The int → NSInteger change fixed a bug with popup menu positioning, but there was no associated warning or error. It's possible there are more such bugs that we haven't found yet!
2012-08-28 21:32:47 +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
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
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
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
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
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
3c79f275f1 Use constants for settings keys 2012-08-23 17:15:12 +02:00
Allan Odgaard
718ea40002 Use path::is_absolute instead of own logic 2012-08-13 22:54:09 +02:00
Allan Odgaard
b85aafb9a9 Crash when searching a bogus path
If we set projectDirectory to a non-path (e.g. ‘dummy’) then that value makes it into the default folder to search (on ⇧⌘F). Since we want folder specific settings for the path we are about to search (include/exclude patterns) then we would ask for settings for a non-path, which the settings framework couldn’t handle (it kept asking for the parent of this non-path expecting to eventually get to either the user’s home folder or the root of the disk, but instead it would loop infinitely).

This fixes issue #19.
2012-08-13 22:22:02 +02:00
Allan Odgaard
e680130eaf Move oak::basic_environment to the io framework
Previously this was under the OakSystem framework which depends on the io framework meaning that the io framework itself was unable to obtain a basic environment, which is necessary for next commit.
2012-08-11 19:31:10 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00