19 Commits

Author SHA1 Message Date
Allan Odgaard
40879d5683 Replace sizeofA macro with range-based for loop or std::begin/end 2015-03-05 16:38:09 +07:00
Allan Odgaard
39b94e6ac3 Harmonize whitespace and add trailing newline 2014-04-14 14:26:52 +07:00
Allan Odgaard
0a8a238159 Add more scope selector tests 2013-08-31 20:49:47 +02:00
Allan Odgaard
c01e181b49 Use name convention to identify non-content scopes 2013-08-31 16:09:49 +02:00
Allan Odgaard
240dc4baec Simplify scope::shared_prefix and scope_t::has_prefix
This is mainly for upcoming implementation changes.
2013-08-30 12:30:34 +02:00
Allan Odgaard
b624d7cc98 Treat empty string as empty scope
Previously would be a scope with one empty “atom”.
2013-08-30 12:30:34 +02:00
Allan Odgaard
d42417ee1a Use public API for scope_t utility functions 2013-08-28 00:23:08 +02:00
Allan Odgaard
1cc0065623 Return false from ‘scope_t::operator bool’ when there is no scope 2013-08-28 00:23:08 +02:00
Allan Odgaard
5da71f9556 Add new API for mutating scope_t 2013-08-28 00:23:07 +02:00
Allan Odgaard
057096af5b Rename API to make searching easier
Using generic names like ‘append’ is not good when analyzing code for potential refactoring.
2013-08-27 15:30:09 +02:00
Allan Odgaard
8f1485d158 String given to scope_t::append now returned from scope_t::back
Previously we would parse the string appended to an existing scope, meaning invalid scopes would not be returned as the same string.

Fixes #1099
2013-08-26 15:54:05 +02:00
Allan Odgaard
cb098b4d80 Update testing system for scope framework 2013-07-26 13:53:58 +02:00
Joachim Mårtensson
eaf2d97141 Using ‘$’ in scope selector will anchor to end of content scope
The content scope is the portion of the scope created while parsing the document content, unlike scope attributes, document, project, SCM, and dynamic scopes (appended to the content scope).
2013-03-25 10:22:27 +01:00
Allan Odgaard
d16f3bcc1e Use per-line indent patterns when estimating indent
This solves the problem where we need to estimate the current line’s indent, but the lines above it is a multi-line block comment. Previously we would fetch indent patterns based on the current scope, then find the first line above caret, for which the patterns can be used to estimate the indent. The problem is that the commented lines without comment markers would be treated as code, and used for the indent.

With the new approach, we can set different patterns for ‘comment.block’ (the C bundle already does this), which basically ignore all the lines, which will cause TextMate to use the code above the comment to estimate indent.

This commit closes textmate/c.tmbundle#3 and also closes textmate/php.tmbundle#24.
2013-03-13 12:38:12 +01:00
Allan Odgaard
4ca897816d Remove TS_WARN since we do have tests
Sort of a fixup! to 2c6a847 (which added child selectors).
2012-08-19 15:53:43 +02:00
Joachim Mårtensson
b21fbd897e Fix ^, previously it failed immediatly if last rule in scope selector, wasn't tested against last scope part. Fixed by giving ^ additional chances 2012-08-10 18:44:16 +02:00
Joachim Mårtensson
49320f4efb Fix bug with > in scope selector. There was an implicit > after path 2012-08-10 18:44:16 +02:00
Joachim Mårtensson
2c6a8471f9 Add support for ^ $ and > in scope selectors 2012-08-10 18:44:16 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00