【发布时间】:2018-07-19 16:17:36
【问题描述】:
我有一个在 TextMate 中使用的自定义语法高亮。它在 TextMate 1 中效果很好,但在 Textmate 2 中,它将整行视为一个单词。
这会影响:
- 双击选择单词(选择整行)
- alt+箭头将光标移到单词上(跳过整行)
Textmate 1 在一般偏好中曾经有一个“单词边界”选项,我认为这就是它起作用的原因。
我了解 Textmate 2 refactored 字边界处理,但我不明白如何使我的语法包在新范式中工作。
我的语言语法很简单,有这样的词条:
{ patterns = (
{
name = 'constant.language.toStart.todo';
match = '^\s*o\s.*';
// ^ Starting at the beginning of the line,
// \s* Preceded by any number of spaces
// o\s Match any "o "
// .* Then match all chars after it
}
}
我有没有办法修改匹配器,以便编辑器尊重这些匹配模式内的单词边界?
【问题讨论】:
-
它不应该匹配什么?
-
这会像我想要的那样突出显示整行。但是,出于文本导航的目的,编辑器随后将整行视为一个“单词”,这对我来说是不可接受的。
标签: syntax-highlighting textmate textmate2