Commit Graph

28 Commits

Author SHA1 Message Date
Allan Odgaard
398e55cdbe Add helper functions to get OS version
We need this in a few places and while calling Gestalt() isn’t that much code, that function is deprecated in 10.8 and the alternative is a lot more code, so we don’t want to repeat that once we update the code.
2013-03-17 15:44:06 +01:00
Allan Odgaard
13edc6d131 Use O_CLOEXEC when opening files
This avoids leaking file descriptors into child processes, which would otherwise happen if another thread forks while the file descriptor is open.
2013-03-10 16:07:10 +01:00
Allan Odgaard
9eb4044fdb Switch to simpler regexp::search 2013-02-08 11:20:35 +01:00
Allan Odgaard
8c43974265 Add (async) scope attribute collecting to DocumentController
This is for attr.project.XXX and attr.scm.XXX, although the latter is also provided by scm::info_t.

With this commit, the file::path_attributes function no longer collect this information.
2013-02-02 11:14:35 +01:00
Allan Odgaard
0d187e6694 Remove SCM variables from file::variables 2013-02-02 11:14:35 +01:00
Allan Odgaard
46a8445f76 Make encoding::type public 2013-01-29 21:40:52 +01:00
Allan Odgaard
04b092afb1 Move static data out of headers
This is to satisfy clang (421.0.57).
2013-01-29 15:28:23 +01:00
Allan Odgaard
127ef7e9eb Files with no extension open as plain text
This is instead of asking the user.
2013-01-23 12:36:48 +01:00
Allan Odgaard
46d870c5ca Let DocumentController provide SCM scopes 2013-01-20 12:49:33 +01:00
Allan Odgaard
61b01c89f8 Use scm variables API 2013-01-20 12:49:33 +01:00
Allan Odgaard
a0c4af64bd Remove trailing whitespace
Only removed from non-empty lines.
2012-09-25 14:16:50 +02:00
Allan Odgaard
ebab500ba3 Use std::map/set instead of C arrays
These types come with a find() method and avoids having to use helper functions to get the begin/end of the array (for linear search).
2012-09-20 12:22:20 +02:00
Allan Odgaard
5e453d1172 Accept directory in file::path_attributes
This is so that we can get SCM system, build system, and similar.
2012-09-18 17:33:02 +02:00
Allan Odgaard
45763d4afc Don’t require file to get SCM info
We didn’t actually use the file itself, only its parent directory, and there are several places we want SCM info for an untitled file’s project directory, so removing the need for a file simplifies things.
2012-09-18 17:33:02 +02:00
Allan Odgaard
13ba42f98d Fix setting file type for dot files
When we store a file type for a dot file we should not prefix the “extension” with an asterisk.
2012-09-16 11:41:24 +02:00
Allan Odgaard
fd2374e6c6 Don’t use virtual path for retrieving settings 2012-09-07 16:18:04 +02:00
Allan Odgaard
02b2ef3982 Change scm::status::note → unknown where applicable 2012-09-02 17:53:50 +02:00
Adam Strzelecki
c658687d08 New TM_SCM_NAME variable
This can be used together with `TM_SCM_BRANCH` to customize `windowTitle`.
2012-08-28 22:36:02 +02:00
Jacob Bandes-Storch
e3aa997b06 Use libc++: replace std::tr1 with std 2012-08-28 13:30:20 +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
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
3c79f275f1 Use constants for settings keys 2012-08-23 17:15:12 +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
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00