几个月来,我一直在使用 gedit 进行大部分 C++ 和 php 编辑,语法高亮显示效果很好。就在最近,我去查看我的一个 .cpp 文件,语法突出显示失败了。我尝试了多个其他文件,现在所有文件的语法突出显示都失败了。当 gedit 运行时,我收到以下错误:
(gedit:9833): GLib-CRITICAL **: PCRE library is compiled without UTF8 support
(gedit:9833): GLib-CRITICAL **: g_regex_match_full: assertion `regex != NULL' failed
(gedit:9833): GLib-CRITICAL **: PCRE library is compiled without UTF8 support
(gedit:9833): GLib-CRITICAL **: g_regex_replace_eval: assertion `regex != NULL' failed
(gedit:9833): GLib-CRITICAL **: g_regex_unref: assertion `regex != NULL' failed
(gedit:9833): GLib-CRITICAL **: PCRE library is compiled without UTF8 support
(gedit:9833): GLib-CRITICAL **: g_regex_match_full: assertion `regex != NULL' failed
(gedit:9833): GLib-CRITICAL **: PCRE library is compiled without UTF8 support
(gedit:9833): GLib-CRITICAL **: g_regex_replace_eval: assertion `regex != NULL' failed
(gedit:9833): GLib-CRITICAL **: g_regex_unref: assertion `regex != NULL' failed
(gedit:9833): GLib-CRITICAL **: PCRE library is compiled without UTF8 support
(gedit:9833): GLib-CRITICAL **: g_regex_match_full: assertion `regex != NULL' failed
(gedit:9833): GLib-CRITICAL **: PCRE library is compiled without UTF8 support
(gedit:9833): GLib-CRITICAL **: g_regex_replace_eval: assertion `regex != NULL' failed
(gedit:9833): GLib-CRITICAL **: g_regex_unref: assertion `regex != NULL' failed
(gedit:9833): GtkSourceView-WARNING **: in file /usr/share/gtksourceview-2.0/language-specs/cpp.lang: style 'c:keyword' not defined
(gedit:9833): GtkSourceView-WARNING **: Failed to load '/usr/share/gtksourceview-2.0/language-specs/cpp.lang': style override used with wildcard context reference in language 'cpp' in ref 'def:line-continue'
这是一个最近才开始发生的非常令人沮丧的问题,我不确定为什么。
附加信息:
- 我没有root权限
- 我的机器运行的是 openSUSE 11.3
- gedit 版本:2.28.3
- pcretest 命令返回:PCRE 版本 7.6 2008-01-28
- 我已经多次重启,希望这会自行修复,但没有成功
我将不胜感激任何关于这个问题的帮助或想法。
最佳答案
折腾了很久,终于解决了我的问题。我正在处理涉及编辑我的 LD_LIBRARY_PATH 环境变量的程序,因此我在我的 .cshrc 中添加了几行以添加追加一些共享库。我确保将我新添加的库附加到变量,但无论出于何种原因,这仍然搞砸了 Gedit 进行语法高亮显示的能力。从我的 .cshrc 脚本中取出 setenv 命令后,我重新启动,Gedit 的语法突出显示恢复正常。
我听说使用 LD_LIBRARY_PATH 被认为是不好的做法。现在我对可能出错的地方有了第一手经验。
关于linux - Gedit 语法突出显示不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38526595/