Hi all,
Normally, when you execute the Comment Line command, it inserts a single-line comment (e.g., // in C). That's true for Python, Ruby, C/C+ +, Objective-C, shell scripts, you name it... but not Java. For some reason the Java bundle inserts multi-line comments (/* ... */). This leads to problems when trying to uncomment lines. For example:
1. Select N lines 2. Hit Command+/ to comment the lines 3. Cancel the selection 4. Go back and select the same N lines 5. Hit Command+/ to uncomment the lines
This works in all the other modes, but in Java, it's impossible. The problem is step 4. Instead of selecting just the same N lines, you have to extend the selection to N+1 lines, but only far enough to select the first two characters in the N+1 line (to capture the trailing "*/"). And if you really want some fun, try uncommenting only some of the lines. Again, works perfectly in every mode but Java.
So, basically, the Comment Line command seems only half-baked for the Java bundle. I realize I could probably fix this myself by hacking around in the Bundle Editor, but shouldn't the bundle be using single- line comments by default? Even if there's some benefit of multi-line comments that I'm missing, you'd think the Java bundle would still use single-line comments for the sake of consistency. Why's the Java bundle such an oddball?
Trevor
On Aug 1, 2008, at 4:23 PM, Trevor Harmon wrote:
Hi all,
Normally, when you execute the Comment Line command, it inserts a single-line comment (e.g., // in C). That's true for Python, Ruby, C/ C+ +, Objective-C, shell scripts, you name it... but not Java. For some reason the Java bundle inserts multi-line comments (/* ... */). This leads to problems when trying to uncomment lines. For example:
This has been fixed in the current version of the bundle, it might be enough to update to latest version of cutting-edge in preferences, or you might have to checkout the bundle manually. (Or just wait for the next cutting-edge release)
http://manual.macromates.com/en/bundles#getting_more_bundles