简体   繁体   English

SublimeREPL为irb突出显示语法

[英]Syntax Highlighting for irb with SublimeREPL

I am using Sublime Text 2 as a text editor, with SublimeREPL to get a Ruby REPL. 我正在使用Sublime Text 2作为文本编辑器,通过SublimeREPL获得Ruby REPL。 The problem is that irb likes to give output like: 问题是irb喜欢提供如下输出:

irb(main):008:0> hello
NameError: undefined local variable or method `hello' for main:Object
    from (irb):8
    from /usr/bin/irb:12:in `<main>'

which messes up syntax highlighting (because of the extra ' at the end). 弄乱了语法高亮显示(因为末尾有多余的')。 The only "solution" I could come up with was to cause another error so the 's match (or turn off syntax highlighting altogether, which would defeat the point of bringing the REPL to ST in the first place). 我唯一能想到的“解决方案”是引起另一个错误,因此,该匹配(或完全关闭语法高亮显示,这将使REPL首先成为ST成为现实)。

While only a minor one, it is nevertheless an annoyance. 虽然只是个小孩子,但这仍然很烦人。 Does anyone here know a way to fix this? 这里有人知道解决此问题的方法吗?

The right way to fix this would be to create a IRB Console.tmLanguage which would tokenize and parse irb's output correctly. 解决此问题的正确方法是创建一个IRB Console.tmLanguage,它将正确标记和解析irb的输出。

As for the quick fix/workaround, evaluating this will rebalance ' 至于快速修复/解决方法,对此进行评估会重新平衡“

irb(main):015:0> 0 #'

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

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