|
diff --git a/.vimrc b/.vimrc
|
|
|
1 |
set makeprg=make |
|
|
2 |
set errorformat=%f:%l:%c:\ %m |
|
|
3 |
|
|
|
4 |
let g:gdb_executable = 'bidi' |
|
|
5 |
let g:gdb_arguments = '-r examples/json.lua' |
|
|
6 |
|
|
|
7 |
nnoremap <leader>m :call LocalMake()<CR> |
|
|
8 |
nnoremap <leader>bm :execute '!make && gdb -ex "break main" -ex "run" --args ' . g:gdb_executable . ' ' . g:gdb_arguments<CR> |
|
|
9 |
nnoremap <leader>bl :execute '!make && gdb -ex "break ' . line('.') . '" -ex "run" --args ' . g:gdb_executable . ' ' . g:gdb_arguments<CR> |
|
|
10 |
|
|
|
11 |
function! LocalMake() |
|
|
12 |
silent make |
|
|
13 |
|
|
|
14 |
" Filter non valid errors out of quicklist. |
|
|
15 |
let qfl = getqflist() |
|
|
16 |
let filtered = filter(copy(qfl), {_, entry -> entry.valid == 1}) |
|
|
17 |
call setqflist(filtered, 'r') |
|
|
18 |
|
|
|
19 |
redraw! |
|
|
20 |
|
|
|
21 |
if len(filtered) > 0 |
|
|
22 |
copen |
|
|
23 |
else |
|
|
24 |
cclose |
|
|
25 |
endif |
|
|
26 |
endfunction |
|
|
27 |
|
|
|
28 |
" Hardcoded example |
|
|
29 |
" nnoremap <leader>bm :!gdb -ex "break main" -ex "run" --args bidi -r examples/json.lua<CR> |
|
|
30 |
" nnoremap <leader>bl :execute '!gdb -ex "break ' . line('.') . '" -ex "run" --args bidi -r examples/json.lua'<CR> |
|
diff --git a/main.c b/main.c
|
| ... |
| 120 |
double runtime = GetTime(); |
120 |
double runtime = GetTime(); |
| 121 |
int height = GetScreenHeight(); |
121 |
int height = GetScreenHeight(); |
| 122 |
|
122 |
|
| 123 |
DrawTextEx(ctx.font, TextFormat("dt: %f", delta), (Vector2){ 20, height - 80 }, 20, 0, RAYWHITE); |
123 |
DrawTextEx(ctx.font, TextFormat("fps: %d", fps), (Vector2){ 20, height - 80 }, 20, 0, RAYWHITE); |
| 124 |
DrawTextEx(ctx.font, TextFormat("run: %f", runtime), (Vector2){ 20, height - 60 }, 20, 0, RAYWHITE); |
124 |
DrawTextEx(ctx.font, TextFormat("run: %f", runtime), (Vector2){ 20, height - 60 }, 20, 0, RAYWHITE); |
| 125 |
DrawTextEx(ctx.font, TextFormat("fps: %d", fps), (Vector2){ 20, height - 40 }, 20, 0, RAYWHITE); |
125 |
DrawTextEx(ctx.font, TextFormat("dt: %f", delta), (Vector2){ 20, height - 40 }, 20, 0, RAYWHITE); |
| 126 |
|
126 |
|
| 127 |
return 0; |
127 |
return 0; |
| 128 |
} |
128 |
} |
| ... |
| 183 |
if (run_file) { |
183 |
if (run_file) { |
| 184 |
SetTraceLogLevel(debug_level); |
184 |
SetTraceLogLevel(debug_level); |
| 185 |
|
185 |
|
| 186 |
|
|
|
| 187 |
lua_State *L = luaL_newstate(); |
186 |
lua_State *L = luaL_newstate(); |
| 188 |
luaL_openlibs(L); |
187 |
luaL_openlibs(L); |
| 189 |
|
188 |
|
| ... |
| 209 |
return 1; |
208 |
return 1; |
| 210 |
} |
209 |
} |
| 211 |
|
210 |
|
| 212 |
UnloadFont(ctx.font); // Unload font from GPU memory (VRAM) |
211 |
UnloadFont(ctx.font); |
| 213 |
lua_close(L); |
212 |
lua_close(L); |
| 214 |
} |
213 |
} |
| 215 |
|
214 |
|
| ... |