diff options
author | pommicket <pommicket@gmail.com> | 2023-01-02 14:37:21 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-02 14:37:21 -0500 |
commit | c91c49ab846603e332be8e6eacebcbbb0c45017d (patch) | |
tree | 4a6ab88f03afb20b767825a9db4ca26783e9f9a6 | |
parent | fd866bf94487ee39cccdaea749407faa487fcee5 (diff) |
clean some stuff up
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | base.h | 4 | ||||
-rw-r--r-- | buffer.c | 1 | ||||
-rw-r--r-- | build.c | 2 | ||||
-rw-r--r-- | ide-hover.c | 2 | ||||
-rw-r--r-- | main.c | 1 | ||||
-rw-r--r-- | sdl-inc.h | 3 | ||||
-rw-r--r-- | ted.h | 3 |
9 files changed, 13 insertions, 14 deletions
@@ -3,6 +3,7 @@ ted !windows_installer/ted/ted Debug Release +obj *~ *.swp tags @@ -19,12 +19,10 @@ OBJECTS=obj/buffer.o obj/build.o obj/colors.o obj/command.o\ obj/syntax.o obj/tags.o obj/ted.o obj/text.o obj/ui.o obj/util.o ted: *.[ch] libpcre2-32.a $(OBJECTS) $(CC) $(OBJECTS) -o ted $(DEBUG_CFLAGS) $(LIBS) -obj/stb_%.o: stb_%.c obj - $(CC) -O3 -Wall $< -c -o $@ -obj/%.o: %.c *.h obj - $(CC) -Wall $< -c -o $@ $(DEBUG_CFLAGS) -obj: - mkdir obj +obj/stb_%.o: stb_%.c + mkdir -p obj && $(CC) -O3 -Wall $< -c -o $@ +obj/%.o: %.c *.h + mkdir -p obj && $(CC) -Wall $< -c -o $@ $(DEBUG_CFLAGS) release: *.[ch] libpcre2-32.a $(CC) main.c -o ted $(RELEASE_CFLAGS) $(LIBS) profile: *.[ch] libpcre2-32.a @@ -9,6 +9,10 @@ #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,5 +1,6 @@ #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 @@ -159,7 +159,7 @@ static int parse_nonnegative_integer(char32_t **str, char32_t *end) { // could this character (reasonably) appear in a source file path? static bool is_source_path(char32_t c) { const char *allowed_ascii_symbols_in_path = "./\\-_:"; - return c > CHAR_MAX || isalnum((char)c) + return c > CHAR_MAX || is32_alnum((wint_t)c) || strchr(allowed_ascii_symbols_in_path, (char)c); } diff --git a/ide-hover.c b/ide-hover.c index 254f56d..aed5dbd 100644 --- a/ide-hover.c +++ b/ide-hover.c @@ -67,7 +67,7 @@ void hover_process_lsp_response(Ted *ted, LSPResponse *response) { char *p = hover->text + strlen(hover->text) - 1; // remove trailing whitespace // (rust-analyzer gives us trailing newlines for local variables) - for (; p > hover->text && isspace(*p); --p) + for (; p > hover->text && strchr("\n \t", *p); --p) *p = '\0'; } } @@ -1,6 +1,5 @@ /* @TODO: -- don't include SDL when possible - rename v[234] to vec[234] - make ctrl+up/ctrl+down move to next/prev blank line - broken session fix: close buffers not in any used node @@ -5,9 +5,6 @@ no_warn_start #if _WIN32 #include <SDL.h> #else - #if DEBUG || __TINYC__ // speed up compile time on debug, also tcc doesn't have immintrin.h - #define SDL_DISABLE_IMMINTRIN_H - #endif #include <SDL2/SDL.h> #endif no_warn_end @@ -2,7 +2,6 @@ #define TED_H_ #include "base.h" -#include "sdl-inc.h" #include "util.h" #include "os.h" #include "unicode.h" @@ -12,6 +11,7 @@ #include "colors.h" #include "command.h" #include "lib/glcorearb.h" +#include "sdl-inc.h" #define TED_VERSION "2.0" #define TED_VERSION_FULL "ted v. " TED_VERSION @@ -95,7 +95,6 @@ ENUM_U8 { #define SYNTAX_CODE SYNTAX_PREPROCESSOR // for markdown #define SYNTAX_LINK SYNTAX_CONSTANT // for markdown - #define SCANCODE_MOUSE_X1 (SDL_NUM_SCANCODES) #define SCANCODE_MOUSE_X2 (SDL_NUM_SCANCODES+1) #define SCANCODE_COUNT (SDL_NUM_SCANCODES+2) |