I'm a brand new user (and licensee) of TextMate and I am mostly very
happy (and eager for the next release) but I am noticing a slight
syntax highlighting problem.
I tend to write code like this (when argument lists get too long):
Widget w = new Wiget(
x,
y,
z
)
And that seems to break the highlighting. So sure, you might say,
"you write code weird, get over it", but in writing an enum, in what I
think is a "normal way", it also breaks it, e.g.:
private enum ImageInfo {
WIDTH("100px"),
HEIGHT("100px");
}
So I'm wondering if I can update the syntax file to account for this,
and if so, how?
Thanks!
I am currently using all the absolute bleeding edge releases of all
the TextMate bundles (courtesy of the example "mateup" script in the
wiki), and the other day I hit Command + / to comment a selection in
PHP, and got HTML comments instead (that <!-- --> business). I haven't
edited the relevant bundles at all. Has anyone else noticed this bug?
Simply make a new document, switch the bundle to HTML, and type some
PHP to reproduce the bug:
<?php
function my_function() {
echo "aw man the auto comments are broken";
}
?>
After selecting the function, and pressing command + /, this is the
result:
<?php
<!-- function my_function() {
echo "aw man the auto comments are broken";
} -->
?>
If I press Command + Slash once more, things get a little weirder:
<?php
// <!-- function my_function() {
// echo "aw man the auto comments are broken";
// } -->
?>
I realize I could just revert to the release version, but I thought
someone might like to know about this.
In addition, the problems are not necessarily isolated to the handling
of PHP within HTML. If I switch to the "PHP" bundle instead of HTML,
the commenting works (using slashes for each line - I would kind of
prefer /* */ to be honest because occasionally it is useful to place
comments between expressions on the same line), but destroys the
indentation of my function:
<?php
// function my_function() {
// echo "aw man the auto comments are broken";
// }
?>
When I undo the comments, the indentation is still messed up.
Thanks,
William
Hi,
I am using TextMate 1.5.8 (1497) with the ProjectPlus plug-in, and I
have spotted a bit of a bug with selecting text in a document.
If I click to select a point in the document and then drag up to the
top to select all text between the cursor and the start of the
document, if the cursor goes beyond the top of the TextMate window the
selection carries on forever, effectively running off the top and back
up from the bottom of the document so the selection never ends. You
can see the scroll bar running up and down the document as it does
this, showing that the document text is being selected in something
like an infinite loop.
If you drag a selection like this in Mail.app or TextEdit then the
selection halts at the top of the document text. It does do this with
TextMate, but only if the cursor is somewhere over the TM window (not
necessarily the document area itself). As soon as you go off the top
of the TM window it starts the scrolling round. If you bring the
cursor back onto the TM window then the selection is in place as you
would expect.
Any ideas? I've disabled the ProjectPlus plug-in, but this still
happens without it. I've checked the console and nothing is coming up
there to give any clues.
Cheers,
Nigel
Hi,
Is it possible to have a 'checkbox like' behaviour in a bundle menu
and/or to modify the menu text from within a command?
More concrete example of what I want:
1) menu entry 'Advance after line sending' which could be checked or unchecked
2) menu entry 'Send line to Rapp [Rdaemon|Rterm]' which would be
modified after each click
('Send to Rdaemon [Rterm|Rapp]' and 'Send to Rterm [Rapp|Rdaemon]')
Regards,
Hans-Peter
I am relatively new to using LaTeX through TM so I'm not sure if this
is a common experience, but when I ask TM to typeset my LaTeX (cmd-R)
the command runs for a very long time (i.e. a few minutes) even though
the document isn't very long (25 pages) and only has a few medium
sized images.
If anyone has had similar difficulties and can suggest things I can
try or check that would be great.
Many thanks,
Dan
I've been hacking away at this syntax file lately, in the hopes that
Textmate will wind up actually usable for Haskell.
For comparison purposes I've made screenshots of the old and new
grammars' highlighting capabilities.
Before: http://www.rsmw.net/ergo/textmate_haskell1.png
After: http://www.rsmw.net/ergo/textmate_haskell2.png
(I sent this e-mail once already to bundles@<...>, but was told to
re-send it here.)
I'm getting the following error when I try to run the TODO Bundle
"Show TODO List" I can't figure out what it means.
/opt/local/lib/ruby/1.8/erb.rb:354:in `trim_line2': private method
`scan' called for #(NoMethodError) from /opt/local/lib/ruby/1.8/erb.rb:
311:in `call' from /opt/local/lib/ruby/1.8/erb.rb:311:in `scan' from /
opt/local/lib/ruby/1.8/erb.rb:534:in `compile' from /opt/local/lib/
ruby/1.8/erb.rb:702:in `initialize' from /Applications/TextMate.app/
Contents/SharedSupport/Bundles/TODO.tmbundle/Support/todo.rb:52:in
`new' from /Applications/TextMate.app/Contents/SharedSupport/Bundles/
TODO.tmbundle/Support/todo.rb:52
I'm running a macports version of ruby (ruby 1.8.7 (2008-08-11
patchlevel 72) [i686-darwin9])
Any help you could provide would be greatly appreciated.
Tony
The new way of selecting snippets with "command + #" (when for
instance there's more than one assigned to a tab trigger) forcing you
to use "command" key instead of just number is really annoying... to me.
Is it possible to cancel this new behavior somehow?
And if not, what's the reason behind the change? I might be better
able to get used to it if I can understand the benefits. ;)
Thanks!
Hi all,
Below is a patch for the Ant bundle. It fixes up the htmlization
of the Ant output (escapes the output correctly so that, for example,
generics display correctly). It also turns htmlization back on, so
that you can click on error messages to jump to the appropriate line
again. Finally, it adds source.java to the scope of the build command
so you can build from a source file, not just from the build file.
I haven't turned column parsing back on... yet.
Be well,
Will :-}
Index: Commands/Build.tmCommand
===================================================================
--- Commands/Build.tmCommand (revision 11139)
+++ Commands/Build.tmCommand (working copy)
@@ -13,7 +13,7 @@
TM_PROJECT_DIR=`dirname "$TM_PROJECT_FILEPATH"`;
-#TM_ANT_BUILD_PARSER=htmlize_ant.py
+TM_ANT_BUILD_PARSER=htmlize_ant.py
if [[ "$TM_ANT_BUILD_PARSER" == "" ]]; then
TM_ANT_BUILD_PARSER=pre
@@ -42,7 +42,7 @@
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
- <string>text.xml.ant</string>
+ <string>source.java, text.xml.ant</string>
<key>uuid</key>
<string>C7888301-C304-4EF2-A15F-5681A7D6D13C</string>
</dict>
Index: Support/bin/htmlize_ant.py
===================================================================
--- Support/bin/htmlize_ant.py (revision 11139)
+++ Support/bin/htmlize_ant.py (working copy)
@@ -1,6 +1,6 @@
#!/usr/bin/python
-import sys, os.path, re, os
+import sys, os.path, re, os, cgi
matcher = re.compile(
r'(/.*?):(\d+):\s*(.*)$'
@@ -20,6 +20,8 @@
sys.stdout.flush()
+print "<pre>"
+
## read all data from stdin
lastLine = None
line = sys.stdin.readline()
@@ -33,15 +35,13 @@
match = matcher.search(line)
- print "<pre>"
-
if not match:
- print line
+ print cgi.escape(line)
else:
fn = match.group(1)
if proj_dir and fn.startswith(proj_dir):
- short_name = fn[len(proj_dir):]
+ short_name = '/.../' + fn[len(proj_dir):]
else:
short_name = fn
@@ -56,19 +56,21 @@
## # print lastLine[(brktInd + 2):], colInd
- print line[:match.start()].rstrip(),
- print '<a href="txmt://open?url=file://%s&line=%s&column=%d">
%s:%s: %s</a>' % (
- fn, match.group(2), colInd, short_name, match.group(2),
match.group(3)
+ print cgi.escape(line[:match.start()].rstrip()),
+ print '<a href="txmt://open?url=file://%s&line=%s&column=%d">
%s:%s</a>: %s' % (
+ cgi.escape(fn), match.group(2), colInd,
cgi.escape(short_name),
+ match.group(2), cgi.escape(match.group(3))
),
- print line[match.end():]
+ print cgi.escape(line[match.end():])
- print "</pre>"
sys.stdout.flush()
## read next line
lastLine = line
line = sys.stdin.readline()
+print "</pre>"
+
print """
</body>
</html>
Hello there,
On 1.5.8 r1496 the LaTeX bundle seems to ignore the TEXINPUTS variable.
I turned on the debug output:
===
%!TEX Directives: {}
[...]
TEX package list = ['indentfirst', 'setspace', 'pdfsync', 'amsmath',
'amssymb', 'amsthm', 'fancyhdr', 'lastpage', 'extramarks', 'chngpage',
'url', 'graphicx', 'graphviz']
texMateVersion = $Rev: 10791 $
engine = pdflatex
texCommand = latex
viewer = Skim
texinputs = .::/Applications/TextMate.app/Contents/SharedSupport/Bundles/Latex.tmbundle/Support/tex//
fileName = A2.tex
[...]
===
Python seems to be able to pull the env variable properly:
===
toirse:~ thatha$ python
Python 2.5.1 (r251:54863, Jul 23 2008, 11:00:16)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> print os.getenv('TEXINPUTS')
/Users/thatha/.latex//:
===
Any ideas what's wrong?
I recently transitioned to OS X from Linux and I'm wondering if
setting the variable in .profile is enough?
Thanks,
Ian.