Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

语法高亮能自定义新语言么? #930

Open
Tback1 opened this issue Dec 7, 2024 · 1 comment
Open

语法高亮能自定义新语言么? #930

Tback1 opened this issue Dec 7, 2024 · 1 comment

Comments

@Tback1
Copy link

Tback1 commented Dec 7, 2024

想自定义一门新的语言,但是尝试之后发现并不可行。
例如想要自定义给txt文本中的数字(加粗,红色)和网址部分(蓝色)显示
但是尝试全局导出后,将json文档部分的高亮方案copy到[Text File]字段下,再导入回去。但并无效果
image

之后临时的方案是在[JSON Document]的codepage下添加txt。再导入。

看了一下notepad4.ini,才明白似乎keyword,number等关键字都是写死了的,并不支持新的语言(比如假设我要定义一个fake language)。

那可以考虑自定义语言,添加关键字和正则匹配着色么?

@zufuliu
Copy link
Owner

zufuliu commented Dec 7, 2024

keyword,number等关键字都是写死了的

Yes, they are hard coded, only style for built-in lexers can be changed.

那可以考虑自定义语言,添加关键字和正则匹配着色么?

That's harder, will not be supported, but you can write your own lexer (or use one from https://github.com/ScintillaOrg/lexilla/tree/master/lexers) for the missing language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants