1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | bool toggle_build_panel_expanded = false;
CUSTOM_COMMAND_SIG(toggle_build_panel)
CUSTOM_DOC("Toggles the build panel")
{
if (!toggle_build_panel_expanded)
{
View_Summary special_view = get_view(app, build_footer_panel_view_id, AccessAll);
view_set_split_proportion( app, &special_view, 0.18f );
}
else
{
View_Summary special_view = get_view(app, build_footer_panel_view_id, AccessAll);
view_set_split_proportion( app, &special_view, 0.001f );
}
toggle_build_panel_expanded = !toggle_build_panel_expanded;
}
CUSTOM_COMMAND_SIG(build_in_build_panel_expanded)
CUSTOM_DOC("Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.")
{
uint32_t access = AccessAll;
View_Summary view = get_active_view(app, access);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, access);
View_Summary build_view = get_or_open_build_panel(app);
view_set_split_proportion( app, &build_view, 0.18f );
toggle_build_panel_expanded = true;
execute_standard_build(app, &build_view, &buffer);
set_fancy_compilation_buffer_font(app);
memset(&prev_location, 0, sizeof(prev_location));
lock_jump_buffer(literal("*compilation*"));
}
|
1 | bind(context, '`', MDFR_ALT, toggle_build_panel); |