Hello,
Forgive me if this question has been asked, I searched but found
no answer. I am working on a bundle that is a subset of the ruby
bundle and I would like to have some macros similar to the ones in
the ruby bundle, namely the macros that automatically insert the
requires. Looking at the macros in the ruby bundle, they are very
clean:
- moveToBeginningOfDocumentAndModifySelection:
- executeCommandWithOptions:
{
command = "insert_requires.rb yaml";
input = selection;
output = insertAsSnippet;
}
- insertSnippetWithOptions
etc.
Since, there is no real bundle editor, I am trying to replicate this
process for macros under my bundle. If I were to get to the step of
executing the command, I hit the key equivalent for this
insert_requires.rb command, but instead of getting a clean looking
macro recording like the one above, I get one who's command is filled
with the exact ruby source code being executed:
{
beforeRunningCommand = nop;
command = "#!/usr/bin/env ruby\n$: << \"#{ENV
['TM_SUPPORT_PATH']}/lib\"\n\nrequire \"escape\"\nrequire \"open3\"\n
\nCURSOR = [0xFFFC].pack(\"U\").freeze\nline, col = ENV
[\"TM_LINE_NUMBER\"].to_i - 1, ENV[\"TM_LINE_INDEX\"].to_i\n\nstdin,
stdout, stderr = Open3.popen3(\"/usr/bin/env\", \"ruby\", \"#{ENV
['TM_BUNDLE_SUPPORT']}/bin/insert_requires.rb\")\nThread.new do\n
code = STDIN.read.to_a\n code[line][col...col] = CURSOR unless
ENV.has_key?('TM_SELECTED_TEXT')\n stdin.write code.join\n
stdin.close\nend\n\nprint stdout.read.split(CURSOR).join('${0}')\n";
fallbackInput = document;
input = selection;
keyEquivalent = "^#";
name = "Insert Missing Requires";
output = insertAsSnippet;
scope = "source.ruby";
uuid = "9FB64639-F776-499B-BA6F-BB45F86F80FD";
}
Can someone please let me know what I am doing wrong here? Do I have
to hand hack the plist file or what?
Thanks in Advance,
Marshall
Did a reasonable amount of searching, but can't find it (this product
doesn't have the world's greatest documentation).
So: how do I get the equivalent of emacs-style meta-slash
autocompletion?
Guyren G Howe
Relevant Logic LLC
guyren-at-relevantlogic.com ~ http://relevantlogic.com
REALbasic, PHP, Python programming
PostgreSQL, MySQL database design and consulting
Technical writing and training
I was distressed by the fact that my Ruby appeared broken when the
Open Projects commands were distributed and they wouldn't work for
me. I tried a plethora of solutions, including removing my svn
installations and reverting Ruby installations. Ultimately, the
solution ended up being copying the text out of the bundle editor,
pasting it into a text window, and copying it back into the command
window. Then it worked. No changes to the code... weird, right? Is
there an explanation for this? Did all of my other fiddling around
do something?
I toggle off and back on a command every time I make an edit, so it's
not a question of whether I was activating any changes or not.
I just thought I'd throw it out there and see if it had an
explanation, or perhaps solved anyone else's problems (none of which
I've heard about ;-)).
Thanks,
Brett
I'm experiencing an issue where, if my cursor is in the middle of a line,
and i use cmd+] to indent the line, my cursor position is shifted one
character to the left. not a huge deal, but a bit annoying. anybody else
experience this?
-dave
TM is very sensitive about order in which Alt and mouse button are
released. I often end up with regular selection when I try to select
columns.
I've checked XCode and Word - both requre Alt to be pressed only when
clicking mouse button, not when relasing. I find that much easier to work
with - it's fail-safe and I don't have to hold Alt when selecting.
Is there a reason why TM has selection implemented like this? Can this be
changed or made configurable?
--
regards, porneL
Hello everybody,
First, the caveats and the waffling: I'm new to TextMate, I'm not a
programmer, I hope I'm not missing something obvious, I've never posted to a
mailing list before.
There, now that's out of the way, here's my problem:
I process a lot of texts for Project Gutenberg. PG has a homemade C program
(GutCheck -- http://gutcheck.sourceforge.net) which checks for various
features in the text to make sure it's in good shape for posting to PG. I
normally run it from Terminal and thought I could easily make a Command to
do it from TextMate.
I made my command, and as long as I don't add any arguments, I get back the
"usage" information for GutCheck. So far, so good.
However, when I put in my file name (e.g. gutcheck "$TM_FILEPATH"), I don't
get anything other than a new empty untitled document and short-lived
beach-ball. If I make the command pipe into another (specific) document (e.g.
gutcheck "$TM_FILEPATH" > mynewfile.out), I get one line of response from
gutcheck, and then the rest of the information is stored in the other
document. I then have to open it separately; so it's not much different from
running the command in Terminal which is what I'm trying to avoid.
I thought it had something to do with GutCheck reporting to stderr instead
of stdout, but there's a switch available to turn that off. It didn't make
any difference.
The _weird_ thing though, is that when I have in my command "Output: Show as
HTML" (instead of Create New Document), everything is there in the HTML
window (but unreadable because there are no line breaks).
What am I missing or doing incorrectly?
Ah, another clue, perhaps: when I run the command on a short file (like this
message), it works as I expect (Command: gutcheck "$TM_FILEPATH" Output:
Create New Document). But few ebooks are 17 lines long. How do I make it
work for real texts (600 to 6000 or more lines)?
Thanks in advance for any advice,
Barbara
How could we alter this.
<${1:ul}>
${TM_SELECTED_TEXT/.+/ <li>$0<\/li>/g}
</$1>
...to add a class option to the li tag, but only every other instance
of the li tag? Thanks Sune for setting up this snippet, it saves me a
ton of time when creating ul/ol lists!!!!
Adam Stacoviak
Image202 Entertainment
www.image202.com
--
houston. 713.4291456
toronto. 416.9075496
fax. 713.4562013
I use TextMate all day for Ruby on Rails apps. Today, my command-R and
command-shift-R commands have suddenly started taking a very long time
to execute and return. Using them for unit tests and the tests
indicate they've run in under a second. It's taking minutes for the
window to finish.
When I run this on the comman line the tests run instantly.
I've noticed the same problem with Ctrl-Shft-A as well.
(I updgraded to ruby 1.8.5 via MacPorts today.)
Thanks,
Jamie
Hi again,
I am trying to figure out, how I can update a Language Grammar of a
Pristine Copy, by double clicking a Previous pristine Copy, that is
derived from the same UUID, by Dragging it out from the Bundle Editor.
I tried both double clicking The Language Grammar in the Syntaxes Folder,
or the Bundle altogether from a Finder Window.
What is the expected Behavior in those cases? The CoCoa Dialog tells me
to confirm the Update of the previous Bundle, with the message that
customizations will be retained, however, a Grammar for instance
reflows, but the changes do not seem to be applied.
I can't remember, if that was the case for previous TM revisions, but I
was just wondering what was the Expected behavior in those cases.
(cutting Edge r1269)
regards, marios