From 4d22995ea33102682e73c4b702c1f5c2649cfc0c Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Mon, 5 Aug 2024 07:19:38 +0200 Subject: [PATCH] Fix line number matching bug --- build_file.cpp | 4 ++-- src/text_editor/generated.cpp | 4 ++-- src/text_editor/lua_api.cpp | 2 ++ src/text_editor/todo.txt | 3 +-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build_file.cpp b/build_file.cpp index 2429f81..aef1337 100644 --- a/build_file.cpp +++ b/build_file.cpp @@ -225,7 +225,7 @@ function ExtractLineAndColumn(s) s = s:sub(1, lci - 1) return line, col, s else - local li, lj = s:find("(%d+):$") + local li, lj = s:find("%(%d+%):$") if li then local line_string = s:sub(li, lj) line = line_string:sub(2, -3) @@ -244,7 +244,7 @@ function ExtractLineAndColumn(s) s = s:sub(1, lci - 1) return line, col, s else - local li, lj = s:find("(%d+)$") + local li, lj = s:find("%(%d+%)$") if li then local line_string = s:sub(li, lj) line = line_string:sub(2, -2) diff --git a/src/text_editor/generated.cpp b/src/text_editor/generated.cpp index 734d98b..52f5da0 100644 --- a/src/text_editor/generated.cpp +++ b/src/text_editor/generated.cpp @@ -95,7 +95,7 @@ function ExtractLineAndColumn(s) s = s:sub(1, lci - 1) return line, col, s else - local li, lj = s:find("(%d+):$") + local li, lj = s:find("%(%d+%):$") if li then local line_string = s:sub(li, lj) line = line_string:sub(2, -3) @@ -114,7 +114,7 @@ function ExtractLineAndColumn(s) s = s:sub(1, lci - 1) return line, col, s else - local li, lj = s:find("(%d+)$") + local li, lj = s:find("%(%d+%)$") if li then local line_string = s:sub(li, lj) line = line_string:sub(2, -2) diff --git a/src/text_editor/lua_api.cpp b/src/text_editor/lua_api.cpp index 721ac40..4862fbe 100644 --- a/src/text_editor/lua_api.cpp +++ b/src/text_editor/lua_api.cpp @@ -155,6 +155,8 @@ luaL_Reg LuaFunctions[] = { { "FileExists", LuaFileExists}, {"GetCurrentBufferName", LuaGetCurrentBufferName}, { "GetCurrentBufferDir", LuaGetCurrentBufferDir}, + { "print", LuaPrint}, + { "Print", LuaPrint}, { NULL, NULL}, }; diff --git a/src/text_editor/todo.txt b/src/text_editor/todo.txt index 95ded8d..9fcdbbc 100644 --- a/src/text_editor/todo.txt +++ b/src/text_editor/todo.txt @@ -1,8 +1,7 @@ - page up and down should also scroll and leave you in exactly same scroll - I think the way sublime text and we display line highlights is confusing with multiple cursors (line highlight can be confused with selection) -- ctrl + delete maybe should stop on new line but it keeps on going +- ctrl + delete maybe should stop on new line but it keeps on going, sublime is much more careful with deleting -- bug: Latin-1 is matched as column for some reason in ApplyRules!! - mouse execute (control right click) - alt right click what to do ? (toggle console?) - experiment with using multiple cursors to select command and it's input