diff options
author | pommicket <pommicket@gmail.com> | 2023-03-04 16:06:50 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-03-04 16:06:50 -0500 |
commit | ed9d2be11db07ed1e31e884004ae65b14991de1a (patch) | |
tree | 50d7b3a19089c168d37912143963dbcceff63a16 | |
parent | 2bdf5709514f5ff4fd734945c883f7789d9cda64 (diff) |
highlight directives in ted.cfg
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | syntax.c | 5 | ||||
-rw-r--r-- | ted.cfg | 4 | ||||
-rw-r--r-- | ted.h | 2 |
4 files changed, 8 insertions, 5 deletions
@@ -1,6 +1,4 @@ /* -@TODO: -- higlighlight directives in ted.cfg FUTURE FEATURES: - styles ([color] sections) - for this, it would be nice to have #include in ted.cfg @@ -1190,6 +1190,11 @@ static void syntax_highlight_cfg(SyntaxState *state, const char32_t *line, u32 l return; } + if (!string && is_ted_cfg && line[0] == '%') { + memset(char_types, SYNTAX_PREPROCESSOR, line_len); + return; + } + int backslashes = 0; for (u32 i = 0; i < line_len; ++i) { @@ -441,8 +441,8 @@ GLSL = .glsl, .tesc, .tese, .vert, .frag, .geom, .comp HTML = .html, .php, .xhtml XML = .xml, .iml Config = .cfg, .toml -# ted.cfg has its own syntax highlighting for multiline strings. -TedCfg = ted.cfg, .ted.cfg +# ted.cfg has its own syntax highlighting +TedCfg = ted.cfg JavaScript = .js TypeScript = .ts JSON = .json @@ -70,7 +70,7 @@ enum { LANG_JAVA = 10, /// Go LANG_GO = 11, - /// like \ref LANG_CONFIG, but with multiline strings. + /// like \ref LANG_CONFIG, but with more highlighting for ted.cfg-specific stuff. LANG_TED_CFG = 12, /// TypeScript LANG_TYPESCRIPT = 13, |