From 5d1a0a50e99dff3d970ab459a88318dc8fd05030 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Thu, 31 Jan 2019 04:56:58 -0800 Subject: [PATCH] Never post edit notes for messages buffer --- 4coder_default_hooks.cpp | 2 +- 4ed_edit.cpp | 8 ++++---- 4ed_file.h | 3 +-- 4ed_file_lex.cpp | 8 ++++---- 4ed_working_set.cpp | 6 ++++-- 4ed_working_set.h | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/4coder_default_hooks.cpp b/4coder_default_hooks.cpp index d9ea20bd..5594bb64 100644 --- a/4coder_default_hooks.cpp +++ b/4coder_default_hooks.cpp @@ -754,7 +754,7 @@ OPEN_FILE_HOOK_SIG(default_file_edit){ Buffer_Summary buffer = get_buffer(app, buffer_id, AccessAll); Assert(buffer.exists); - if (buffer.buffer_name_len > 0 && buffer.buffer_name[0] != '*'){ + if (buffer.buffer_name[0] != '*'){ char space[256]; String str = make_fixed_width_string(space); append(&str, "edit finished: "); diff --git a/4ed_edit.cpp b/4ed_edit.cpp index 9f2668a4..d6469a29 100644 --- a/4ed_edit.cpp +++ b/4ed_edit.cpp @@ -247,7 +247,7 @@ edit_single__inner(System_Functions *system, Models *models, Editing_File *file, file_relex(system, models, file, start, end, shift_amount); } else{ - file_mark_edit_finished(&models->working_set, file); + file_mark_edit_finished(models, file); } // NOTE(allen): meta data @@ -366,7 +366,7 @@ edit_batch(System_Functions *system, Models *models, Editing_File *file, file_relex(system, models, file, first_edit->start, last_edit->end, shift_total); } else{ - file_mark_edit_finished(&models->working_set, file); + file_mark_edit_finished(models, file); } }break; @@ -398,7 +398,7 @@ edit_batch(System_Functions *system, Models *models, Editing_File *file, token->size += local_shift; shift_amount += local_shift; } - file_mark_edit_finished(&models->working_set, file); + file_mark_edit_finished(models, file); } }break; } @@ -422,7 +422,7 @@ edit_batch(System_Functions *system, Models *models, Editing_File *file, // NOTE(allen): cursor fixing Cursor_Fix_Descriptor desc = {}; - desc.is_batch = 1; + desc.is_batch = true; desc.batch = batch; desc.batch_size = batch_size; edit_fix_markers(system, models, file, layout, desc); diff --git a/4ed_file.h b/4ed_file.h index ff07ed19..16a23117 100644 --- a/4ed_file.h +++ b/4ed_file.h @@ -46,7 +46,6 @@ struct Editing_File_Settings{ i32 wrap_indicator; Parse_Context_ID parse_context_id; b32 dos_write_mode; - b32 virtual_white; Face_ID font_id; b8 unwrapped_lines; b8 tokens_exist; @@ -55,7 +54,7 @@ struct Editing_File_Settings{ b8 unimportant; b8 read_only; b8 never_kill; - u8 pad[1]; + b8 virtual_white; }; struct Editing_File_State{ diff --git a/4ed_file_lex.cpp b/4ed_file_lex.cpp index 6f7f7ead..c23fd157 100644 --- a/4ed_file_lex.cpp +++ b/4ed_file_lex.cpp @@ -135,7 +135,7 @@ job_full_lex(System_Functions *system, Thread_Context *thread, Thread_Memory *me } file->state.tokens_complete = true; file->state.still_lexing = false; - file_mark_edit_finished(&models->working_set, file); + file_mark_edit_finished(models, file); system->release_lock(FRAME_LOCK); } @@ -277,7 +277,7 @@ file_first_lex_serial(System_Functions *system, Models *models, Editing_File *fi end_temp_memory(temp); file->state.tokens_complete = true; - file_mark_edit_finished(&models->working_set, file); + file_mark_edit_finished(models, file); } } @@ -368,7 +368,7 @@ file_relex_parallel(System_Functions *system, Models *models, Editing_File *file } cpp_relex_complete(&state, array, &relex_array); - file_mark_edit_finished(&models->working_set, file); + file_mark_edit_finished(models, file); } else{ cpp_relex_abort(&state, array); @@ -487,7 +487,7 @@ file_relex_serial(System_Functions *system, Models *models, Editing_File *file, } cpp_relex_complete(&state, array, &relex_array); - file_mark_edit_finished(&models->working_set, file); + file_mark_edit_finished(models, file); end_temp_memory(temp); diff --git a/4ed_working_set.cpp b/4ed_working_set.cpp index 33d06407..696a2f2e 100644 --- a/4ed_working_set.cpp +++ b/4ed_working_set.cpp @@ -620,8 +620,10 @@ file_touch(Working_Set *working_set, Editing_File *file){ } internal void -file_mark_edit_finished(Working_Set *working_set, Editing_File *file){ - if (file->edit_finished_mark_node.next == 0){ +file_mark_edit_finished(Models *models, Editing_File *file){ + Editing_File *message_buffer = models->message_buffer; + if (file != message_buffer && file->edit_finished_mark_node.next == 0){ + Working_Set *working_set = &models->working_set; zdll_push_back(working_set->edit_finished_list.next, working_set->edit_finished_list.prev, &file->edit_finished_mark_node); diff --git a/4ed_working_set.h b/4ed_working_set.h index cb48641b..ee39bba6 100644 --- a/4ed_working_set.h +++ b/4ed_working_set.h @@ -54,7 +54,7 @@ struct File_Name_Entry{ }; internal void -file_mark_edit_finished(Working_Set *working_set, Editing_File *file); +file_mark_edit_finished(Models *models, Editing_File *file); #endif