Hi all-
I'm trying to match character constants of the form:
&a &B &!
'c' 'D' '!'
"e" "F" "@"
^G ^h ^+
within the match field of a language grammar.
If I use the search dialog box, this regexp will work for characters
enclosed in single apostrophes:
((?<=^)|(?<=\s))(([&^]\S)|(\'\S\'))(?=\s)
But it doesn't work when I get it into the match field, I suspect
because of the framing apostrophes, as in:
{ name = 'constant.character.forth';
match = '((?<=^)|(?<=\s))(([&^]\S)|(\'\S\'))(?=\s)';
},
Any ideas about what I'm doing wrong, or how I can solve my trouble?
I should also point out that the ungainly:
((?<=^)|(?<=\s))
seems to be necessary inside a language grammar as (?<=\s) alone
doesn't work, although it does in the search dialog. It matches within
a line, but not at the beginning of a line. It may be that this is only
the case with begin/end matching, and not single lines...
Thanks! Charles
The syntax highlighting for LaTeX math mode is very good. I have
noticed, however, a discrepancy in the way the highlighting and the
automatic delimiters are treated. I mean, normally typing a $ will
automatically generate a second one (after the cursor) to end the math
mode. However, I have found that this fails when a command in math
mode spans multiple lines. That is, if there is a hard return in math
mode, then the delimiters behave incorrectly eventhough the syntax
highlighting is correct.
Here's an example:
$math stuff
that spans two lines$ when I put a $ here it thinks I'm closing the
math mode from the first dollar sign on this line of code rather than
thinking I'm starting a new math mode.
Keith Penrod
Hi there,
Some people are working on updating Python and HTML-related bundles
for Django, prior to Django's 1.0 release (http://www.bitbucket.org/bkerr/django-textmate-bundles/
), and I've got a bundle command problem where I'm hoping someone can
point the way.
The idea is to provide some kind of automation for importing commonly-
used functions and classes from Django's source code. Many of these
objects are hidden fairly deep inside one module or another, and it's
easy to forget which, leading to long tromps through the source code.
I'd like to provide a command, perhaps similar to the HTML bundle's
code completion command, which lets people either a) hit command-
escape after the name of an object and view/paste its import path or
b) start typing 'from django.', hit a key combo, and see a list of
child modules, ideally letting them drill down into the modules until
they find the object they're looking for.
I haven't written complicated bundle commands before and am not sure
how to start this, in particular whether to go with route a or b. I
can either manually build up a dictionary of objects and their import
paths and then maintain that dict as Django evolves, or I can try for
a command that actually searches Django's source code for the
definition of an object. I'm leaning towards the former for two
reasons: Having a list of objects would also serve for syntax
highlighting, and also many objects are defined in one module, then
imported into the __init__ file of another. They're 'supposed' to be
imported from that second module, but a search function wouldn't know
that.
Anyway, any general pointers and issues to consider would be much
appreciated. I'd be writing the script in Python, naturally!
Thanks,
Eric