diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-03 22:08:14 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-03 22:08:14 -0500 |
commit | 4007253649425ff37a503ea77cff2155ab9814ef (patch) | |
tree | 72cd40904068ee552def13ad3e99e59ed35e2748 | |
parent | a566e529522940f011aa1fa08d44753b6bea9562 (diff) |
fixed command line argument with / in it windows
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | colors.h | 2 | ||||
-rw-r--r-- | main.c | 8 | ||||
-rw-r--r-- | syntax.c | 1 |
4 files changed, 14 insertions, 4 deletions
@@ -40,7 +40,12 @@ a simple editor that starts up practically instantaneously, and performs well on ## Building from source -On Linux, run `make`; on Windows, run `make.bat`. +On Linux, run `make`. + +On Windows, you will need the SDL2 VC development libraries: https://www.libsdl.org/download-2.0.php +Copy SDL2-2.x.y into the ted directory, and rename it to SDL2. Additionally, copy SDL2\lib\x64\SDL2.dll +to the ted directory. +Then run `make.bat`. ## License @@ -71,7 +71,7 @@ static ColorName const color_names[COLOR_COUNT] = { }; static ColorSetting color_setting_from_str(char const *str) { - // @OPTIM: sort color_names, binary search + // @OPTIMIZE: sort color_names, binary search for (int i = 0; i < COLOR_COUNT; ++i) { ColorName const *n = &color_names[i]; if (streq(n->name, str)) @@ -1,5 +1,5 @@ // @TODO: -// - ensure buffer->filename never contains / on windows +// - popup to reload files and config on change // - split // - Windows installation #include "base.h" @@ -110,12 +110,18 @@ int main(int argc, char **argv) { switch (argc) { case 0: case 1: break; case 2: + // essentially, replace / with \ on windows. + for (char *p = argv[1]; *p; ++p) + if (strchr(ALL_PATH_SEPARATORS, *p)) + *p = PATH_SEPARATOR; starting_filename = argv[1]; break; default: fprintf(stderr, "Usage: %s [filename]\n", argv[0]); return EXIT_FAILURE; } + + SDL_SetHint(SDL_HINT_NO_SIGNAL_HANDLERS, "1"); // if this program is sent a SIGTERM/SIGINT, don't turn it into a quit event if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) < 0) @@ -418,7 +418,6 @@ static void syntax_highlight_python(SyntaxState *state, char32_t *line, u32 line break; case '\'': case '"': { - // @TODO: multi-line strings bool dbl_quoted = c == '"'; bool is_triple = i < line_len - 2 && line[i+1] == c && line[i+2] == c; |