Hello 'Mates,
I'm working on a bundle (my first!) to alphabetize css attributes, as
described by Garrett Dimon here:
http://www.digital-web.com/articles/architecting_css/
I whipped up some 'working' (as in, it works on a 2000+ line CSS file
I threw it at) code here, which has some obvious problems. Here are
the key parts, all in PHP:
[code]
function find_rule()
{
global $input, $nOffset;
$nStart = strpos($input,'{',$nOffset);
if ( $nStart === false ) return false;
$nEnd = strpos($input,'}',$nStart);
$nOffset = $nEnd;
$nLen = $nEnd - $nStart + 1;
$aReturn[] = $nStart;
$aReturn[] = $nLen;
// return an array containing the start index and length of the next
rule
return $aReturn;
}
function alphabetize_rule($sRule)
{
preg_match_all('/[^:\s]*:[^;}]*;?/',$sRule,$aProps);
sort($aProps[0],SORT_STRING);
$sRule = implode(' ',$aProps[0]);
$sRule = '{ '.$sRule.' }';
return $sRule;
}
?>
[/code]
The problems, that I can see anyway, are in the regular expressions,
since a CSS rule can contain URLs and URLs can legitimately contain
both un-escaped semi-colons and I think even curly brackets. I can
spend a bit more time on those to search for '(' and ')' and allow
those characters between, so that's fine.
My real question is if anyone has any thoughts about managing the
whitespace that separates the rules. Generally I write CSS all on one
line, and my code will return attributes separated by spaces. Ideally
I'd like it to respect how the coder has written their CSS already,
leaving any newlines and indentation in place.
Does anyone have any thoughts on how best to do this? Do you think
this bundle would be useful?
Many thanks for any feedback.
Pete
Hi
Is there any string we can add somewhere in a document such that TM
recognizes it and sets the correctly spelling dictionary?
Basically, everytime I change from a PT to EN document (or vice-versa)
I need to change the spelling language.
Thanks for any hint.
Cheers
--
Alberto Simões
This is a bit off topic, but I have added a word count command to TextMate
for Latex using texWordCount.pl as described here
http://markelikalderon.com/blog/2007/12/30/latex-and-word-count-revisited/
This raised two questions.
1. Is there a "good practice" place to put such snippets of code, and
2. I put it in ~Library/Application Support/Textmate/Code
Adding the "Code" folder to the existing directory tree.
But this led me to a new problem in that I couldn't work out how to get that
directory tree found when trying to run the code. In Windows, because of
the space in "Application Support" I would gve the full and wrap it in
quotes, but the cmbinations I tried failed to work.
At the moment, I have created a new folder ~Library/TextMate for the script
and the word count seem to work well, it also picks up possible errors in
your latex code, but I haven't investigated that yet. A google search
confirms the need to use quotes, but I can't find an illustration of exactly
where these quotes go.
Some help would be gratefully received.
Thanks,
Graham
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I am new to Textmate so maybe I just don't know if this already exists.
When I have a project I can set bookmarks. This is fine but it would be
nice if it would be possible to not only set bookmarks but to set
a) Bookmarks of different type (maybe color)
b) Add comments to bookmarks (annotations)
And aside from that it would be nice to be able to set a specific type
of bookmark (selected color) for results of the current search.
So it this already on the feature list, is it planned? or is it possible
to create a plugin that supports this feature. (I have more features in
my head but that for sure need a plugin)
Greetings,
Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkfQ+XEACgkQSuF5XhWr2njsPACgqcaQsMhNcAuXV4IhWl8VU7JQ
/mgAn3rQ5RjE7qTzbdMLfIjVi1yHxfmA
=CIxT
-----END PGP SIGNATURE-----
I'm having problems running the mate terminal command, I get the following
error:
/usr/bin/mate: line 1: ../SharedSupport/Support/bin/mate: No such file or
directory
Any help would be much appreciated.
--
Bryce Roney
--
View this message in context: http://www.nabble.com/error-with-Terminal-%27mate%27-command-tp15891059p158…
Sent from the textmate users mailing list archive at Nabble.com.
Hi all,
I'm finding I cannot copy text from main window into the find window. Also, if I type in a find query, textmate is unable to find the text in the file (even though I see it there in front of me).
Furthermore, I cannot copy or paste between textmate and other applications at all.
I've tried uninstall and reinstall without success.
Mac OS X 10.4.1
Textmate 1.5.7 (1436)
Standard bundles only.
Any tips? Thanks....
Rob
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
When I post to my WordPress blog using the Blogging Bundle, I get this
message:
> 2008-03-05 11:23:41.229 osascript[1107:10b] Error loading /Library/
> ScriptingAdditions/QXPScriptingAdditions.osax/Contents/MacOS/
> QXPScriptingAdditions: dlopen(/Library/ScriptingAdditions/
> QXPScriptingAdditions.osax/Contents/MacOS/QXPScriptingAdditions,
> 262): no suitable image found. Did find:
> /Library/ScriptingAdditions/QXPScriptingAdditions.osax/Contents/
> MacOS/QXPScriptingAdditions: mach-o, but wrong architecture
> osascript: OpenScripting.framework - scripting addition /Library/
> ScriptingAdditions/QXPScriptingAdditions.osax declares no loadable
> handlers.
Mind you, the post is successful, but this is quite annoying.
Any thoughts?
SRH
Hi,
I have some tiny problems with TM's HTML output window.
I have a tmcommand which generates HTML code on basis on a shell
script. Fine, after invoking it I see my result.
In addition I added a button called 'Refresh' to that HTML page. I
want to use it to start that shell script again (which writes the
HTML code to a file) using TextMate.system and then via JavaScript
'location.href' or 'location.replace()' to refresh the HTML output
window.
Well, this only works if I press the button at least twice or three
times(?).
After pressing the refresh button I had a look at the new generated
html file and the content is correct, but TM'S HTML output window
displays still the 'old' version.
I tried the meta tags no-cache and expire with '0'. No success. I
also changed the actual html code a bit to be sure that TM recognizes
it's a new document.
Is there a built-in cache for the HTML ouptut? Or can someone advice
me? How can force TM to refresh the HTML output?
Many thanks in advance,
--Hans
I use the standard font, Monaco font at size 12 with anti-aliasing
enabled. Somewhat frequently, the text becomes aliased and strange
looking in places, and the simplest solution seems to be to highlight
the text, which fixes the problem. Does anyone else experience this,
and is there a fix? Thanks.
Armon
Hi all,
I posted some noise a few days ago about replacing the system read()
function with an implementation that worked with tm_dialog for the
purpose of allowing user's to enter input into scripts/processes
running inside of TextMate (where normally you would enter it on the
command line).
I have an example of this working in the Groovy bundle.
http://macromates.com/svn/Bundles/trunk/Bundles/Groovy.tmbundle/
Support/bin/groovymate.rb
In particular ...
TextMate::DialogRead.init :title => 'GroovyMate', :prompt => "The
script is requesting some input:"
What this does is set some environment variables up for the process
that is about to launch (in this case `groovy $TM_FILENAME`). Now
whenever the running Groovy script reads from STDIN, and there is no
data currently there, a dialog is presented allowing input to be given.
This is not quite production ready, but if you want to use this kind
of thing in your bundle I would appreciate you giving it a try so I
can find issues faster. Contact me if you want to try it out.
Just to be clear, this is not tied to Groovy in any way. It's just
what I chose for the example.
LD.
I know this has been talked about before from various angles and there is a
(very poor) workaround in the Textmate FAQ, but I'd like to make sure there
are absolutely no more options.
The problem is, as most of you are aware, Textmate refreshes it's project
list every time the Textmate window gains focus and any other time the
software deems a project refresh necessary.
This is fine for small projects of a few hundred files or less, but it's
absolutely asinine for large projects with many files. When I switch back
from reading docs in a browser or whatever, I have to wait for several
seconds of spinning beach ball while Textmate refreshes the entire project
list.
How can I turn this off? Seriously. How can I stop Textmate from
automatically refreshing the entire project? I don't mind that it just
takes some time to refresh the number of files I have in my project, but I
do mine that it thinks it needs to refresh on focus every time. I know when
my files get updated and I know what's going on in my project directories.
I want to control the refresh so it only happens when IO know files actually
change.
(Before you ask, these are local project files and I'm using a year old
Macbook Pro with 2GB of ram and a 7200 rpm HD upgrade. This is not a
machine or network problem.)
--
View this message in context: http://www.nabble.com/Major-Project-Issues-with-Refresh-%28Textmate-is-unus…
Sent from the textmate users mailing list archive at Nabble.com.
Hi,
I am really interested in using the "Edit in TextMate" feature in
Safari but it doesn't work on the sites where I want to use it. I
believe I installed it properly because it works from Mail and some
web pages in Safari. After a bit of experimentation it seems the "Edit
in TextMate" command doesn't work if there is more than one textarea
on the page.
As a test, I created two HTML files on my computer:
<html>
<textarea></textarea>
</html>
and
<html>
<textarea></textarea>
<textarea></textarea>
</html>
"Edit in TextMate" works for the first file. For the second file it
fails silently (I don't see any errors in the Console). I am running
TextMate Version 1.5.7 (1455) and Safari 3.0.4 on Leopard 10.5.2. Any
ideas?
-Adam
I get the following message...
~/Library/Application Support/TextMate/Support/bin/Textile.rb: No such file
or directory
...when I try to preview or use any of the commands in the Textile bundle.
When I investigated, I discovered that there actually is "no such file or
directory".
I did a google search and found this...
> 9046 deleted | Diffs: previous, other | Lines: 0 ( +0, -10 )
> Created: 2008-03-04 07:18:15 -0600 (11 hours ago) | Author: duff |
Changeset: 9046
> • move Textile.rb wrapper to Textile bundle and update the commands
which use it — I don't see
> the need to have this command available to all bundles (given that in
the now more than two years
> it has been available, only one bundle command actually used it outside
the Textile bundle).
Is there something I should do to get the bundle working again, as a result
of this change?
Thank you,
Victor
Hi all
I recently installed JUnit 4.4 on 10.5.2. However every time i try to
run my JUnit test classes using textmate's bundle i get a Could not
find class error.
TIA
Hi, folks.
This is more a Mac OS X problem than a TM one, but probably MT has
some way to solve it.
I use TM to write in Portuguese.
Unfortunately, Mac OS X Portuguese dictionary sucks.
Is there any way to make TM use ispell or aspell or hunspell?
Kindest regards,
Alberto
--
Alberto Simões
Hi,
I would like to use TextMate as my Haskell editor instead of Emacs but
one thing is holding me back and that is the wonderfull indentation
features in the Haskell mode for Emacs.
In Emacs I can write the following very easily and press tab to cycle
between the possible indentations. In the code below there are only
one possibility for each line, and pressing tab multiple times does
not insert any tab or space characters.
f_25 :: [a] -> a -> [a]
f_25 s c = foldr g [] s
where g x acc = if x == c
then acc
else x : acc
If I for example unindent the code so I get the code below, then
pressing tab once for each line (or seleting the code and executing M-
x indent-region) will give me the pretty indented version back. Is
there any chance that this kind of functionality could be implemented
in TextMate?
f_25 :: [a] -> a -> [a]
f_25 s c = foldr g [] s
where g x acc = if x == c
then acc
else x : acc
Kind regards,
Emil Hedevang
hi :)
is it possible to skip binary files with "Find in Project"? as we have
many big files like videos and images in our projects this not only
eats up a great amount of memory but is also slow. it also doesn't
make any sense to us since we want to search within the sourcecode and
not some videos or images :). excluding those folders was a solution
for some projects but we can't do it for all of them.
regards,
oktay.
Hello,
It seems that TM is leaking memory in Find in Project (probably in
OakDocument), it is NOT visible when working with small projects, but
with bigger it grows RSIZE memory infinitely.
Steps to reproduce:
$ mate /Developer/Documentation
... then Find in Project for "test".
In Performance Monitor watch as RSIZE grows above 1GB after about one
minute.
My Mac is MacBook Pro 2.2Ghz 2GB RAM, 10.5.2.
I think it has something to do with OakDocument that is created for
all searched files in the list, also for some non-text files.
I just spotted that TM is not freeing RSIZE (nor VM) after closing
some huge binary files like .pch (VC binary) or so. (Libraries). It
may have something to do with that.
It may have something to do with my former mail about big files with
single line inside.
Currently I work with some huge C/C++ projects, and lately searching
for any file ends up with TM eating all my memory.
BTW. Can't Find in Project work in separate thread?
Like: when pressing [Find] in the Find in Project, [Find] button is
made inactive, below appears spinning wheel icon "Working...", and
below we may have [Stop] button that appears only when thread is active.
I often use this, but it hangs TM for a while, moreover it is not
possible to interrupt it.
Best regards,
--
Adam Strzelecki |: nanoant.com :|
Hi there,
is there any way of making RakeMate not htmlize rake's output?
I have a rake task that outputs compilation errors, and would like to
make them clickable so the user can open the offending file, but the
HTML I generate is escaped, so it's not useful.
Any ideas/suggestions/recommendations?
--
Ale Muñoz
http://sofanaranja.comhttp://bomberstudios.com
The current svn version of texMate.py does not work on OS X 10.4.11.
The reason, I think, is that Python 2.3.5 is installed, which does not
have the "subprocess" module. Since r8813, the texMate script has used
this module.
Robin
hi,
Although I'm in no way related to the project, I'd like to inform that
the MissingDrawer plugin has been updated.
The changes are not yet significant, but the best is that the
development of that oh-so-good plugin starts again, and we can so
expect many new features coming to us!
Maybe my dreams of a 'Expand/Collapse all' option will soon come true...
URL: http://jannisleidel.com/2008/02/missingdrawer/
Regards,
XC
I've gone through the steps on the “Revert to Default Bundles” wiki
page, restored default shortcut keys in the OSX System Preferences,
deleted TextMate related Preferences and Caches and relaunched
TextMate and still can't get access to the “Show Bundle Items” menu
via ⌃⎋
Additionally, I cannot assign ⌃⎋ to any bundle items. It's as if
TextMate has started to ignore all instances of that key equivalent.
To make sure it wasn't a system wide issue with ⌃⎋ I setup a
Quicksilver trigger which worked as expected.
To make matters worse I can't even figure out where/how to re-bind
“Show Bundle Items” to another key equivalent so that I can at
least regain that functionality.
Help with any of this is appreciated.
john
I am trying to create a Shoes bundle. For those who don't know shoes, it is
a GUI framework for Ruby. I'd like the bundle to use the ruby bundle's text
highlighting, folding scheme, etc. I can (and currently have) copied the
language into the new bundle, but can I somehow inherit the language from
the ruby bundle? Thanks.
Mike
Hi,
I have added an xcode project to the bundles repo (http://
macromates.com/svn/Bundles/trunk/Review/Tools/tmread/) called tmread
(it need's a better name). From the help file ...
"The goal of this is to facilitate scripts/commands running via
TextMate that require user input to use tm_dialog to get the input,
where typically the user would enter it on the command line."
In essence, you can use this to run scripts via textmate and have
textmate present a dialog to the user to allow them to enter input
into the process.
I need some help to test this. It passed under every circumstance I
can concoct, but of course there could be lurking bugs.
To fully make use of this though, you need to be a bit clever about
how you write the output of the running process to wherever your are
writing it to (typically the HTML output window). Consider thing's
like RubyMate. It executes a ruby script, writing the output of said
script to the html output window. It currently does this on a line by
line basis. This is problematic if you have the following script ...
#!/usr/bin/env ruby
$stdout.print("Please enter username: ")
username = STDIN.gets
The problem here is that RubyMate would not output "Please enter
username: " before the dialog is presented to the user asking for the
username. So the user won't really know what they are inputting.
I am not 100% sure how to solve this. Parsing the input line by line
is too convenient to through out the window. What we really need is a
way to identify when it is likely that the script we are running is
presenting a prompt and then pass that through as a line, considering
that most prompts end when a newline is entered. I am at a bit of a
loss on how to do this.
I would encourage anyone interested to grab tmread from the repo to
read the readme, build it and have a play so we can catch any issues.
LD.