简体   繁体   English

在Textmate中断开切换 - 评论

[英]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). 我在TextMate for Actionscript 2中遇到了Toggle Comment命令(“注释行/选择”)的问题(我知道,我知道)。 I've tried completely stripping the language set down to isolate the issue, and tried walking through the Ruby, both to no avail. 我已经尝试完全剥离设置的语言以隔离问题,并试图通过Ruby,但都无济于事。 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. 我的问题是该命令坚持使用块注释进行注释切换( ⌘+ / ),并且在添加首选项文件以更改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. 我希望有人比我自己更好地说Ruby(即根本就是)可以找到一个简单的解决方法。 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). 您可以通过创建新的actionscript 2文件并尝试⌘+ /一段代码(甚至一行)在TextMate的任何(最近)安装中重现。 Contrast to a JS file which will use a line comment. 与将使用行注释的JS文件对比。 Copy the "Comments" snippet from JavaScript to Actionscript bundles, and the problem will persist. 将“评论”片段从JavaScript复制到Actionscript包,问题将持续存在。

Thanks! 谢谢!

In your ActionScript Bundle, add a Preference called "Comments". 在ActionScript Bundle中,添加名为“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 最后在底部,将范围选择器设置为: 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. 完成这些更改后,请务必使用“ Reload Bundles菜单项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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