1

Whenever I open a Ruby file in TextMate 2, although it is correctly recognized, the syntax coloring and the commenting are both screwed up. Instead of command/ putting a # at the beginning of all selected lines, I get them wrapped in /* and */, as though I was working in JavaScript.

I can live with the broken syntax coloring, but the commenting is driving me crazy, so I want to focus on fixing that in this question (although I won't turn down any solutions that fix both or ignore solutions to the syntax highlighting problem). I suspect they have the same root cause, so I mention the syntax highlighting in case it provides a valuable clue.

Apparently others have had a similar problem with commenting CSS in TextMate (2) mentioned in "Textmate "comment" command not working properly for css code", but the fixes there didn't help me. There's "TextMate toggle comment macro is broken" as well, but that has very different symptoms.

TextMate was using my system Ruby (2.0.0 on OS X 10.10), in case that's relevant, but I switched it to using 2.2.3 through rbenv and the problem remains.

Community
  • 1
  • 1
iconoclast
  • 21,213
  • 15
  • 102
  • 138
  • Regarding the close vote: TextMate is definitely on-topic on Stack Overflow as it's a very commonly used tool when programming. – the Tin Man Dec 21 '15 at 18:47
  • Sanity check: is TextMate treating your file as Ruby? Does [the bottom bar](http://cl.ly/3H1k2r0S3415/Image%202015-12-21%20at%202.31.23%20PM.png) definitely say Ruby and not JavaScript or something else? – Bad Request Dec 21 '15 at 19:32
  • yes, it recognizes the files as Ruby (and displays "Ruby" in the bottom bar) and the problem remains even after I explicitly set it as Ruby. The problem goes away if I set it to Crystal, however (which is almost the same as Ruby—but there *are* differences). The problem is also present if I set the file type to "Ruby on Rails". – iconoclast Dec 21 '15 at 19:54
  • If you press Ctrl + Command + T, and select from the drop down "Key Equivalent" (or press Command + 2), does it list more than one action? Mine shows only one titled "Comment Line" from "Source > Comments". – Graham P Heath Dec 22 '15 at 18:34
  • Only the one: "Comment Line". But I looked for "TM_COMMENT_" under settings, and found nothing for Ruby. Should there be something? Could my Ruby bundle's settings have gotten deleted somehow? – iconoclast Dec 22 '15 at 18:47

1 Answers1

1

I started having the exact same problem, and I just recently installed this Crystal bundle the other day. I deleted the bundle and it fixed the problem. I also submitted an issue for that bundle, so, hopefully it gets fixed soon!

Eli Duke
  • 454
  • 1
  • 3
  • 14