我想改变标记文件的列表标记在GEdit中显示在主题tomorrow_night-eighties.xml中的方式,这是我从https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes下载的。我知道GEdit从
/usr/share/gtksourceview-3.0/language-specs/标记语言文件是markdown.lang。样式位于我的用户目录中:
~/.local/share/gtksourceview-2.0/styles我所做的是:
<style name="markdown:list-marker" foreground="#cc99cc" bold="true"/>添加到样式document.in用户的.local/share/....文件夹中的可用样式列表中。<style id="list-marker" _name="List Marker" map-to="markdown:list-marker"/>在<styles>...</styles>区域/标记中,以便使其可用于进一步向下引用。我的主题被设置为tomorrow_night-eighties.xml (我在~/.local/share/gtksourceview-2.0/styles中的主题),并打开一个标记文件。更改之后,GEdit不再突出显示列表标记。
我不明白的是,错过了什么?我只更改了一个引用,引入了一个新的样式,根本没有改变正则表达式,那么为什么这样做会阻止它突出显示呢?
发布于 2016-09-29 13:00:27
GEdit似乎不会自动注意到这些文件中的更改,因此必须重新导入首选项中的样式,而且如果语言文件发生了更改,也必须重新启动GEdit。
发布于 2021-09-10 18:19:21
在创建<context>属性时,存在一个带有<language>和id=标记标识符的错误,可能也适用于<style>标记。
下面的原型测试套件是在这个环境中运行的:
linuxuser@ubuntu:~$ gedit -V
gedit - Version 3.28.1
linuxuser@ubuntu:~$ uname -a
Linux ubuntu 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:00 UTC 2019 i686 i686 i686 GNU/Linux
linuxuser@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic演示此故障的测试套件语言文件:
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of GtkSourceView
special mods for extended background highlighting and comments MJS aka etx 2021
id (mandatory)
Identifier for the description.
This is used for external references and must be unique among language descriptions.
It can contain a string of letters, digits, hyphens ("-") and underscores ("_"). NOT!!!
as follows for id attribute of both tags language & context
empirical evidence gathered via simultaneously changing both id's to be identical
fails reliably: xRef
fail unreliably: x-ref X_-ef3
but aOk: xref xref3 x-ref3
-->
<language id="xRef" name="C..C xref augment cpp" version="2.0" _section="other">
<definitions>
<context id="special-multiline-comment" style-ref="def:note" > <!-- hi-liter -->
<start>/(\* .. .. .. \*)+/</start>
<end>\%{0@start}</end>
</context>
<!--Main context-->
<context class="no-spell-check" id="xRef" >
<include>
<context ref="special-multiline-comment"/> <!-- override MUST precede to supercede -->
<!-- actual language definition: editing hi lite stuff plus everything from C++ -->
<context ref="cpp:cpp"/>
</include>
</context>
</definitions>
</language>https://stackoverflow.com/questions/39766729
复制相似问题