【问题标题】:Sublime Text 3 edit color scheme valuesSublime Text 3 编辑配色方案值
【发布时间】:2016-02-05 21:21:06
【问题描述】:

我的 Sublime Text 3 编辑器中有以下 javascript 代码:

function get(db, segment_name, callback) {
  var query = {
    segment_name: segment_name
  };
}

图片:

我正在使用colorSchemeEditor 编辑我的主题的xml,因为我想更改上面查询对象中“segment_name”键的颜色。我在更改此特定值时遇到了一些麻烦,它确实找到了一个范围,(请参阅答案here),但是当我更改 xml 文件中的前景色时,它并没有改变颜色,我已经使用它更改了其他几种颜色技术。这是插件说属于此范围的相应xml sn-p:

<dict>
  <key>name</key>
  <string>ES7 Bind Operator</string>
  <key>scope</key>
  <string>source.js constant.other.object.key.js string.unquoted.label.js</string>
  <key>settings</key>
  <dict>
    <key>fontStyle</key>
    <string>italic</string>
    <key>foreground</key>
    <string>#CDD3DE</string>
  </dict>
</dict>

当我尝试更改 #CDD3DE 值并保存时,它不会应用新颜色。我也尝试在文件上使用几种不同的语法定义,包括纯 javascript、Javascript ES6 syntaxjavascript Babel

我还尝试使用链接答案中的可下载应用程序编辑主题。

我在主题的 xml 中的范围是否错误?还有其他解决方案吗?

【问题讨论】:

    标签: sublimetext3 syntax-highlighting sublime-text-plugin


    【解决方案1】:

    在我的主题 xml 文件中添加另外 3 个列表后,我能够更改颜色,如下所示:

    <dict>
      <key>name</key>
      <string>Object Properties</string>
      <key>scope</key>
      <string>source.js meta.group.braces.round.js meta.group.braces.square.js meta.group.braces.curly.js constant.other.object.key.js string.unquoted.label.js</string>
      <key>settings</key>
      <dict>
        <key>foreground</key>
        <string>#CDD3DE</string>
      </dict>
    </dict>
    
    <dict>
      <key>name</key>
      <string>Object Properties 2</string>
      <key>scope</key>
      <string>source.js meta.group.braces.curly.js constant.other.object.key.js string.unquoted.label.js, </string>
      <key>settings</key>
      <dict>
        <key>foreground</key>
        <string>#CDD3DE</string>
      </dict>
    </dict>
    
    <dict>
      <key>name</key>
      <string>Object Properties 3</string>
      <key>scope</key>
      <string>source.js meta.group.braces.curly meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js</string>
      <key>settings</key>
      <dict>
        <key>foreground</key>
        <string>#CDD3DE</string>
      </dict>
    </dict>
    

    这可能会通过更改列表上的“名称”键和/或合并列表来改进,并且可能会添加更多范围以保持一致。添加的范围是我在编辑单个 javascript 文件时发现的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-02
      • 2013-10-06
      • 2014-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-22
      相关资源
      最近更新 更多