diff options
| author | Cyriaque Skrapits <cysoun@gmail.com> | 2022-07-13 17:06:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-13 11:06:42 -0400 |
| commit | af3e2c971c2c276f8154ef10c85338a66488aeb7 (patch) | |
| tree | 1a6509875675e0072c69cf5e7f949472ed45f938 /data/plugins/language_python.lua | |
| parent | 2dac3667cb183850cf521b162e025a4c6a62d6b8 (diff) | |
| download | lite-xl-af3e2c971c2c276f8154ef10c85338a66488aeb7.tar.gz lite-xl-af3e2c971c2c276f8154ef10c85338a66488aeb7.zip | |
`language_python`: Add new patterns (#1074)
* `language_python`: Add new patterns
This commit provides:
- multiline comments support;
- unicode string symbol highlighting;
- class names as keyword2.
Diffstat (limited to 'data/plugins/language_python.lua')
| -rw-r--r-- | data/plugins/language_python.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/data/plugins/language_python.lua b/data/plugins/language_python.lua index b96b56b9..6952a965 100644 --- a/data/plugins/language_python.lua +++ b/data/plugins/language_python.lua @@ -6,8 +6,12 @@ syntax.add { files = { "%.py$", "%.pyw$", "%.rpy$" }, headers = "^#!.*[ /]python", comment = "#", + block_comment = { '"""', '"""' }, patterns = { { pattern = "#.*", type = "comment" }, + { pattern = { '^%s*"""', '"""' }, type = "comment" }, + { pattern = '[uUrR]%f["]', type = "keyword" }, + { pattern = "class%s+()[%a_][%w_]*", type = {"keyword", "keyword2"} }, { pattern = { '[ruU]?"""', '"""'; '\\' }, type = "string" }, { pattern = { "[ruU]?'''", "'''", '\\' }, type = "string" }, { pattern = { '[ruU]?"', '"', '\\' }, type = "string" }, |
