summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-04-19 22:51:33 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2021-04-19 22:53:35 -0400
commitda61efabb1b28c5500824a560c960a720a628de0 (patch)
tree618127733dd0a2923536f52b920671723e6471db /ted.h
parent61cd687d858b7a3811a168393f6b698c24cfff17 (diff)
markdown highlighting
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ted.h b/ted.h
index 66648f5..c05f8d3 100644
--- a/ted.h
+++ b/ted.h
@@ -33,6 +33,10 @@ enum {
SYNTAX_STATE_TEX_VERBATIM = 0x04u, // inside \begin{verbatim} ... \end{verbatim}
};
+enum {
+ SYNTAX_STATE_MARKDOWN_CODE = 0x01u, // inside ``` ``` code section
+};
+
typedef u8 SyntaxState;
ENUM_U16 {
@@ -42,6 +46,7 @@ ENUM_U16 {
LANG_RUST,
LANG_PYTHON,
LANG_TEX,
+ LANG_MARKDOWN,
LANG_COUNT
} ENUM_U16_END(Language);
@@ -57,6 +62,7 @@ static LanguageName const language_names[] = {
{LANG_RUST, "Rust"},
{LANG_PYTHON, "Python"},
{LANG_TEX, "Tex"},
+ {LANG_MARKDOWN, "Markdown"},
};
static_assert_if_possible(arr_count(language_names) == LANG_COUNT)
@@ -73,6 +79,8 @@ ENUM_U8 {
} ENUM_U8_END(SyntaxCharType);
#define SYNTAX_MATH SYNTAX_STRING // for tex
+#define SYNTAX_CODE SYNTAX_PREPROCESSOR // for markdown
+#define SYNTAX_LINK SYNTAX_CONSTANT // for markdown
typedef struct {
float cursor_blink_time_on, cursor_blink_time_off;