简体   繁体   中英

Broken toggle-comment in Textmate

I'm having a problem with the Toggle Comment command ("Comment Line / Selection") in TextMate for Actionscript 2 (I know, I know). I've tried completely stripping the language set down to isolate the issue, and tried walking through the Ruby, both to no avail. My issue is that the command insists on using block comments for comment toggling ( ⌘ + / ) and doesn't respect when I add a preferences file to change TM_COMMENT_MODE. I even tried using this simple preference:

{   shellVariables = (
        {   name = 'TM_COMMENT_START';
            value = '// ';
        },
    );
}

but no luck. I'm hoping that someone who speaks Ruby much better than myself (ie. at all) can find a simple fix for this. You can reproduce in any (recent) install of TextMate by creating a new actionscript 2 file and trying to ⌘ + / a section of code (or even a line). Contrast to a JS file which will use a line comment. Copy the "Comments" snippet from JavaScript to Actionscript bundles, and the problem will persist.

Thanks!

In your ActionScript Bundle, add a Preference called "Comments". In the editor part, add:

{   shellVariables = (
    {   name = 'TM_COMMENT_START';
        value = '// ';
    },
    {   name = 'TM_COMMENT_DISABLE_INDENT';
        value = 'YES';
    },
    {   name = 'TM_COMMENT_START_2';
        value = '/* ';
    },
    {   name = 'TM_COMMENT_END_2';
        value = '*/';
    },
  );
}

and finally at the bottom, set the scope selector to: scope.actionscript.2

Here is an image of what mine looks like 在此输入图像描述

be sure to use the Reload Bundles menu item after you've made these changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM