Perhaps it doesn't exist or I don't know how but is it possible to
search in a specific directory? I know you can search through a whole
project. My project is huge and the searches take forever eventhough I
usually know which directory I want to search in anyway. I wind up
having to fire up another editor to search.
Any ideas?
thanks
Hi,
I was trying out Hypersearch and I noticed that there was similar
functionality in TextMate already. I then tried that and found a bug.
If you 'Find All in Document' - shift-control-f - and the document
hasn't been saved yet, then you get a weird error:
/tmp/temp_textmate.aZZ02d:4:in `url_esc': private method `gsub'
called for nil:NilClass (NoMethodError) from /tmp/
temp_textmate.aZZ02d:25 from /tmp/temp_textmate.aZZ02d:22:in
`each_line' from /tmp/temp_textmate.aZZ02d:22
'Find All in Document' is part of the TextMate bundle, so I guess I
could fix this myself, but I don't use it enough. I was just playing.
Have a nice day,
Will :-}
Hi Textmate Guys,
I'm trying out textmate using version 1.5.4 and I checked out bundle
revision 6074 from SVN this afternoon. It appears the perl bundle
has a few problems with indenting. Specifically with nested hashes
and closing curly braces.
Typing this code is fine (the auto-indenting works great):
my $b = {
a => {
test => 1
},
b => {
test_me => 2
}
};
But if you were to re-indent that section you wind up with:
my $b = {
a => {
test => 1
},
b => {
test_me => 2
}
};
Obviously this causes lots of problems for code read ability.
Secondarily, if you have a statement like:
my ($brand_name, $product_name) = $self->{feed_db}->selectrow_array
("select brand, name from products where sku = ? limit 1", undef,
$results->{unique_product_id});
And reindent it changes to:
my ($brand_name, $product_name) = $self->{feed_db}->selectrow_array
("select brand, name from products where sku = ? limit 1", undef,
$results->{unique_product_id});
Is there a way to indent the parameters to keep alignment with the
first parameter, this helps for really long statements that take
multiple lines.
It also appears to have problems with if statements like:
if($bar) {
if($car) {
$baz;
} else {
$car;
}
}
After re-indent that becomes:
if($bar) {
if($car) {
$baz;
} else {
$car;
}
}
It would appear this is a general problem with a closing curly brace
as even,
foo(bar => {
a => 1,
},
car => {
test => 3
})
Becomes:
foo(bar => {
a => 1,
},
car => {
test => 3
})
Secondarily:
Is it possible to have a preference so that:
foo(bar => {
a => 1,
})
When indented becomes:
foo(bar => {
a => 1,
})
Lastly a more general Textmate question coming from XEmacs. I didn't
see any support for register buffers. Would there be a way to add
them? As for what a register buffer does is that it allows you to
copy to a named "register" (commonly you pick a letter), and then you
can insert a register by just entering that same letter that you
copied the contents to. You can see the docs from XEmacs about this
here:
http://www.xemacs.org/Documentation/21.5/html/xemacs_13.html#SEC102
This would require support for reading input from the user once they
hit the appropriate key binding.
Thanks,
Rusty
That was quick. Thanks!!
Norm
---
Norman A. Cohen
nacohen(a)mac.com
"Whatever you may be sure of, be sure of this, that you are
dreadfully like other people."
James Russell Lowell
On Nov 11, 2006, at 13:50 PM, textmate-request(a)lists.macromates.com
wrote:
> Oh man, I forgot to change it. It was pointing to the nib I was
> using for testing. I just committed a fix.
>
I have a half-baked idea for a bundle and I wanted to solicit
feedback in an attempt to more fully bake it.
When coding I commonly find myself jumping around not only within a
file but often between files. Typically to do this I'm either using
the CTags bundle or cmd-E, cmd-shift-F, click in the find window,
look at something, then try to figure out where I was. I find myself
expending way too much mental effort trying to remember where I am at
any point in time.
My idea is for a module which allows you to set global bookmarks per
project along with history as you follow the bookmarks. The bookmarks
would be persisted via a file in the project root called .tmbookmarks
or some such. The bundle would have these actions:
- add bookmark (also places bookmark on top of history)
- show bookmarks
- delete bookmark (presents list of bookmarks, select to delete one
or more)
- clear bookmarks (deletes all bookmarks)
- show history
- go back (returns to most recently added/followed bookmark)
- go forward
- clear history
The bookmarks/history would be presented either via tmdialog or
simply as an HTML window (similar to CTags's navigation window).
The forward/back would be a browser-type history that is populated as
you click thru your bookmarks. I'd like to tie the history into the
CTags bundle as well.
So for example, you could do something like:
- add bookmark (this would add the current file/line)
- cmd-e, cmd-shift-f, click to new file.
- go back (this would save the current file/line then jump back to
the just added bookmark)
I have to think a bit more about how the bookmarks/history will
interact. It might be better to have the history work more like a
shell's pushd/popd actions.
Also, obviously as you edit a file your bookmarks end up pointing to
the wrong line. However, I have this crazy idea that I can save two
or three lines of context with each bookmark (a la diff) so that when
following a bookmark I can validate it and resync automatically (a la
patch).
Thoughts?
j.
Jay Soffian wrote:
> This reminds me. I was surprised to find that the Diff bundle does
> not support using Xcode's opendiff. Is this just an oversight
> (either in the bundle or by me), or does no one care for opendiff?
>
> In general it seems like it would be useful to be able to
> generically configure all the bundles to use opendiff where it
> makes sense to use it as a replacement for /usr/bin/diff. This
> would be settable via something like TM_USEOPENDIFF or some such. I
> know there's certainly times when I'd prefer to have the Subversion
> bundle diff for me using opendiff.
Yup, that's pretty much what I'm looking for too.
I ended up hacking together some of the commands from the Diff bundle
to get an opendiff equivalent of "Diff Document With Arbitrary
File...", but it only works with the saved version of the current
document which limits its usefulness (can't compare unsaved changes,
can't compare new unsaved documents for instance).
Still, in case anybody else finds it useful:
(Save: Nothing)
(Input: Entire Document)
(Output: Discard)
require_cmd opendiff "Opendiff comes with Apple's developer tools."
# set utf-8 as the default encoding (used by opendiff)
export __CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100
path=$(osascript<<END
tell application "TextMate"
set theFile to choose file
set the result to POSIX path of theFile
end tell
END)
opendiff "$path" "$TM_FILEPATH"
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,
yesterday I tried to use the new feature "New Project" from the
"Xcode"-bundle. I got an error that "tm_dialog" can't use the option -
d, it didn't work.
So I checked out the hole "Bundle", "PlugIns", "Support" and "Tools"
directories from the subversion repository to ~/Library/Application
Support/TextMate/ and tried it again, but it didn't work also.
Then I opened the "Dialog Plugin" from "Tools" in Xcode, compiled the
Dialog.tmplugin, put it in "PlugIns" and tried it again - it didn't
worked.
Later I realized I had to compile "tm_dialog.mm" in the same project
and put it in "Support/bin" and also put the before compiled
"Dialog.tmplugin" in "PlugIns". This works finally.
Now I'm asking myself if I did anything wrong or missed anything or
is this the usual way to get new tools to work?
I think it would be easier to put an compiled updated version of the
files to "PlugIns" or "Support/bin" in the subversion repository if
the source file gets updated so an svn update would get all user data
up to date.
It would also be nice if there could be a new target in the Xcode-
project which builds tm_dialog so this gets done automatically; I did
this in the terminal.
Thanks for all the info I missed,
Simon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFFVKYFYRX4BO+zMikRCl2wAJ4pzM63D0d2PNIrAJSkMYUGyY2W7QCfexI/
H0rtEix8UvebyHzkrgg8f28=
=UzNJ
-----END PGP SIGNATURE-----
Allan,
I'm looking at improving the folding support in the Python bundle.
One thing that would help would be if the stop marker regex could
reference a capture made in the start marker regex. That way I could
capture the indent that was in effect when the start marker matched.
The other thing that would help (I think) would be a way to
explicitly reset the nesting level.
Also, is there a way to view what the nesting level is? Something
like TM_FOLD_LEVEL seems like it might be useful.
Thoughts?
j.
I'm trying to write a snippet that will erase
*everything within inclosing tags
and
*everything with enclosing tags including the tags themselves.
So far I've got `perl -e 's/<\${TM_SELECTED_TEXT}>(\n|.)+?/<\/$
{TM_SELECTED_TEXT}>//g'`, input is document, output is new document
where the user has the word inside a tag selected. This isn't
working... and it would be better if the user could select the whole
ending or beginning tag rather than just the word. Any pointers would
be appreciated.