diff options
author | pommicket <pommicket@gmail.com> | 2023-03-02 09:53:11 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-03-02 09:53:11 -0500 |
commit | 595cc50b7985ec67c49c6e2ffc649cb04692a318 (patch) | |
tree | 970ab71aadabc9f0f0a7a1634512c31aedd23188 /ted.h | |
parent | 6d9ebc8332b6cc54ada4bc17689e4de4040892c6 (diff) |
dynamic language registration working
Diffstat (limited to 'ted.h')
-rw-r--r-- | ted.h | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -94,10 +94,6 @@ enum { /// May be one of the `LANG_*` constants, or a dynamically registered language. typedef u32 Language; -/// Maximum number of languages available. -#define LANG_COUNT_MAX 511 - - /// Current state of syntax highlighting. typedef u32 SyntaxState; @@ -336,7 +332,7 @@ typedef struct { double scroll_x, scroll_y; /// last write time to `path` double last_write_time; - /// 1 + the language the buffer has been manually set to, or 0 if it hasn't been manually set to anything + /// the language the buffer has been manually set to, or `LANG_NONE` if it hasn't been set to anything i64 manual_language; /// position of cursor BufferPos cursor_pos; @@ -1492,7 +1488,13 @@ void session_read(Ted *ted); /// /// this should be done before loading configs so language-specific settings are recognized properly. void syntax_register_language(const LanguageInfo *info); +/// register ted's built-in languages. +void syntax_register_builtin_languages(void); +/// returns `true` if `language` is a valid language ID +bool language_is_valid(Language language); +/// read language name from `str`. returns `LANG_NONE` if `str` is invalid. Language language_from_str(const char *str); +/// convert language to string const char *language_to_str(Language language); /// string which should be put before comments in the given language const char *language_comment_start(Language l); |