I often hear in this list how Command-/ comments/uncomments the selection with the appropriate commenting characters, however, anytime I use it it _always_ uses C-style comments (/*...*/).
I have an up to date /Library/Application Support/TextMate checked out from Subversion and I've poked at ~/Library/Application Support/ TextMate and couldn't find anything there that would create this behavior.
Is there anything I need to do to enable this smart comments. And if not, how can I debug this?
Thanks,
-Oscar
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
On Feb 23, 2006, at 11:25 AM, Oscar Bonilla wrote:
I often hear in this list how Command-/ comments/uncomments the selection with the appropriate commenting characters, however, anytime I use it it _always_ uses C-style comments (/*...*/). Is there anything I need to do to enable this smart comments. And if not, how can I debug this?
Please be more specific. What language are you working on, and what comments would you like. Give example of code that doesn't behave like you want it to.
Thanks,
-Oscar
Haris
On Feb 23, 2006, at 10:15 AM, Charilaos Skiadas wrote:
On Feb 23, 2006, at 11:25 AM, Oscar Bonilla wrote:
I often hear in this list how Command-/ comments/uncomments the selection with the appropriate commenting characters, however, anytime I use it it _always_ uses C-style comments (/*...*/). Is there anything I need to do to enable this smart comments. And if not, how can I debug this?
Please be more specific. What language are you working on, and what comments would you like. Give example of code that doesn't behave like you want it to.
I tried Unix Shell and Tcl... I see that it works in Ruby & Perl. How do I fix it for Shell & Tcl?
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
On Feb 23, 2006, at 5:12 PM, Oscar Bonilla wrote:
On Feb 23, 2006, at 10:15 AM, Charilaos Skiadas wrote:
On Feb 23, 2006, at 11:25 AM, Oscar Bonilla wrote:
I often hear in this list how Command-/ comments/uncomments the selection with the appropriate commenting characters, however, anytime I use it it _always_ uses C-style comments (/*...*/). Is there anything I need to do to enable this smart comments. And if not, how can I debug this?
Please be more specific. What language are you working on, and what comments would you like. Give example of code that doesn't behave like you want it to.
I tried Unix Shell and Tcl... I see that it works in Ruby & Perl. How do I fix it for Shell & Tcl?
Here's more info. I know why it wasn't working on shell. I had two bundles with the same uuid. I changed the uuid of my custom bundle and that fixed the shell bundle (but I get a weird gray bar at the bottom of the window when I'm in shell mode, is that expected?)
I don't get that gray bar on other languages...
I still don't know how to fix my custom bundle and the Tcl bundle. How does TextMate know what the appropriate comment characters are?
Thanks,
-Oscar
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
Here's more info. I know why it wasn't working on shell. I had two bundles with the same uuid. I changed the uuid of my custom bundle and that fixed the shell bundle (but I get a weird gray bar at the bottom of the window when I'm in shell mode, is that expected?)
I don't get that gray bar on other languages...
hehe, the weird gray bar is the horizontal scrolling bar of course ;) it will be gone, when you use softwrapping (from the view menu).
Soryu
On Feb 23, 2006, at 7:12 PM, Oscar Bonilla wrote:
I tried Unix Shell and Tcl... I see that it works in Ruby & Perl. How do I fix it for Shell & Tcl?
For me it works fine for the Unix Shell. In general, you want to have in your grammar a preferences file (called Miscellaneous in most bundles) that has things like this in it:
shellVariables = ( { name = 'TM_COMMENT_START'; value = '# '; }, { name = 'TM_COMMENT_END'; value = ''; }, { name = 'TM_COMMENT_MODE'; value = 'line'; }, );
Currently there is no such file for Tcl. But there is one for Unix Shell, at least in my case.
The comment command is actually in the source bundle, so you can read its code and see what it does there.
Haris
On Feb 23, 2006, at 5:26 PM, Charilaos Skiadas wrote:
The comment command is actually in the source bundle, so you can read its code and see what it does there.
Thanks, this is exactly the information I needed. I'll add the comments to the Tcl bundle and submit the patch.
Regards,
-Oscar
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
I am having trouble with this, too.
Mac OS X.3.9 TextMate version: 1.5.1 v985 Language: Python
I checked out the Python and Source bundles from svn as per the wiki instructions, making sure to set the LC_CTYPE env variable.
If I select a block of code, and hit Cmd-/ (why is there no menu entry for toggling comments on a region?), the selected block is replaced by the following text:
/tmp/temp_textmate.BFzWMP:26: undefined method `values_at' for {:end=>"", :no_indent=>nil, :start=>"# ", :mode=>"line"}:Hash (NameError) from /tmp/temp_textmate.BFzWMP:19:in `each' from /tmp/temp_textmate.BFzWMP:19
It doesn't matter what the contents of the selected block of text are.
Any help will be appreciated.
Cheers, --Dave
Ah, figured it out from some other posts. It was a Ruby version problem. I edited ~/.MacOSX/environment.plist to add a PATH string that pointed to a newer Ruby version. It works fine, now.
Cheers, --Dave
David Chin wrote:
Ah, figured it out from some other posts. It was a Ruby version problem. I edited ~/.MacOSX/environment.plist to add a PATH string that pointed to a newer Ruby version. It works fine, now.
Actually, this brings up the issue of how robust bundle scripts must be. I am assuming it would be possible to write this bundle using an earlier version of Ruby. My opinion is that it should be done that way. It seems like requiring an external installation of Ruby of a particular version is crufty. The Source bundle is pretty much required for any coding work. Maybe its functions, especially the toggle comment on region, should somehow be 'built-in' rather than be an add-on.
My 2 cents.
Cheers, Dave
On 5/5/2006, at 19:18, David Chin wrote:
Actually, this brings up the issue of how robust bundle scripts must be. I am assuming it would be possible to write this bundle using an earlier version of Ruby. My opinion is that it should be done that way. It seems like requiring an external installation of Ruby of a particular version is crufty
Generally we try to keep Ruby 1.6 compatibility, but Tiger ships with Ruby 1.8, and 96% of TextMate users are using Tiger. As for the last 4%, many have upgraded to Ruby 1.8, even though they are still on Panther.
So as you can imagine, limited resources go into ensuring that bundle scripts work out-of-the-box for those 2% or so of users still using Ruby 1.6 -- but we do gladly accept patches to fix compatibility issues with Ruby 1.6!
The Source bundle is pretty much required for any coding work. Maybe its functions, especially the toggle comment on region, should somehow be 'built-in' rather than be an add-on.
Both the Source bundle and the Python bundle ships with TextMate. So in that respect, it is a ‘built-in’.
On May 5, 2006, at 12:18 PM, David Chin wrote:
David Chin wrote:
Ah, figured it out from some other posts. It was a Ruby version problem. I edited ~/.MacOSX/environment.plist to add a PATH string that pointed to a newer Ruby version. It works fine, now.
Actually, this brings up the issue of how robust bundle scripts must be. I am assuming it would be possible to write this bundle using an earlier version of Ruby. My opinion is that it should be done that way. It seems like requiring an external installation of Ruby of a particular version is crufty. The Source bundle is pretty much required for any coding work. Maybe its functions, especially the toggle comment on region, should somehow be 'built-in' rather than be an add-on.
I rewrote that command and to be honest I just didn't think about it. I apologize.
Ruby 1.8.0 was released in 2003, so it's been the standard for a pretty long while now. Apple just didn't catch up very fast for some reason.
Nine times in ten, if you just change the inject() calls to use each () and an external Array that will do it. A quick look shows that I didn't seem to use it this time though. Figures.
I no longer have easy access to a 1.6.8 install, but if someone who does wants to mail me errors and checkout the current bundles as I try to fix them, I'll see if I can port it back. If you want to do this, email me off-list.
Sorry again.
James Edward Gray II
James Edward Gray II wrote:
I rewrote that command and to be honest I just didn't think about it. I apologize.
Ruby 1.8.0 was released in 2003, so it's been the standard for a pretty long while now. Apple just didn't catch up very fast for some reason.
No worries. I realise I have an old system: I'm still on Panther. Now that I know where to look, I might take a look at hacking the bundle. But it'll be moot soon, since I'm pretty sure that I will upgrade to whatever is coming after Tiger. The issues I had that kept me from moving to Tiger are no longer issues.
Cheers, Dave
On May 5, 2006, at 11:49 AM, David Chin wrote:
/tmp/temp_textmate.BFzWMP:26: undefined method `values_at'
for {:end=>"", :no_indent=>nil, :start=>"# ", :mode=>"line"}:Hash (NameError) from /tmp/temp_textmate.BFzWMP:19:in `each' from /tmp/temp_textmate.BFzWMP:19
I've committed a workaround that should handle this. If someone with 1.6.8 could checkout the latest bundles and try it I would appreciate it.
James Edward Gray II