Print and print in lua
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
int Lua_Print(lua_State *L) {
|
int Lua_print(lua_State *L) {
|
||||||
Scratch scratch;
|
Scratch scratch;
|
||||||
int nargs = lua_gettop(L);
|
int nargs = lua_gettop(L);
|
||||||
View *null_view = GetView(NullViewID);
|
View *null_view = GetView(NullViewID);
|
||||||
@@ -11,6 +11,19 @@ int Lua_Print(lua_State *L) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Lua_Print(lua_State *L) {
|
||||||
|
Scratch scratch;
|
||||||
|
int nargs = lua_gettop(L);
|
||||||
|
View *view = GetView(DebugViewID);
|
||||||
|
for (int i = 1; i <= nargs; i += 1) {
|
||||||
|
String string = lua_tostring(L, i);
|
||||||
|
Command_Appendf(view, "%.*s ", FmtString(string));
|
||||||
|
}
|
||||||
|
Command_Appendf(view, "\n");
|
||||||
|
lua_pop(L, nargs);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int Lua_Kill(lua_State *L) {
|
int Lua_Kill(lua_State *L) {
|
||||||
BSet main = GetActiveMainSet();
|
BSet main = GetActiveMainSet();
|
||||||
KillProcess(main.view);
|
KillProcess(main.view);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
luaL_Reg LuaFunctions[] = {
|
luaL_Reg LuaFunctions[] = {
|
||||||
|
{"print", Lua_print},
|
||||||
{"Print", Lua_Print},
|
{"Print", Lua_Print},
|
||||||
{"Kill", Lua_Kill},
|
{"Kill", Lua_Kill},
|
||||||
{"GetLoadWord", Lua_GetLoadWord},
|
{"GetLoadWord", Lua_GetLoadWord},
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ WindowID NullWindowID;
|
|||||||
|
|
||||||
// hidden floating window
|
// hidden floating window
|
||||||
WindowID DebugWindowID;
|
WindowID DebugWindowID;
|
||||||
|
ViewID DebugViewID;
|
||||||
BufferID DebugBufferID;
|
BufferID DebugBufferID;
|
||||||
|
|
||||||
WindowSplit WindowSplits;
|
WindowSplit WindowSplits;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
FEATURE SaveAll dirty files which are saved on disk already but dirty
|
FEATURE SaveAll dirty files which are saved on disk already but dirty
|
||||||
|
DESIGN try to make console less special, make stuff reusable etc.
|
||||||
DESIGN Config file versions, when loading should be checked, at the top of the file, what to do when old version?
|
DESIGN Config file versions, when loading should be checked, at the top of the file, what to do when old version?
|
||||||
ISSUE Ctrl+Alt+Down (DuplicateLine) doesn't work on ubuntu
|
ISSUE Ctrl+Alt+Down (DuplicateLine) doesn't work on ubuntu
|
||||||
DESIGN Moving vertically between splits, which keys???
|
DESIGN Moving vertically between splits, which keys???
|
||||||
@@ -53,7 +54,6 @@ backlog
|
|||||||
- redo tree
|
- redo tree
|
||||||
- gap buffer
|
- gap buffer
|
||||||
- optimize rendering - command buffer, and vertice buffer instead of vertice buffer with scissor
|
- optimize rendering - command buffer, and vertice buffer instead of vertice buffer with scissor
|
||||||
- fix sdl mouse cursor code, visual artifacts, fast cursor changing stuff
|
|
||||||
|
|
||||||
|
|
||||||
!!As little lua code as possible, but lua code should be powerful just in case of quick edits
|
!!As little lua code as possible, but lua code should be powerful just in case of quick edits
|
||||||
@@ -197,6 +197,7 @@ void InitWindows() {
|
|||||||
buffer->no_history = true;
|
buffer->no_history = true;
|
||||||
|
|
||||||
View *view = CreateView(buffer->id);
|
View *view = CreateView(buffer->id);
|
||||||
|
DebugViewID = view->id;
|
||||||
window->active_view = view->id;
|
window->active_view = view->id;
|
||||||
|
|
||||||
Window *titlebar = CreateTitlebar(window->id);
|
Window *titlebar = CreateTitlebar(window->id);
|
||||||
|
|||||||
Reference in New Issue
Block a user