diff --git a/build.sh b/build.sh index fa688f6..d6d0d8b 100644 --- a/build.sh +++ b/build.sh @@ -47,10 +47,12 @@ if [ ! -f "lbaselib.o" ]; then -c fi -clang ../src/metaprogram/metaprogram.cpp -o metaprogram.exe \ - -nostdlib++ -fno-exceptions -fdiagnostics-absolute-paths -g \ - -Wno-writable-strings \ - -I../src +if [ ! -f "metaprogram.exe" ]; then + clang ../src/metaprogram/metaprogram.cpp -o metaprogram.exe \ + -nostdlib++ -fno-exceptions -fdiagnostics-absolute-paths -g \ + -Wno-writable-strings \ + -I../src +fi ./metaprogram.exe clang ../src/text_editor/text_editor.cpp ../src/basic/unix.cpp -o te_linux.exe \ diff --git a/data/init.lua b/data/init.lua index a663256..99908b6 100644 --- a/data/init.lua +++ b/data/init.lua @@ -333,7 +333,6 @@ function MatchExec(s, meta) end if s:match("^%$") then - Print(s:sub(2, -1)) return {kind = "exec_console", cmd = s:sub(2, -1), working_dir = GetMainDir()} end diff --git a/src/text_editor/commands.cpp b/src/text_editor/commands.cpp index 85c3fc8..bee4400 100644 --- a/src/text_editor/commands.cpp +++ b/src/text_editor/commands.cpp @@ -226,7 +226,6 @@ void ReportWarningf(const char *fmt, ...) { void Command_MoveCursorsByPageSize(Window *window, int direction, bool shift = false) { Assert(direction == DIR_UP || direction == DIR_DOWN); BSet set = GetBSet(window); - CheckpointBeforeGoto(window); Rect2I visible_cells_rect = GetVisibleCells(window); Int y = GetSize(visible_cells_rect).y - 2; @@ -1104,6 +1103,7 @@ int Lua_C(lua_State *L) { BSet Command_Open(Window *window, String path, String meta, bool set_active = true) { Scratch scratch; BSet set = GetBSet(window); + path = Trim(path); OnOpenResult ores = CallOnOpen(scratch, path, meta); if (ores.kind == "text") { if (set_active) { diff --git a/src/text_editor/commands_bindings.cpp b/src/text_editor/commands_bindings.cpp index 6a2126e..821106a 100644 --- a/src/text_editor/commands_bindings.cpp +++ b/src/text_editor/commands_bindings.cpp @@ -356,12 +356,10 @@ void OnCommand(Event event) { } else if (AltShiftPress(SDLK_DOWN)) { Command_CreateCursorVertical(active.view, DIR_DOWN); } else if (CtrlShiftPress(SDLK_DOWN)) { - CheckpointBeforeGoto(active.window); Command_Move(active.view, DIR_DOWN, CTRL_PRESSED, SHIFT_PRESSED); } else if (AltPress(SDLK_DOWN)) { Command_MoveLine(active.view, DIR_DOWN); } else if (CtrlPress(SDLK_DOWN)) { - CheckpointBeforeGoto(active.window); Command_Move(active.view, DIR_DOWN, CTRL_PRESSED); } else if (ShiftPress(SDLK_DOWN)) { Command_Move(active.view, DIR_DOWN, false, SHIFT_PRESSED); @@ -374,12 +372,10 @@ void OnCommand(Event event) { } else if (AltShiftPress(SDLK_UP)) { Command_CreateCursorVertical(active.view, DIR_UP); } else if (CtrlShiftPress(SDLK_UP)) { - CheckpointBeforeGoto(active.window); Command_Move(active.view, DIR_UP, CTRL_PRESSED, SHIFT_PRESSED); } else if (AltPress(SDLK_UP)) { Command_MoveLine(active.view, DIR_UP); } else if (CtrlPress(SDLK_UP)) { - CheckpointBeforeGoto(active.window); Command_Move(active.view, DIR_UP, CTRL_PRESSED); } else if (ShiftPress(SDLK_UP)) { Command_Move(active.view, DIR_UP, false, SHIFT_PRESSED); @@ -507,7 +503,7 @@ void OnCommand(Event event) { MergeCarets(active.buffer, &active.view->carets); } - if (AltPress(SDLK_N)) { + if (CtrlShiftPress(SDLK_N)) { Scratch scratch; String16 search_string = GetSearchString(main.window); Caret caret = FindPrev(main.buffer, search_string, main.view->carets[0]); diff --git a/src/text_editor/generated_config.cpp b/src/text_editor/generated_config.cpp index 4371d52..438fa88 100644 --- a/src/text_editor/generated_config.cpp +++ b/src/text_editor/generated_config.cpp @@ -334,7 +334,6 @@ function MatchExec(s, meta) end if s:match("^%$") then - Print(s:sub(2, -1)) return {kind = "exec_console", cmd = s:sub(2, -1), working_dir = GetMainDir()} end diff --git a/src/text_editor/process.cpp b/src/text_editor/process.cpp index ee5da83..49b571b 100644 --- a/src/text_editor/process.cpp +++ b/src/text_editor/process.cpp @@ -5,11 +5,6 @@ Array ActiveProcesses = {}; // and platform independent one Array Enviroment = {}; -struct UnixProcess { - pid_t pid; - int child_stdout_read; -}; - // WARNING: seems that this maybe can't work reliably? // in case of 'git grep a' it's possible that child process spawns it's own // child process and then it won't print anything because it won't have diff --git a/src/text_editor/text_editor.cpp b/src/text_editor/text_editor.cpp index 2bb65f1..fa83398 100644 --- a/src/text_editor/text_editor.cpp +++ b/src/text_editor/text_editor.cpp @@ -4,6 +4,7 @@ #include "basic/basic.h" #include "basic/filesystem.h" #include "basic/linked_list.h" + #include "basic/string16.cpp" #include "basic/math_int.cpp" #include "basic/math.cpp" diff --git a/src/text_editor/todo.txt b/src/text_editor/todo.txt index 99aaee0..5a9aaa2 100644 --- a/src/text_editor/todo.txt +++ b/src/text_editor/todo.txt @@ -1,17 +1,15 @@ DESIGN Config file versions, when loading should be checked, at the top of the file, what to do when old version? -BUILD Collapse the separate unit (unix, win32) into single build -DESIGN Prev search change hotkey to Ctrl+Shift instead of Alt+N +ISSUE Ctrl+Alt+Down (DuplicateLine) doesn't work on ubuntu +DESIGN Add debug buffer that will hold info on exit codes and other debug information + DESIGN Moving vertically between splits, which keys??? -DESIGN Console, console write should be preprended with new line not appended -DESIGN The cursor hopping history needs a bit of fixing, probably needs to be more complicated with collapsing commands etc. not sure - OR maybe make it only for buffer history, and shouldnt care about cursor history that much +DESIGN Console, when writing commands and evaling in console it should properly insert a new line after our thing when writing on last line +DESIGN The cursor hopping history needs a bit of fixing, probably needs to be more complicated with collapsing commands FEATURE KillConsole, or maybe some window targetting but how?? FEATURE SaveAll dirty files which are saved on disk already but dirty -ISSUE Cursor changes every frame and it causes stutter on screen NOT GOOD! ISSUE I hit a case where GC tried deleting a buffer which was not attached to the buffer list, it had zeroed next, prev. It happened after iterating through directories using the ctrl + period -ISSUE Ctrl + L or Exec shouldn't involve the last new line! FEATURE Search whole words, case sensitive etc. FEATURE Select all searched occurences