In my language I'm using:
{ name = 'meta.blank.line';
match = '^\n';
},
which works great for identifying blank lines.
The problem comes when I get to the last line of the document.
Textmate usually uses the character to the right of the caret for
scoping, but when at the end of the document the scope switches to
the left side of the caret. And because I'm on an empty line there's
nothing to match.
So is it even possible to scope the last line of the document when
it's empty?
I thought I had an answer with \z but Textmate doesn't seem to
support \z in the language grammar - or maybe I'm using it totally
wrong.
Any help is appreciated.
--oliver
To replicate:
my ($match) =
/
\s*
(match_me)
/x;
my $syntax_coloration_broken = 'from here down';
What appears to be happening is that the \s* is interpretted as a
substitution, e.g. s*search*replace*;
Suggestions on fixing thing?
Thanks,
Joshua
To any users of the Subversion bundle: How can I add support for
providing passwords to svn when I'm using DAV_SVN with SSL and
key-based authentication?
For example, right now in the svn info output, there are six requests
for the password. If those are all ignored, I believe that I don't
get an SSL connection, which is... undesirable.
Any advice? I'm certainly willing to code the solution myself, if needs be.
--
Chris R.
======
Not to be taken literally, internally, or seriously.
Hi there,
I've got a new language for which I'd like to create a new grammar.
It's a LaTeX alike language, but environments look like this:
\startsomething
\stopsomething
The language grammar doesn't seem to accept the backslash (it does so
in the LaTeX bundle, so I must be doing something wrong). The
following works fine:
{ name = 'meta.foo.bar';
begin = 'xx';
end = 'yy';
},
and in my text between 'xx' and 'yy' the scope is also 'meta.foo.bar'.
But when I chage the grammar to
{ name = 'meta.foo.bar';
begin = '\\xx';
end = '\\yy';
},
I can't see that the scope changes to 'meta.foo.bar' within \xx and
\yy. Can somebody tell me what to do?
Patrick
The PPI module[1] on CPAN is designed to parse Perl (no small task
there). It was designed for projected /exactly/ like TextMate.
Why is PPI worth looking at? A few brief reasons:
1. It parses Perl wiithout executing it, so stuff like 'BEGIN {system
"rm -rf ~"}' won't do naughty things.
For the record, Textmate doesn't suffer from this problem.
2. It can parse 99% of the documents in CPAN [2]
Comparatively, TextMate isn't quite there yet. :-)
3. It's fast enough [3]. I watched a demo at OSCON 13 months ago with
a demo of PPI parsing the contents of a generic wx-based editor [4].
It responded in real-time.
TextMate is probably faster because it parses a smaller DOM than PPI.
The module PPI::XS, a Perl-C tokenizer hybrid, is an attempt to write
a faster tokenizer.
4. The Perl DOM class tree looks sane enough to use as the basis for
colorization. There are 62 classes, which should map neatly into the
TextMate model [5]
5. Adam Kennedy, the author, is a fantastic guy. He stayed at my place
for that OSCON. Not to put words in his mouth, but I'm sure he'd be
delighted to offer help integrating his baby into TextMate.
6. Once integrated, TextMate would benefit from future PPI
improvements for free. And PPI is under continual development since
2001. Updates are released about every two months, the most recent
being today, Sep 2.
Thanks for entertaining this idea,
Joshua
[1] http://search.cpan.org/~adamk/PPI-1.117/lib/PPI.pm
[2] http://search.cpan.org/~adamk/PPI-1.117/lib/PPI.pm#How_good_is_Good_Enough(…
"The goal for success was originally to be able to successfully parse
99% of all Perl documents contained in CPAN. [...] At time of writing
there are only 28 non-Acme Perl modules in CPAN that PPI is incapable
of parsing. Most of these are so badly broken they do not compile as
Perl code anyway."
[3] http://search.cpan.org/~adamk/PPI-1.117/lib/PPI.pm#The_Tokenizer
"The target parsing rate for PPI is about 5000 lines per gigacycle.
It is currently believed to be at about 1500, and main avenue for
making it to the target speed has now become PPI::XS, a drop-in XS
accelerator for PPI."
(At the time of this writing, PPI::XS is in the proof-of-concept stage)
[4] http://search.cpan.org/~adamk/PPI-Tester-0.06/
A wxPerl-based interactive PPI debugger/tester
[5] http://search.cpan.org/~adamk/PPI-1.117/lib/PPI.pm#The_PDOM_Class_Tree
I run a script to update bundles. At the moment it seems to hang trying to
update Rails. Anybody know what's happening and what to do about it?
Everything seems fine until near the end of the process, when I see:
Fetching external item into
'Bundles/Rails.tmbundle/Support/plugins/textmate_footnotes'
External at revision 121.
Fetching external item into 'Bundles/Rails.tmbundle/Support/plugins/engines'
... and there it sits.
The script is
#!/bin/sh
cd /Library/Application\ Support/TextMate/
/usr/local/bin/svn up
osascript -e '
and has been working for months.
I tried exiting terminal, which ended the script but left "engines" locked.
svn cleanup resolved that.
PowerBook G4 12"/Mac OS X 10.4.7
I have a strong background in .NET and Visual Studio 2003/2005. I'm
used to being able to wrap blocks of code around #Region "Fold this"
and #End Region markers and the UI would allow that block of code to
fold up.
Is there a way of doing this in Textmate with the PHP bundle or any
other bundle? I figured I'd ask before trying to reinvent the wheel.
Thanks!
Derek
Hi all,
I am having trouble with the Go to File command. It works fine from
the menu bar, but command T does not trigger it. I have double
checked and I have not assigned command T to any other command and I
have not created any ~/Library/KeyBindings/DefaultKeyBinding.dict. I
am using TextMate Version 1.5.3. Any help debugging this would be
appreciated. Thanks a lot.
All the best, Mark
Allen -
Cool, thank you.
So:
1) Yes, when I was using XCode bundle I was doing the Build & Run
command. I did NOT import, but followed directions someone had
(maybe it was on your wiki) put the textmate project file and the
xcode project file in the same path. Again, that seemed to work, but
was not getting anything "back" from ant.
2) I have been doing this on my new Macbook pro and I haven't touched
the /etc/profile or ~/bash_login or ~/bash_profile. I followed the
directions on 8.2 Search Path: my bash_init.sh and ~/.bash_profile
are identical to the ones in the manual. No luck - same problem: ant
runs, when you quit the app, everything displays.
3) I did check in the shell (using Terminal) and running ant there
works as in XCode: the targets are displayed as they are run, and my
lovely println() statements shine thru.
Sorry, I've never done anything beyond creating symbolic links and
using top in the shell. Not really my forte. But your wiki pages
are nice and helped, on this subject and everything else I've
referenced.
-Jerzy
Hi,
This used to work fine at one point, but has now been broken for a
few weeks.
From my rails app I call up Ruby->Run Rake Task. I choose "deploy"
from the list of tasks, and get the following output (apologies for
wrapping):
RakeMate r1.2.0 running Ruby v1.8.2.
>>> /Users/evansj/rails/my_app
loading configuration /usr/local/lib/ruby/gems/1.8/gems/
capistrano-1.1.0/lib/capistrano/recipes/standard.rb
loading configuration ./config/deploy.rb
loading configuration #<Proc:0x025d054c@/usr/local/lib/ruby/gems/
1.8/gems/mongrel_cluster-0.2.0/lib/mongrel_cluster/recipes.rb:1>
* executing task deploy
** transaction: start
* executing task update_code
* querying latest revision...
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server/repos/
my_app-portal/rails/my_app/trunk
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server/repos/
my_app-portal/rails/my_app
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server/repos/
my_app-portal/rails
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server/repos/
my_app-portal
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server/repos
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead .
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead .
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead .
The last line repeats indefinitely until you close the window and it
prompts you to stop the task.
svn is /usr/local/bin/svn, which is in my path, and the TM svn tasks
work fine for checking in etc. I have tried setting TM_SVN to the
full path to my svn in the prefs, but it still doesn't work.
I'm using the latest TM, with /Library/Application Support/TextMate
updated from svn.
TIA
Jon