diff options
-rw-r--r-- | base.h | 4 | ||||
-rw-r--r-- | buffer.c | 7 | ||||
-rw-r--r-- | build.c | 3 | ||||
-rw-r--r-- | colors.c | 2 | ||||
-rw-r--r-- | colors.h | 2 | ||||
-rw-r--r-- | command.c | 3 | ||||
-rw-r--r-- | command.h | 10 | ||||
-rw-r--r-- | config.c | 3 | ||||
-rw-r--r-- | find.c | 2 | ||||
-rw-r--r-- | gl.c | 3 | ||||
-rw-r--r-- | ide-autocomplete.c | 2 | ||||
-rw-r--r-- | ide-definitions.c | 3 | ||||
-rw-r--r-- | ide-highlights.c | 2 | ||||
-rw-r--r-- | ide-signature-help.c | 1 | ||||
-rw-r--r-- | ide-usages.c | 2 | ||||
-rw-r--r-- | lsp.c | 2 | ||||
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | sdl-inc.h | 8 | ||||
-rw-r--r-- | ted.h | 3 |
19 files changed, 48 insertions, 18 deletions
@@ -12,10 +12,6 @@ #define _GNU_SOURCE #endif -#if DEBUG || __TINYC__ // speed up compile time on debug, also tcc doesn't have immintrin.h -#define SDL_DISABLE_IMMINTRIN_H -#endif - #if __GNUC__ #define FALLTHROUGH __attribute__((fallthrough)); #else @@ -1,10 +1,11 @@ -#include "ted.h" - - // Text buffers - These store the contents of a file. // NOTE: All text editing should be done through the two functions // buffer_insert_text_at_pos and buffer_delete_chars_at_pos +#include "ted.h" + + + // this is a macro so we get -Wformat warnings #define buffer_seterr(buffer, ...) \ snprintf(buffer->error, sizeof buffer->error - 1, __VA_ARGS__) @@ -1,3 +1,6 @@ +// :build command +// also handles :shell. + #include "ted.h" void build_stop(Ted *ted) { @@ -1,3 +1,5 @@ +// color names and functions for dealing with colors + #include "ted.h" typedef struct { @@ -1,3 +1,5 @@ +// colors enum. + #ifndef COLORS_H_ #define COLORS_H_ @@ -1,3 +1,6 @@ +// the main highlight here is command_execute, which +// determines what to do when a command is executed. + #include "ted.h" typedef struct { @@ -1,12 +1,12 @@ +// command enum + #ifndef COMMAND_H_ #define COMMAND_H_ -#include "base.h" - -// i | ARG_STRING = ted->strings[i] +// `i | ARG_STRING` when used as an argument refers to `ted->strings[i]` #define ARG_STRING 0x4000000000000000 -ENUM_U16 { +typedef enum { CMD_UNKNOWN, CMD_NOOP, // do nothing // movement and selection commands @@ -113,7 +113,7 @@ ENUM_U16 { CMD_ESCAPE, // by default this is the escape key. closes menus, etc. CMD_COUNT -} ENUM_U16_END(Command); +} Command; #endif @@ -1,4 +1,4 @@ -// Read a configuration file. +// Read a ted configuration file. // Config files are formatted as several sections, each containing key = value pairs. // e.g.: // [section1] @@ -773,7 +773,6 @@ static void config_parse_line(ConfigReader *cfg, Settings *settings, const Confi if (command != CMD_UNKNOWN) { action->command = command; action->argument = argument; - action->line_number = cfg->line_number; } else { config_err(cfg, "Unrecognized command %s", value); } @@ -1,3 +1,5 @@ +// handles ted's find and replace menu. + #include "ted.h" #include "pcre-inc.h" @@ -1,3 +1,6 @@ +// various functions for dealing with OpenGL. +// also houses all of the basic rendering functions ted uses. + #include "ted.h" #include "lib/glcorearb.h" diff --git a/ide-autocomplete.c b/ide-autocomplete.c index 05f7844..39ee076 100644 --- a/ide-autocomplete.c +++ b/ide-autocomplete.c @@ -1,3 +1,5 @@ +// auto-completion for ted + #include "ted.h" #define TAGS_MAX_COMPLETIONS 200 // max # of tag completions to scroll through diff --git a/ide-definitions.c b/ide-definitions.c index 1518515..a6809b6 100644 --- a/ide-definitions.c +++ b/ide-definitions.c @@ -1,3 +1,6 @@ +// this file deals with ctrl+click "go to definition", and +// the definitions menu (Ctrl+D) + #include "ted.h" void definition_cancel_lookup(Ted *ted) { diff --git a/ide-highlights.c b/ide-highlights.c index e568820..424d640 100644 --- a/ide-highlights.c +++ b/ide-highlights.c @@ -1,3 +1,5 @@ +// highlight uses of identifier (LSP request textDocument/highlight) + #include "ted.h" void highlights_close(Ted *ted) { diff --git a/ide-signature-help.c b/ide-signature-help.c index e573f3e..e7138a8 100644 --- a/ide-signature-help.c +++ b/ide-signature-help.c @@ -1,4 +1,5 @@ // deals with textDocument/signatureHelp LSP requests +// this is the little thing which shows you the signature of the function and the current argument #include "ted.h" diff --git a/ide-usages.c b/ide-usages.c index 0bfdb05..806c09a 100644 --- a/ide-usages.c +++ b/ide-usages.c @@ -1,3 +1,5 @@ +// find usages of symbol + #include "ted.h" void usages_cancel_lookup(Ted *ted) { @@ -1,3 +1,5 @@ +// main file for dealing with LSP servers + #define LSP_INTERNAL 1 #include "lsp.h" #include "util.h" @@ -14,8 +14,8 @@ - when searching files, put exact matches at the top - auto-set build command for cmake (both for windows and unix) --- LSP MERGE --- -- some way of opening + closing all C files in directory for clangd workspace/symbols to work? - is this still necessary? +- some way of opening + closing all C files in directory for clangd + textDocument/references to work? - maybe it can be done with the clangd config instead. - CSS highlighting - styles ([color] sections) @@ -1,6 +1,14 @@ +// this file includes SDL.h. +// you should include this rather than including SDL.h directly. + #ifndef SDL_INC_H_ #define SDL_INC_H_ + +#if DEBUG || __TINYC__ // speed up compile time on debug, also tcc doesn't have immintrin.h +#define SDL_DISABLE_IMMINTRIN_H +#endif + no_warn_start #if _WIN32 #include <SDL.h> @@ -115,8 +115,7 @@ enum { typedef struct KeyAction { u32 key_combo; - u32 line_number; // config line number where this was set - Command command; // this will be 0 (COMMAND_UNKNOWN) if there's no action for the key + Command command; i64 argument; } KeyAction; |