ListCode improvements
This commit is contained in:
@@ -1042,9 +1042,9 @@ int Lua_ToggleFullscreen(lua_State *L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ListFilesRecursive(Buffer *buffer, String filename) {
|
||||
void ListFilesRecursive(Buffer *buffer, String dir) {
|
||||
Scratch scratch(buffer->line_starts.allocator);
|
||||
for (FileIter it = IterateFiles(scratch, filename); IsValid(it); Advance(&it)) {
|
||||
for (FileIter it = IterateFiles(scratch, dir); IsValid(it); Advance(&it)) {
|
||||
if (it.filename == ".git") {
|
||||
continue;
|
||||
}
|
||||
@@ -1055,7 +1055,7 @@ void ListFilesRecursive(Buffer *buffer, String filename) {
|
||||
if (!good) {
|
||||
continue;
|
||||
}
|
||||
RawAppendf(buffer, "%.*s\n", FmtString(it.absolute_path));
|
||||
RawAppendf(buffer, "%-100.*s %.*s\n", FmtString(it.absolute_path), FmtString(it.filename));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1065,6 +1065,7 @@ void Command_ListCode(void) {
|
||||
JumpGarbageBuffer(&main);
|
||||
ListFilesRecursive(main.buffer, WorkDir);
|
||||
main.view->fuzzy_search = true;
|
||||
Command_SelectRangeOneCursor(main.view, GetEndAsRange(main.buffer));
|
||||
}
|
||||
|
||||
int Lua_ListCode(lua_State *L) {
|
||||
@@ -1087,6 +1088,7 @@ BSet Command_Exec(String cmd, String working_dir, bool set_active = true) {
|
||||
Exec(set.view->id, true, cmd, working_dir);
|
||||
return set;
|
||||
}
|
||||
|
||||
int Lua_C(lua_State *L) {
|
||||
String string = lua_tostring(L, 1);
|
||||
lua_pop(L, 1);
|
||||
|
||||
Reference in New Issue
Block a user