fixed bug that was preventing command line file loading

master
Allen Webster 2016-09-09 13:29:40 -04:00
parent 602d41be70
commit ac8ef58e95
5 changed files with 15 additions and 13 deletions

View File

@ -396,7 +396,7 @@ make_string_slowly(void *str)
String result;
result.str = (char*)str;
result.size = str_size((char*)str);
result.memory_size = result.size;
result.memory_size = result.size+1;
return(result);
}
#endif

10
4ed.cpp
View File

@ -1991,13 +1991,13 @@ App_Step_Sig(app_step){
i32 i = 0;
Panel *panel = models->layout.used_sentinel.next;
for (; i < models->settings.init_files_count;
++i, panel = panel->next){
for (; i < models->settings.init_files_count; ++i, panel = panel->next){
String filename = make_string_slowly(models->settings.init_files[i]);
if (i < models->layout.panel_count){
view_open_file(system, models, panel->view, filename);
view_show_file(panel->view);
Assert("Earlier" && panel->view->file_data.file != 0);
#if 0
if (i == 0){
if (panel->view->file_data.file){
@ -2025,6 +2025,11 @@ App_Step_Sig(app_step){
view_set_file(panel->view, models->scratch_buffer, models);
view_show_file(panel->view);
}
panel = models->layout.used_sentinel.next;
for (i = 0; i < models->settings.init_files_count; ++i, panel = panel->next){
Assert(panel->view->file_data.file != 0);
}
}
// NOTE(allen): respond if the user is trying to kill the application
@ -2111,7 +2116,6 @@ App_Step_Sig(app_step){
#endif
// NOTE(allen): Keyboard input to command coroutine.
if (models->command_coroutine != 0){
Coroutine *command_coroutine = models->command_coroutine;
u32 get_flags = models->command_coroutine_flags[0];

View File

@ -5320,19 +5320,17 @@ do_render_file_view(System_Functions *system, View *view, GUI_Scroll_Vars *scrol
i32 result = 0;
GUI_Session gui_session = {0};
GUI_Header *h;
GUI_Header *h = 0;
GUI_Target *gui_target = &view->gui_target;
GUI_Interpret_Result interpret_result = {0};
f32 v = {0};
i32 max_y = view_compute_max_target_y(view);
i16 font_id = 0;
if (file){
font_id = file->settings.font_id;
}
Assert(file != 0);
font_id = file->settings.font_id;
if (gui_target->push.pos > 0){
gui_session_init(&gui_session, gui_target, rect, view->line_height);
@ -5361,7 +5359,7 @@ do_render_file_view(System_Functions *system, View *view, GUI_Scroll_Vars *scrol
case guicom_file:
{
if (file && file_is_ready(file)){
if (file_is_ready(file)){
result = draw_file_loaded(view, gui_session.rect, is_active, target);
}
}break;

View File

@ -87,6 +87,7 @@
; BEFORE I SHIP
;
; [X] why are command line files not loading any more?
; [X] tokens in the custom API
; [X] token seeking on custom side
; [X] auto indent on the custom side
@ -97,7 +98,6 @@
; [] expose dirty flags
; [] occasionally missing the (!) mark on files on windows
; [] scroll down on compilation buffer durring compilation
; [] why are command line files not loading any more?
;
;

View File

@ -197,7 +197,7 @@ treating that as the size and memory size of the string.) */{
String result;
result.str = (char*)str;
result.size = str_size((char*)str);
result.memory_size = result.size;
result.memory_size = result.size+1;
return(result);
}