summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-04-20 14:51:50 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2021-04-20 14:51:50 -0400
commita57a9682e74ff3609acb2ca6697fc6fa94c23fb6 (patch)
treebbe848dd7e5c7ae259fbcfdf3253240bc564c8d8 /ted.h
parentf90d98c3c451aa5be2979ff05863b5aa8bee9336 (diff)
:set-language, various other little things
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/ted.h b/ted.h
index e08f222..941508f 100644
--- a/ted.h
+++ b/ted.h
@@ -43,16 +43,18 @@ enum {
typedef u8 SyntaxState;
+// If you are adding new languages, DO NOT change the constant values
+// of the previous languages. It will mess up config files!
ENUM_U16 {
- LANG_NONE,
- LANG_C,
- LANG_CPP,
- LANG_RUST,
- LANG_PYTHON,
- LANG_TEX,
- LANG_MARKDOWN,
- LANG_HTML,
- LANG_CONFIG, // .cfg files, e.g. ted.cfg
+ LANG_NONE = 0,
+ LANG_C = 1,
+ LANG_CPP = 2,
+ LANG_RUST = 3,
+ LANG_PYTHON = 4,
+ LANG_TEX = 5,
+ LANG_MARKDOWN = 6,
+ LANG_HTML = 7,
+ LANG_CONFIG = 8, // .cfg files, e.g. ted.cfg
LANG_COUNT
} ENUM_U16_END(Language);
@@ -159,6 +161,7 @@ typedef struct {
struct Ted *ted; // we keep a back-pointer to the ted instance so we don't have to pass it in to every buffer function
double scroll_x, scroll_y; // number of characters scrolled in the x/y direction
struct timespec last_write_time; // last write time to filename.
+ i16 manual_language; // 1 + the language the buffer has been manually set to, or 0 if it hasn't been manually set to anything
BufferPos cursor_pos;
BufferPos selection_pos; // if selection is true, the text between selection_pos and cursor_pos is selected.
bool is_line_buffer; // "line buffers" are buffers which can only have one line of text (used for inputs)