From 06aec5df479530725635b8aa45ec88b8d5cde52b Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 7 Feb 2020 16:50:35 -0800 Subject: [PATCH] Lots of issues updated --- 4ed.cpp | 11 +- 4ed.h | 28 +- 4ed_api_implementation.cpp | 10 +- 4ed_system_api.cpp | 22 +- 4ed_working_set.cpp | 34 +- 4ed_working_set.h | 1 - custom/4coder_clipboard.cpp | 73 ++- custom/4coder_code_index.cpp | 43 +- custom/4coder_config.cpp | 7 +- custom/4coder_config.h | 2 + custom/4coder_default_framework.cpp | 24 +- custom/4coder_default_hooks.cpp | 19 +- custom/4coder_helper.cpp | 13 +- custom/generated/command_metadata.h | 492 ++++++++++---------- custom/generated/custom_api.cpp | 6 +- custom/generated/custom_api.h | 15 +- custom/generated/custom_api_constructor.cpp | 23 +- custom/generated/custom_api_master_list.h | 3 +- custom/generated/system_api.cpp | 6 + custom/generated/system_api.h | 109 +++-- custom/generated/system_api_constructor.cpp | 12 + custom/generated/system_api_master_list.h | 3 + docs/4ed_doc_custom_api_global.cpp | 4 +- platform_win32/win32_4ed.cpp | 196 ++++---- ship_files/changes.txt | 8 + ship_files/config.4coder | 1 + 26 files changed, 653 insertions(+), 512 deletions(-) diff --git a/4ed.cpp b/4ed.cpp index 78818d9c..563b05e0 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -260,13 +260,6 @@ App_Init_Sig(app_init){ models->working_set.clipboard_max_size = ArrayCount(models->working_set.clipboards); models->working_set.clipboard_size = 0; models->working_set.clipboard_current = 0; - models->working_set.clipboard_rolling = 0; - - // TODO(allen): do(better clipboard allocation) - if (clipboard.str != 0){ - String_Const_u8 *dest = working_set_next_clipboard_string(&models->heap, &models->working_set, clipboard.size); - block_copy(dest->str, clipboard.str, clipboard.size); - } // NOTE(allen): style setup { @@ -350,9 +343,7 @@ App_Step_Sig(app_step){ if (clipboard.str != 0){ String_Const_u8 *dest = working_set_next_clipboard_string(&models->heap, &models->working_set, clipboard.size); dest->size = eol_convert_in((char*)dest->str, (char*)clipboard.str, (i32)clipboard.size); - if (input->clipboard_changed){ - co_send_core_event(tctx, models, CoreCode_NewClipboardContents, *dest); - } + co_send_core_event(tctx, models, CoreCode_NewClipboardContents, *dest); } // NOTE(allen): reorganizing panels on screen diff --git a/4ed.h b/4ed.h index 705a11e2..412e8c0a 100644 --- a/4ed.h +++ b/4ed.h @@ -32,12 +32,12 @@ struct Plat_Settings{ #define App_Read_Command_Line_Sig(name) \ void *name(Thread_Context *tctx,\ -String_Const_u8 current_directory,\ -Plat_Settings *plat_settings,\ -char ***files, \ -i32 **file_count,\ -i32 argc, \ -char **argv) + String_Const_u8 current_directory,\ + Plat_Settings *plat_settings,\ + char ***files, \ + i32 **file_count,\ + i32 argc, \ + char **argv) typedef App_Read_Command_Line_Sig(App_Read_Command_Line); @@ -48,11 +48,10 @@ struct Custom_API{ #define App_Init_Sig(name) \ void name(Thread_Context *tctx, \ -Render_Target *target, \ -void *base_ptr, \ -String_Const_u8 clipboard,\ -String_Const_u8 current_directory,\ -Custom_API api) + Render_Target *target, \ + void *base_ptr, \ + String_Const_u8 current_directory,\ + Custom_API api) typedef App_Init_Sig(App_Init); @@ -73,15 +72,14 @@ struct Application_Step_Input{ Mouse_State mouse; Input_List events; String_Const_u8 clipboard; - b32 clipboard_changed; b32 trying_to_kill; }; #define App_Step_Sig(name) Application_Step_Result \ name(Thread_Context *tctx, \ -Render_Target *target, \ -void *base_ptr, \ -Application_Step_Input *input) + Render_Target *target, \ + void *base_ptr, \ + Application_Step_Input *input) typedef App_Step_Sig(App_Step); diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index 0cb727be..3d26c5d8 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -207,12 +207,18 @@ child_process_get_state(Application_Links *app, Child_Process_ID child_process_i } api(custom) function b32 -clipboard_post(Application_Links *app, i32 clipboard_id, String_Const_u8 string) +clipboard_clear(Application_Links *app, i32 clipboard_id){ + Models *models = (Models*)app->cmd_context; + working_set_clipboard_clear(&models->heap, &models->working_set); + return(true); +} + +api(custom) function b32 +clipboard_post_internal_only(Application_Links *app, i32 clipboard_id, String_Const_u8 string) { Models *models = (Models*)app->cmd_context; String_Const_u8 *dest = working_set_next_clipboard_string(&models->heap, &models->working_set, (i32)string.size); block_copy(dest->str, string.str, string.size); - system_post_clipboard(*dest); return(true); } diff --git a/4ed_system_api.cpp b/4ed_system_api.cpp index 2a98bb8d..83ed621b 100644 --- a/4ed_system_api.cpp +++ b/4ed_system_api.cpp @@ -117,11 +117,23 @@ define_api(Arena *arena){ api_param(arena, call, "u64", "microseconds"); } + { + API_Call *call = api_call(arena, api, "get_clipboard", "String_Const_u8"); + api_param(arena, call, "Arena*", "arena"); + } { API_Call *call = api_call(arena, api, "post_clipboard", "void"); api_param(arena, call, "String_Const_u8", "str"); } + { + API_Call *call = api_call(arena, api, "set_clipboard_catch_all", "void"); + api_param(arena, call, "b32", "enabled"); + } + { + api_call(arena, api, "get_clipboard_catch_all", "b32"); + } + { API_Call *call = api_call(arena, api, "cli_call", "b32"); api_param(arena, call, "Arena*", "scratch"); @@ -174,7 +186,7 @@ define_api(Arena *arena){ } { -api_call(arena, api, "thread_get_id", "i32"); + api_call(arena, api, "thread_get_id", "i32"); } { @@ -188,7 +200,7 @@ api_call(arena, api, "thread_get_id", "i32"); } { -api_call(arena, api, "mutex_make", "System_Mutex"); + api_call(arena, api, "mutex_make", "System_Mutex"); } { @@ -207,8 +219,8 @@ api_call(arena, api, "mutex_make", "System_Mutex"); } { -api_call(arena, api, "condition_variable_make", - "System_Condition_Variable"); + api_call(arena, api, "condition_variable_make", + "System_Condition_Variable"); } { @@ -262,7 +274,7 @@ api_call(arena, api, "condition_variable_make", } { -api_call(arena, api, "is_fullscreen", "b32"); + api_call(arena, api, "is_fullscreen", "b32"); } { diff --git a/4ed_working_set.cpp b/4ed_working_set.cpp index 7077007e..21513eb9 100644 --- a/4ed_working_set.cpp +++ b/4ed_working_set.cpp @@ -207,6 +207,17 @@ get_file_from_identifier(Working_Set *working_set, Buffer_Identifier buffer){ //////////////////////////////// // TODO(allen): Bring the clipboard fully to the custom side. +internal void +working_set_clipboard_clear(Heap *heap, Working_Set *working){ + String_Const_u8 *str = working->clipboards; + for (i32 i = 0; i < working->clipboard_size; i += 1, str += 1){ + heap_free(heap, str->str); + block_zero_struct(str); + } + working->clipboard_size = 0; + working->clipboard_current = 0; +} + internal String_Const_u8* working_set_next_clipboard_string(Heap *heap, Working_Set *working, u64 str_size){ i32 clipboard_current = working->clipboard_current; @@ -225,7 +236,6 @@ working_set_next_clipboard_string(Heap *heap, Working_Set *working, u64 str_size } String_Const_u8 *result = &working->clipboards[clipboard_current]; working->clipboard_current = clipboard_current; - working->clipboard_rolling = clipboard_current; if (result->str != 0){ heap_free(heap, result->str); } @@ -248,28 +258,6 @@ working_set_clipboard_index(Working_Set *working, i32 index){ return(result); } -internal String_Const_u8* -working_set_clipboard_head(Working_Set *working){ - String_Const_u8 *result = 0; - if (working->clipboard_size > 0){ - working->clipboard_rolling = 0; - result = working_set_clipboard_index(working, working->clipboard_rolling); - } - return(result); -} - -internal String_Const_u8* -working_set_clipboard_roll_down(Working_Set *working){ - String_Const_u8 *result = 0; - if (working->clipboard_size > 0){ - i32 clipboard_index = working->clipboard_rolling; - ++clipboard_index; - working->clipboard_rolling = clipboard_index; - result = working_set_clipboard_index(working, working->clipboard_rolling); - } - return(result); -} - //////////////////////////////// // TODO(allen): get rid of this??? diff --git a/4ed_working_set.h b/4ed_working_set.h index 3e213b2d..9f73ac3c 100644 --- a/4ed_working_set.h +++ b/4ed_working_set.h @@ -42,7 +42,6 @@ struct Working_Set{ i32 clipboard_size; i32 clipboard_max_size; i32 clipboard_current; - i32 clipboard_rolling; }; #endif diff --git a/custom/4coder_clipboard.cpp b/custom/4coder_clipboard.cpp index 8b562253..76ac3eb6 100644 --- a/custom/4coder_clipboard.cpp +++ b/custom/4coder_clipboard.cpp @@ -16,6 +16,64 @@ clipboard_post_buffer_range(Application_Links *app, i32 clipboard_index, Buffer_ return(success); } +function void +clipboard_update_history_from_system(Application_Links *app, i32 clipboard_id){ + Scratch_Block scratch(app); + String_Const_u8 string = system_get_clipboard(scratch); + if (string.str != 0){ + clipboard_post_internal_only(app, clipboard_id, string); + } +} + +function void +clipboard_collection_render(Application_Links *app, Frame_Info frame_info, View_ID view){ + Scratch_Block scratch(app); + Rect_f32 region = draw_background_and_margin(app, view); + Vec2_f32 mid_p = (region.p1 + region.p0)*0.5f; + + Fancy_Line message = {}; + push_fancy_string(scratch, &message, fcolor_id(defcolor_pop2), + string_u8_litexpr("Collecting all clipboard events ")); + push_fancy_string(scratch, &message, fcolor_id(defcolor_pop1), + string_u8_litexpr("press [escape] to stop")); + + Face_ID face_id = get_face_id(app, 0); + + Vec2_f32 dim = get_fancy_line_dim(app, face_id, &message); + Vec2_f32 half_dim = dim*0.5f; + + draw_fancy_line(app, face_id, fcolor_zero(), &message, mid_p - half_dim); +} + +CUSTOM_UI_COMMAND_SIG(begin_clipboard_collection_mode) +CUSTOM_DOC("Allows the user to copy multiple strings from other applications before switching to 4coder and pasting them all.") +{ + local_persist b32 in_clipboard_collection_mode = false; + if (!in_clipboard_collection_mode){ + in_clipboard_collection_mode = true; + system_set_clipboard_catch_all(true); + + View_ID view = get_this_ctx_view(app, Access_Always); + View_Context ctx = view_current_context(app, view); + ctx.render_caller = clipboard_collection_render; + ctx.hides_buffer = true; + View_Context_Block ctx_block(app, view, &ctx); + + for (;;){ + User_Input in = get_next_input(app, EventPropertyGroup_Any, EventProperty_Escape); + if (in.abort){ + break; + } + if (in.event.kind == InputEventKind_KeyStroke && in.event.key.code == KeyCode_Escape){ + break; + } + } + + system_set_clipboard_catch_all(false); + in_clipboard_collection_mode = false; + } +} + CUSTOM_COMMAND_SIG(copy) CUSTOM_DOC("Copy the text in the range from the cursor to the mark onto the clipboard.") { @@ -39,6 +97,7 @@ CUSTOM_DOC("Cut the text in the range from the cursor to the mark onto the clipb CUSTOM_COMMAND_SIG(paste) CUSTOM_DOC("At the cursor, insert the text at the top of the clipboard.") { + clipboard_update_history_from_system(app, 0); i32 count = clipboard_count(app, 0); if (count > 0){ View_ID view = get_active_view(app, Access_ReadWriteVisible); @@ -124,6 +183,12 @@ CUSTOM_DOC("Paste the next item on the clipboard and run auto-indent on the newl auto_indent_range(app); } +CUSTOM_COMMAND_SIG(clear_clipboard) +CUSTOM_DOC("Clears the history of the clipboard") +{ + clipboard_clear(app, 0); +} + //////////////////////////////// CUSTOM_COMMAND_SIG(multi_paste){ @@ -266,14 +331,18 @@ multi_paste_interactive_up_down(Application_Links *app, i32 paste_count, i32 cli } } -CUSTOM_COMMAND_SIG(multi_paste_interactive){ +CUSTOM_COMMAND_SIG(multi_paste_interactive) +CUSTOM_DOC("Paste multiple lines from the clipboard history, controlled with arrow keys") +{ i32 clip_count = clipboard_count(app, 0); if (clip_count > 0){ multi_paste_interactive_up_down(app, 1, clip_count); } } -CUSTOM_COMMAND_SIG(multi_paste_interactive_quick){ +CUSTOM_COMMAND_SIG(multi_paste_interactive_quick) +CUSTOM_DOC("Paste multiple lines from the clipboard history, controlled by inputing the number of lines to paste") +{ i32 clip_count = clipboard_count(app, 0); if (clip_count > 0){ u8 string_space[256]; diff --git a/custom/4coder_code_index.cpp b/custom/4coder_code_index.cpp index bf8f208e..560c1167 100644 --- a/custom/4coder_code_index.cpp +++ b/custom/4coder_code_index.cpp @@ -793,26 +793,26 @@ layout_token_pair(Token_Array *tokens, i64 pos){ } function f32 -layout_index_x_shift(Application_Links *app, Layout_Reflex *reflex, Code_Index_Nest *nest, i64 pos, f32 space_advance, b32 *unresolved_dependence){ +layout_index_x_shift(Application_Links *app, Layout_Reflex *reflex, Code_Index_Nest *nest, i64 pos, f32 regular_indent, b32 *unresolved_dependence){ f32 result = 0.f; if (nest != 0){ switch (nest->kind){ case CodeIndexNest_Scope: case CodeIndexNest_Preprocessor: { - result = layout_index_x_shift(app, reflex, nest->parent, pos, space_advance, unresolved_dependence); + result = layout_index_x_shift(app, reflex, nest->parent, pos, regular_indent, unresolved_dependence); if (nest->open.min < pos && nest->open.max <= pos && (!nest->is_closed || pos < nest->close.min)){ - result += 4.f*space_advance; + result += regular_indent; } }break; case CodeIndexNest_Statement: { - result = layout_index_x_shift(app, reflex, nest->parent, pos, space_advance, unresolved_dependence); + result = layout_index_x_shift(app, reflex, nest->parent, pos, regular_indent, unresolved_dependence); if (nest->open.min < pos && nest->open.max <= pos && (!nest->is_closed || pos < nest->close.min)){ - result += 4.f*space_advance; + result += regular_indent; } }break; @@ -827,25 +827,25 @@ layout_index_x_shift(Application_Links *app, Layout_Reflex *reflex, Code_Index_N } function f32 -layout_index_x_shift(Application_Links *app, Layout_Reflex *reflex, Code_Index_Nest *nest, i64 pos, f32 space_advance){ +layout_index_x_shift(Application_Links *app, Layout_Reflex *reflex, Code_Index_Nest *nest, i64 pos, f32 regular_indent){ b32 ignore; - return(layout_index_x_shift(app, reflex, nest, pos, space_advance, &ignore)); + return(layout_index_x_shift(app, reflex, nest, pos, regular_indent, &ignore)); } function f32 -layout_index_x_shift(Application_Links *app, Layout_Reflex *reflex, Code_Index_File *file, i64 pos, f32 space_advance, b32 *unresolved_dependence){ +layout_index_x_shift(Application_Links *app, Layout_Reflex *reflex, Code_Index_File *file, i64 pos, f32 regular_indent, b32 *unresolved_dependence){ f32 indent = 0; Code_Index_Nest *nest = code_index_get_nest(file, pos); if (nest != 0){ - indent = layout_index_x_shift(app, reflex, nest, pos, space_advance, unresolved_dependence); + indent = layout_index_x_shift(app, reflex, nest, pos, regular_indent, unresolved_dependence); } return(indent); } function f32 -layout_index_x_shift(Application_Links *app, Layout_Reflex *reflex, Code_Index_File *file, i64 pos, f32 space_advance){ +layout_index_x_shift(Application_Links *app, Layout_Reflex *reflex, Code_Index_File *file, i64 pos, f32 regular_indent){ b32 ignore; - return(layout_index_x_shift(app, reflex, file, pos, space_advance, &ignore)); + return(layout_index_x_shift(app, reflex, file, pos, regular_indent, &ignore)); } function void @@ -860,7 +860,7 @@ layout_index__emit_chunk(LefRig_TopBot_Layout_Vars *pos_vars, Face_ID face, Aren else{ lr_tb_write_byte(pos_vars, face, arena, list, index, *ptr); } - } + } ptr += consume.inc; } } @@ -891,6 +891,7 @@ layout_index__inner(Application_Links *app, Arena *arena, Buffer_ID buffer, Rang Face_Metrics metrics = get_face_metrics(app, face); LefRig_TopBot_Layout_Vars pos_vars = get_lr_tb_layout_vars(&advance_map, &metrics, width); + f32 regular_indent = metrics.space_advance*global_config.virtual_whitespace_regular_indent; f32 wrap_align_x = width - metrics.normal_advance; Layout_Reflex reflex = get_layout_reflex(&list, buffer, width, face); @@ -915,14 +916,14 @@ layout_index__inner(Application_Links *app, Arena *arena, Buffer_ID buffer, Rang start: if (ptr == end_ptr){ i64 index = layout_index_from_ptr(ptr, text.str, range.first); - f32 shift = layout_index_x_shift(app, &reflex, file, index, metrics.space_advance); + f32 shift = layout_index_x_shift(app, &reflex, file, index, regular_indent); lr_tb_advance_x_without_item(&pos_vars, shift); goto finish; } if (!character_is_whitespace(*ptr)){ i64 index = layout_index_from_ptr(ptr, text.str, range.first); - f32 shift = layout_index_x_shift(app, &reflex, file, index, metrics.space_advance); + f32 shift = layout_index_x_shift(app, &reflex, file, index, regular_indent); lr_tb_advance_x_without_item(&pos_vars, shift); goto consuming_non_whitespace; } @@ -933,7 +934,7 @@ layout_index__inner(Application_Links *app, Arena *arena, Buffer_ID buffer, Rang pending_wrap_ptr = ptr; word_ptr = ptr; i64 index = layout_index_from_ptr(ptr, text.str, range.first); - f32 shift = layout_index_x_shift(app, &reflex, file, index, metrics.space_advance); + f32 shift = layout_index_x_shift(app, &reflex, file, index, regular_indent); lr_tb_advance_x_without_item(&pos_vars, shift); goto consuming_non_whitespace; } @@ -944,7 +945,7 @@ layout_index__inner(Application_Links *app, Arena *arena, Buffer_ID buffer, Rang else if (*ptr == '\n'){ pending_wrap_ptr = ptr; i64 index = layout_index_from_ptr(ptr, text.str, range.first); - f32 shift = layout_index_x_shift(app, &reflex, file, index, metrics.space_advance); + f32 shift = layout_index_x_shift(app, &reflex, file, index, regular_indent); lr_tb_advance_x_without_item(&pos_vars, shift); goto consuming_normal_whitespace; } @@ -953,7 +954,7 @@ layout_index__inner(Application_Links *app, Arena *arena, Buffer_ID buffer, Rang if (ptr == end_ptr){ pending_wrap_ptr = ptr; i64 index = layout_index_from_ptr(ptr - 1, text.str, range.first); - f32 shift = layout_index_x_shift(app, &reflex, file, index, metrics.space_advance); + f32 shift = layout_index_x_shift(app, &reflex, file, index, regular_indent); lr_tb_advance_x_without_item(&pos_vars, shift); goto finish; } @@ -994,7 +995,7 @@ layout_index__inner(Application_Links *app, Arena *arena, Buffer_ID buffer, Rang lr_tb_next_line(&pos_vars); #if 0 - f32 shift = layout_index_x_shift(app, &reflex, file, index, metrics.space_advance); + f32 shift = layout_index_x_shift(app, &reflex, file, index, regular_indent); lr_tb_advance_x_without_item(&pos_vars, shift); #endif @@ -1013,7 +1014,7 @@ layout_index__inner(Application_Links *app, Arena *arena, Buffer_ID buffer, Rang i64 index = layout_index_from_ptr(new_wrap_ptr, text.str, range.first); Code_Index_Nest *new_wrap_nest = code_index_get_nest(file, index); b32 invalid_wrap_x = false; - f32 new_wrap_x = layout_index_x_shift(app, &reflex, new_wrap_nest, index, metrics.space_advance, &invalid_wrap_x); + f32 new_wrap_x = layout_index_x_shift(app, &reflex, new_wrap_nest, index, regular_indent, &invalid_wrap_x); if (invalid_wrap_x){ new_wrap_x = max_f32; } @@ -1079,7 +1080,7 @@ layout_index__inner(Application_Links *app, Arena *arena, Buffer_ID buffer, Rang pending_wrap_ptr = new_wrap_ptr; pending_wrap_paren_nest_count = new_wrap_paren_nest_count; - pending_wrap_x = layout_index_x_shift(app, &reflex, new_wrap_nest, index, metrics.space_advance); + pending_wrap_x = layout_index_x_shift(app, &reflex, new_wrap_nest, index, regular_indent); pending_wrap_paren_nest_count = new_wrap_paren_nest_count; pending_wrap_token_score = new_wrap_token_score; pending_wrap_accumulated_w = 0.f; @@ -1172,7 +1173,7 @@ layout_virt_indent_index_generic(Application_Links *app, Arena *arena, Buffer_ID } CUSTOM_COMMAND_SIG(toggle_virtual_whitespace) -CUSTOM_DOC("Toggles the current buffer's virtual whitespace status.") +CUSTOM_DOC("Toggles virtual whitespace for all files.") { global_config.enable_virtual_whitespace = !global_config.enable_virtual_whitespace; diff --git a/custom/4coder_config.cpp b/custom/4coder_config.cpp index 753b09d6..67a47569 100644 --- a/custom/4coder_config.cpp +++ b/custom/4coder_config.cpp @@ -1143,7 +1143,7 @@ function i32 typed_array_get_count(Config *parsed, Config_Compound *compound, Config_RValue_Type type){ i32 count = 0; for (i32 i = 0;; ++i){ - Config_Iteration_Step_Result result = typed_array_iteration_step(parsed, compound, type, i); + Config_Iteration_Step_Result result = typed_array_iteration_step(parsed, compound, type, i); if (result.step == Iteration_Skip){ continue; } @@ -1242,6 +1242,8 @@ config_init_default(Config_Data *config){ config->automatically_save_changes_on_build = true; config->automatically_load_project = false; + config->virtual_whitespace_regular_indent = 4; + config->indent_with_tabs = false; config->indent_width = 4; @@ -1307,6 +1309,8 @@ config_parse__data(Application_Links *app, Arena *arena, String_Const_u8 file_na config_bool_var(parsed, "automatically_save_changes_on_build", 0, &config->automatically_save_changes_on_build); config_bool_var(parsed, "automatically_load_project", 0, &config->automatically_load_project); + config_int_var(parsed, "virtual_whitespace_regular_indent", 0, &config->virtual_whitespace_regular_indent); + config_bool_var(parsed, "indent_with_tabs", 0, &config->indent_with_tabs); config_int_var(parsed, "indent_width", 0, &config->indent_width); @@ -1550,6 +1554,7 @@ load_config_and_apply(Application_Links *app, Arena *out_arena, Config_Data *con config_feedback_bool(scratch, &list, "show_line_number_margins", config->show_line_number_margins); config_feedback_bool(scratch, &list, "enable_virtual_whitespace", config->enable_virtual_whitespace); + config_feedback_int(scratch, &list, "virtual_whitespace_regular_indent", config->virtual_whitespace_regular_indent); config_feedback_bool(scratch, &list, "enable_code_wrapping", config->enable_code_wrapping); config_feedback_bool(scratch, &list, "automatically_indent_text_on_save", config->automatically_indent_text_on_save); config_feedback_bool(scratch, &list, "automatically_save_changes_on_build", config->automatically_save_changes_on_build); diff --git a/custom/4coder_config.h b/custom/4coder_config.h index a418b4dd..9ce7b76b 100644 --- a/custom/4coder_config.h +++ b/custom/4coder_config.h @@ -208,6 +208,8 @@ struct Config_Data{ b8 automatically_save_changes_on_build; b8 automatically_load_project; + i32 virtual_whitespace_regular_indent; + b8 indent_with_tabs; i32 indent_width; diff --git a/custom/4coder_default_framework.cpp b/custom/4coder_default_framework.cpp index 07e019f4..5ade128a 100644 --- a/custom/4coder_default_framework.cpp +++ b/custom/4coder_default_framework.cpp @@ -500,18 +500,18 @@ default_4coder_initialize(Application_Links *app, String_Const_u8_Array file_nam heap_init(&global_heap, tctx->allocator); #define M \ -"Welcome to " VERSION "\n" \ -"If you're new to 4coder there is a built in tutorial\n" \ -"Use the key combination [ X Alt ] (on mac [ X Control ])\n" \ -"Type in 'hms_demo_tutorial' and press enter\n" \ -"\n" \ -"Direct bug reports and feature requests to https://github.com/4coder-editor/4coder/issues\n" \ -"\n" \ -"Other questions and discussion can be directed to editor@4coder.net or 4coder.handmade.network\n" \ -"\n" \ -"The change log can be found in CHANGES.txt\n" \ -"\n" - print_message(app, string_u8_litexpr(M)); + "Welcome to " VERSION "\n" \ + "If you're new to 4coder there is a built in tutorial\n" \ + "Use the key combination [ X Alt ] (on mac [ X Control ])\n" \ + "Type in 'hms_demo_tutorial' and press enter\n" \ + "\n" \ + "Direct bug reports and feature requests to https://github.com/4coder-editor/4coder/issues\n" \ + "\n" \ + "Other questions and discussion can be directed to editor@4coder.net or 4coder.handmade.network\n" \ + "\n" \ + "The change log can be found in CHANGES.txt\n" \ + "\n" + print_message(app, string_u8_litexpr(M)); #undef M #if 0 diff --git a/custom/4coder_default_hooks.cpp b/custom/4coder_default_hooks.cpp index 607cc33b..a5d9f36c 100644 --- a/custom/4coder_default_hooks.cpp +++ b/custom/4coder_default_hooks.cpp @@ -892,11 +892,9 @@ BUFFER_HOOK_SIG(default_begin_buffer){ // NOTE(allen): Decide buffer settings b32 wrap_lines = true; - b32 use_virtual_whitespace = false; b32 use_lexer = false; if (treat_as_code){ wrap_lines = global_config.enable_code_wrapping; - use_virtual_whitespace = global_config.enable_virtual_whitespace; use_lexer = true; } @@ -916,16 +914,16 @@ BUFFER_HOOK_SIG(default_begin_buffer){ *wrap_lines_ptr = wrap_lines; } - if (use_virtual_whitespace){ - if (use_lexer){ - buffer_set_layout(app, buffer_id, layout_virt_indent_index_generic); - } - else{ - buffer_set_layout(app, buffer_id, layout_virt_indent_literal_generic); - } + if (use_lexer){ + buffer_set_layout(app, buffer_id, layout_virt_indent_index_generic); } else{ - buffer_set_layout(app, buffer_id, layout_generic); + if (treat_as_code){ + buffer_set_layout(app, buffer_id, layout_virt_indent_literal_generic); + } + else{ + buffer_set_layout(app, buffer_id, layout_generic); + } } // no meaning for return @@ -980,6 +978,7 @@ BUFFER_HOOK_SIG(default_new_file){ BUFFER_HOOK_SIG(default_file_save){ // buffer_id ProfileScope(app, "default file save"); + b32 is_virtual = global_config.enable_virtual_whitespace; if (global_config.automatically_indent_text_on_save && is_virtual){ auto_indent_buffer(app, buffer_id, buffer_range(app, buffer_id)); diff --git a/custom/4coder_helper.cpp b/custom/4coder_helper.cpp index 1213c417..e259dff9 100644 --- a/custom/4coder_helper.cpp +++ b/custom/4coder_helper.cpp @@ -1200,8 +1200,6 @@ get_indent_info_range(Application_Links *app, Buffer_ID buffer, Range_i64 range, Scratch_Block scratch(app); String_Const_u8 s = push_buffer_range(app, scratch, buffer, range); - i32 tab_additional_width = tab_width - 1; - Indent_Info info = {}; info.first_char_pos = range.end; info.is_blank = true; @@ -1222,7 +1220,7 @@ get_indent_info_range(Application_Links *app, Buffer_ID buffer, Range_i64 range, info.all_space = false; } if (c == '\t'){ - info.indent_pos += tab_additional_width; + info.indent_pos += tab_width; } } @@ -2407,6 +2405,15 @@ get_command_metadata(Custom_Command_Function *func){ //////////////////////////////// +function b32 +clipboard_post(Application_Links *app, i32 clipboard_id, String_Const_u8 string){ + clipboard_post_internal_only(app, clipboard_id, string); + system_post_clipboard(string); + return(true); +} + +//////////////////////////////// + // TODO(allen): REWRITE THIS EXACTLY HOW YOU WANT IT --- start --- internal Child_Process_Set_Target_Flags diff --git a/custom/generated/command_metadata.h b/custom/generated/command_metadata.h index 9c6edbd9..e96cb870 100644 --- a/custom/generated/command_metadata.h +++ b/custom/generated/command_metadata.h @@ -2,7 +2,7 @@ #define command_id(c) (fcoder_metacmd_ID_##c) #define command_metadata(c) (&fcoder_metacmd_table[command_id(c)]) #define command_metadata_by_id(id) (&fcoder_metacmd_table[id]) -#define command_one_past_last_id 231 +#define command_one_past_last_id 235 #if defined(CUSTOM_COMMAND_SIG) #define PROC_LINKS(x,y) x #else @@ -16,6 +16,7 @@ CUSTOM_COMMAND_SIG(auto_indent_whole_file); CUSTOM_COMMAND_SIG(backspace_alpha_numeric_boundary); CUSTOM_COMMAND_SIG(backspace_char); CUSTOM_COMMAND_SIG(basic_change_active_panel); +CUSTOM_COMMAND_SIG(begin_clipboard_collection_mode); CUSTOM_COMMAND_SIG(build_in_build_panel); CUSTOM_COMMAND_SIG(build_search); CUSTOM_COMMAND_SIG(center_view); @@ -24,6 +25,7 @@ CUSTOM_COMMAND_SIG(change_active_panel_backwards); CUSTOM_COMMAND_SIG(change_to_build_panel); CUSTOM_COMMAND_SIG(clean_all_lines); CUSTOM_COMMAND_SIG(clear_all_themes); +CUSTOM_COMMAND_SIG(clear_clipboard); CUSTOM_COMMAND_SIG(click_set_cursor); CUSTOM_COMMAND_SIG(click_set_cursor_and_mark); CUSTOM_COMMAND_SIG(click_set_cursor_if_lbutton); @@ -136,6 +138,8 @@ CUSTOM_COMMAND_SIG(move_up_10); CUSTOM_COMMAND_SIG(move_up_to_blank_line); CUSTOM_COMMAND_SIG(move_up_to_blank_line_end); CUSTOM_COMMAND_SIG(move_up_to_blank_line_skip_whitespace); +CUSTOM_COMMAND_SIG(multi_paste_interactive); +CUSTOM_COMMAND_SIG(multi_paste_interactive_quick); CUSTOM_COMMAND_SIG(open_all_code); CUSTOM_COMMAND_SIG(open_all_code_recursive); CUSTOM_COMMAND_SIG(open_file_in_quotes); @@ -252,7 +256,7 @@ char *source_name; i32 source_name_len; i32 line_number; }; -static Command_Metadata fcoder_metacmd_table[231] = { +static Command_Metadata fcoder_metacmd_table[235] = { { PROC_LINKS(allow_mouse, 0), false, "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 409 }, { PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 407 }, { PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 417 }, @@ -260,6 +264,7 @@ static Command_Metadata fcoder_metacmd_table[231] = { { PROC_LINKS(backspace_alpha_numeric_boundary, 0), false, "backspace_alpha_numeric_boundary", 32, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 165 }, { PROC_LINKS(backspace_char, 0), false, "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 96 }, { PROC_LINKS(basic_change_active_panel, 0), false, "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 651 }, +{ PROC_LINKS(begin_clipboard_collection_mode, 0), true, "begin_clipboard_collection_mode", 31, "Allows the user to copy multiple strings from other applications before switching to 4coder and pasting them all.", 113, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 48 }, { PROC_LINKS(build_in_build_panel, 0), false, "build_in_build_panel", 20, "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.", 230, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 159 }, { PROC_LINKS(build_search, 0), false, "build_search", 12, "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*.", 153, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 122 }, { PROC_LINKS(center_view, 0), false, "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 208 }, @@ -268,6 +273,7 @@ static Command_Metadata fcoder_metacmd_table[231] = { { PROC_LINKS(change_to_build_panel, 0), false, "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 180 }, { PROC_LINKS(clean_all_lines, 0), false, "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 587 }, { PROC_LINKS(clear_all_themes, 0), false, "clear_all_themes", 16, "Clear the theme list", 20, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 480 }, +{ PROC_LINKS(clear_clipboard, 0), false, "clear_clipboard", 15, "Clears the history of the clipboard", 35, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 186 }, { PROC_LINKS(click_set_cursor, 0), false, "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 244 }, { PROC_LINKS(click_set_cursor_and_mark, 0), false, "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 234 }, { PROC_LINKS(click_set_cursor_if_lbutton, 0), false, "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 254 }, @@ -279,10 +285,10 @@ static Command_Metadata fcoder_metacmd_table[231] = { { PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 761 }, { PROC_LINKS(comment_line, 0), false, "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 125 }, { PROC_LINKS(comment_line_toggle, 0), false, "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 149 }, -{ PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 19 }, +{ PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 77 }, { PROC_LINKS(cursor_mark_swap, 0), false, "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 135 }, { PROC_LINKS(custom_api_documentation, 0), true, "custom_api_documentation", 24, "Prompts the user to select a Custom API item then loads a doc buffer for that item", 82, "w:\\4ed\\code\\custom\\4coder_docs.cpp", 34, 175 }, -{ PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 28 }, +{ PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 86 }, { PROC_LINKS(decrease_face_size, 0), false, "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 722 }, { PROC_LINKS(default_file_externally_modified, 0), false, "default_file_externally_modified", 32, "Notes the external modification of attached files by printing a message.", 72, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1833 }, { PROC_LINKS(default_startup, 0), false, "default_startup", 15, "Default command for responding to a startup event", 49, "w:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 7 }, @@ -298,8 +304,8 @@ static Command_Metadata fcoder_metacmd_table[231] = { { PROC_LINKS(execute_any_cli, 0), false, "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "w:\\4ed\\code\\custom\\4coder_cli_command.cpp", 41, 22 }, { PROC_LINKS(execute_previous_cli, 0), false, "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "w:\\4ed\\code\\custom\\4coder_cli_command.cpp", 41, 7 }, { PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 778 }, -{ PROC_LINKS(goto_beginning_of_file, 0), false, "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2187 }, -{ PROC_LINKS(goto_end_of_file, 0), false, "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2195 }, +{ PROC_LINKS(goto_beginning_of_file, 0), false, "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2185 }, +{ PROC_LINKS(goto_end_of_file, 0), false, "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2193 }, { PROC_LINKS(goto_first_jump, 0), false, "goto_first_jump", 15, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 525 }, { PROC_LINKS(goto_first_jump_same_panel_sticky, 0), false, "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 542 }, { PROC_LINKS(goto_jump_at_cursor, 0), false, "goto_jump_at_cursor", 19, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 348 }, @@ -343,7 +349,7 @@ static Command_Metadata fcoder_metacmd_table[231] = { { PROC_LINKS(list_all_substring_locations, 0), false, "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "w:\\4ed\\code\\custom\\4coder_search.cpp", 36, 171 }, { PROC_LINKS(list_all_substring_locations_case_insensitive, 0), false, "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "w:\\4ed\\code\\custom\\4coder_search.cpp", 36, 183 }, { PROC_LINKS(load_project, 0), false, "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 862 }, -{ PROC_LINKS(load_theme_current_buffer, 0), false, "load_theme_current_buffer", 25, "Parse the current buffer as a theme file and add the theme to the theme list. If the buffer has a .4coder postfix in it's name, it is removed when the name is saved.", 165, "w:\\4ed\\code\\custom\\4coder_config.cpp", 36, 1622 }, +{ PROC_LINKS(load_theme_current_buffer, 0), false, "load_theme_current_buffer", 25, "Parse the current buffer as a theme file and add the theme to the theme list. If the buffer has a .4coder postfix in it's name, it is removed when the name is saved.", 165, "w:\\4ed\\code\\custom\\4coder_config.cpp", 36, 1627 }, { PROC_LINKS(load_themes_default_folder, 0), false, "load_themes_default_folder", 26, "Loads all the theme files in the default theme folder.", 54, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 457 }, { PROC_LINKS(load_themes_hot_directory, 0), false, "load_themes_hot_directory", 25, "Loads all the theme files in the current hot directory.", 55, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 469 }, { PROC_LINKS(make_directory_query, 0), false, "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1371 }, @@ -380,6 +386,8 @@ static Command_Metadata fcoder_metacmd_table[231] = { { PROC_LINKS(move_up_to_blank_line, 0), false, "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 412 }, { PROC_LINKS(move_up_to_blank_line_end, 0), false, "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 436 }, { PROC_LINKS(move_up_to_blank_line_skip_whitespace, 0), false, "move_up_to_blank_line_skip_whitespace", 37, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 424 }, +{ PROC_LINKS(multi_paste_interactive, 0), false, "multi_paste_interactive", 23, "Paste multiple lines from the clipboard history, controlled with arrow keys", 75, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 334 }, +{ PROC_LINKS(multi_paste_interactive_quick, 0), false, "multi_paste_interactive_quick", 29, "Paste multiple lines from the clipboard history, controlled by inputing the number of lines to paste", 100, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 343 }, { PROC_LINKS(open_all_code, 0), false, "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 848 }, { PROC_LINKS(open_all_code_recursive, 0), false, "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 854 }, { PROC_LINKS(open_file_in_quotes, 0), false, "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1496 }, @@ -392,10 +400,10 @@ static Command_Metadata fcoder_metacmd_table[231] = { { PROC_LINKS(open_panel_vsplit, 0), false, "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 300 }, { PROC_LINKS(page_down, 0), false, "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 383 }, { PROC_LINKS(page_up, 0), false, "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 375 }, -{ PROC_LINKS(paste, 0), false, "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 39 }, -{ PROC_LINKS(paste_and_indent, 0), false, "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 113 }, -{ PROC_LINKS(paste_next, 0), false, "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 72 }, -{ PROC_LINKS(paste_next_and_indent, 0), false, "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 120 }, +{ PROC_LINKS(paste, 0), false, "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 97 }, +{ PROC_LINKS(paste_and_indent, 0), false, "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 172 }, +{ PROC_LINKS(paste_next, 0), false, "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 131 }, +{ PROC_LINKS(paste_next_and_indent, 0), false, "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 179 }, { PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 106 }, { PROC_LINKS(profile_clear, 0), false, "profile_clear", 13, "Clear all profiling information from 4coder's self profiler.", 60, "w:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 226 }, { PROC_LINKS(profile_disable, 0), false, "profile_disable", 15, "Prevent 4coder's self profiler from gathering new profiling information.", 72, "w:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 219 }, @@ -421,10 +429,10 @@ static Command_Metadata fcoder_metacmd_table[231] = { { PROC_LINKS(save_to_query, 0), false, "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1303 }, { PROC_LINKS(search, 0), false, "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1014 }, { PROC_LINKS(search_identifier, 0), false, "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1026 }, -{ PROC_LINKS(seek_beginning_of_line, 0), false, "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2175 }, -{ PROC_LINKS(seek_beginning_of_textual_line, 0), false, "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2163 }, -{ PROC_LINKS(seek_end_of_line, 0), false, "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2181 }, -{ PROC_LINKS(seek_end_of_textual_line, 0), false, "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2169 }, +{ PROC_LINKS(seek_beginning_of_line, 0), false, "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2173 }, +{ PROC_LINKS(seek_beginning_of_textual_line, 0), false, "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2161 }, +{ PROC_LINKS(seek_end_of_line, 0), false, "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2179 }, +{ PROC_LINKS(seek_end_of_textual_line, 0), false, "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2167 }, { PROC_LINKS(select_all, 0), false, "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 548 }, { PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 57 }, { PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "If a scope is selected, find first scope that starts after the selected scope. Otherwise find the first scope that starts after the cursor.", 139, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 66 }, @@ -465,7 +473,7 @@ static Command_Metadata fcoder_metacmd_table[231] = { { PROC_LINKS(toggle_mouse, 0), false, "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 415 }, { PROC_LINKS(toggle_paren_matching_helper, 0), false, "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 445 }, { PROC_LINKS(toggle_show_whitespace, 0), false, "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 750 }, -{ PROC_LINKS(toggle_virtual_whitespace, 0), false, "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\custom\\4coder_code_index.cpp", 40, 1174 }, +{ PROC_LINKS(toggle_virtual_whitespace, 0), false, "toggle_virtual_whitespace", 25, "Toggles virtual whitespace for all files.", 41, "w:\\4ed\\code\\custom\\4coder_code_index.cpp", 40, 1175 }, { PROC_LINKS(tutorial_maximize, 0), false, "tutorial_maximize", 17, "Expand the tutorial window", 26, "w:\\4ed\\code\\custom\\4coder_tutorial.cpp", 38, 20 }, { PROC_LINKS(tutorial_minimize, 0), false, "tutorial_minimize", 17, "Shrink the tutorial window", 26, "w:\\4ed\\code\\custom\\4coder_tutorial.cpp", 38, 34 }, { PROC_LINKS(uncomment_line, 0), false, "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 137 }, @@ -492,228 +500,232 @@ static i32 fcoder_metacmd_ID_auto_indent_whole_file = 3; static i32 fcoder_metacmd_ID_backspace_alpha_numeric_boundary = 4; static i32 fcoder_metacmd_ID_backspace_char = 5; static i32 fcoder_metacmd_ID_basic_change_active_panel = 6; -static i32 fcoder_metacmd_ID_build_in_build_panel = 7; -static i32 fcoder_metacmd_ID_build_search = 8; -static i32 fcoder_metacmd_ID_center_view = 9; -static i32 fcoder_metacmd_ID_change_active_panel = 10; -static i32 fcoder_metacmd_ID_change_active_panel_backwards = 11; -static i32 fcoder_metacmd_ID_change_to_build_panel = 12; -static i32 fcoder_metacmd_ID_clean_all_lines = 13; -static i32 fcoder_metacmd_ID_clear_all_themes = 14; -static i32 fcoder_metacmd_ID_click_set_cursor = 15; -static i32 fcoder_metacmd_ID_click_set_cursor_and_mark = 16; -static i32 fcoder_metacmd_ID_click_set_cursor_if_lbutton = 17; -static i32 fcoder_metacmd_ID_click_set_mark = 18; -static i32 fcoder_metacmd_ID_close_all_code = 19; -static i32 fcoder_metacmd_ID_close_build_panel = 20; -static i32 fcoder_metacmd_ID_close_panel = 21; -static i32 fcoder_metacmd_ID_command_documentation = 22; -static i32 fcoder_metacmd_ID_command_lister = 23; -static i32 fcoder_metacmd_ID_comment_line = 24; -static i32 fcoder_metacmd_ID_comment_line_toggle = 25; -static i32 fcoder_metacmd_ID_copy = 26; -static i32 fcoder_metacmd_ID_cursor_mark_swap = 27; -static i32 fcoder_metacmd_ID_custom_api_documentation = 28; -static i32 fcoder_metacmd_ID_cut = 29; -static i32 fcoder_metacmd_ID_decrease_face_size = 30; -static i32 fcoder_metacmd_ID_default_file_externally_modified = 31; -static i32 fcoder_metacmd_ID_default_startup = 32; -static i32 fcoder_metacmd_ID_default_try_exit = 33; -static i32 fcoder_metacmd_ID_default_view_input_handler = 34; -static i32 fcoder_metacmd_ID_delete_alpha_numeric_boundary = 35; -static i32 fcoder_metacmd_ID_delete_char = 36; -static i32 fcoder_metacmd_ID_delete_current_scope = 37; -static i32 fcoder_metacmd_ID_delete_file_query = 38; -static i32 fcoder_metacmd_ID_delete_line = 39; -static i32 fcoder_metacmd_ID_delete_range = 40; -static i32 fcoder_metacmd_ID_duplicate_line = 41; -static i32 fcoder_metacmd_ID_execute_any_cli = 42; -static i32 fcoder_metacmd_ID_execute_previous_cli = 43; -static i32 fcoder_metacmd_ID_exit_4coder = 44; -static i32 fcoder_metacmd_ID_goto_beginning_of_file = 45; -static i32 fcoder_metacmd_ID_goto_end_of_file = 46; -static i32 fcoder_metacmd_ID_goto_first_jump = 47; -static i32 fcoder_metacmd_ID_goto_first_jump_same_panel_sticky = 48; -static i32 fcoder_metacmd_ID_goto_jump_at_cursor = 49; -static i32 fcoder_metacmd_ID_goto_jump_at_cursor_same_panel = 50; -static i32 fcoder_metacmd_ID_goto_line = 51; -static i32 fcoder_metacmd_ID_goto_next_jump = 52; -static i32 fcoder_metacmd_ID_goto_next_jump_no_skips = 53; -static i32 fcoder_metacmd_ID_goto_prev_jump = 54; -static i32 fcoder_metacmd_ID_goto_prev_jump_no_skips = 55; -static i32 fcoder_metacmd_ID_hide_filebar = 56; -static i32 fcoder_metacmd_ID_hide_scrollbar = 57; -static i32 fcoder_metacmd_ID_hms_demo_tutorial = 58; -static i32 fcoder_metacmd_ID_if0_off = 59; -static i32 fcoder_metacmd_ID_if_read_only_goto_position = 60; -static i32 fcoder_metacmd_ID_if_read_only_goto_position_same_panel = 61; -static i32 fcoder_metacmd_ID_increase_face_size = 62; -static i32 fcoder_metacmd_ID_interactive_kill_buffer = 63; -static i32 fcoder_metacmd_ID_interactive_new = 64; -static i32 fcoder_metacmd_ID_interactive_open = 65; -static i32 fcoder_metacmd_ID_interactive_open_or_new = 66; -static i32 fcoder_metacmd_ID_interactive_switch_buffer = 67; -static i32 fcoder_metacmd_ID_jump_to_definition = 68; -static i32 fcoder_metacmd_ID_keyboard_macro_finish_recording = 69; -static i32 fcoder_metacmd_ID_keyboard_macro_replay = 70; -static i32 fcoder_metacmd_ID_keyboard_macro_start_recording = 71; -static i32 fcoder_metacmd_ID_kill_buffer = 72; -static i32 fcoder_metacmd_ID_kill_tutorial = 73; -static i32 fcoder_metacmd_ID_left_adjust_view = 74; -static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 75; -static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 76; -static i32 fcoder_metacmd_ID_list_all_functions_current_buffer = 77; -static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 78; -static i32 fcoder_metacmd_ID_list_all_locations = 79; -static i32 fcoder_metacmd_ID_list_all_locations_case_insensitive = 80; -static i32 fcoder_metacmd_ID_list_all_locations_of_identifier = 81; -static i32 fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 82; -static i32 fcoder_metacmd_ID_list_all_locations_of_selection = 83; -static i32 fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 84; -static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition = 85; -static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 86; -static i32 fcoder_metacmd_ID_list_all_substring_locations = 87; -static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 88; -static i32 fcoder_metacmd_ID_load_project = 89; -static i32 fcoder_metacmd_ID_load_theme_current_buffer = 90; -static i32 fcoder_metacmd_ID_load_themes_default_folder = 91; -static i32 fcoder_metacmd_ID_load_themes_hot_directory = 92; -static i32 fcoder_metacmd_ID_make_directory_query = 93; -static i32 fcoder_metacmd_ID_miblo_decrement_basic = 94; -static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 95; -static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 96; -static i32 fcoder_metacmd_ID_miblo_increment_basic = 97; -static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 98; -static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 99; -static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 100; -static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 101; -static i32 fcoder_metacmd_ID_move_down = 102; -static i32 fcoder_metacmd_ID_move_down_10 = 103; -static i32 fcoder_metacmd_ID_move_down_textual = 104; -static i32 fcoder_metacmd_ID_move_down_to_blank_line = 105; -static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 106; -static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 107; -static i32 fcoder_metacmd_ID_move_left = 108; -static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 109; -static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 110; -static i32 fcoder_metacmd_ID_move_left_token_boundary = 111; -static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 112; -static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 113; -static i32 fcoder_metacmd_ID_move_line_down = 114; -static i32 fcoder_metacmd_ID_move_line_up = 115; -static i32 fcoder_metacmd_ID_move_right = 116; -static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 117; -static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 118; -static i32 fcoder_metacmd_ID_move_right_token_boundary = 119; -static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 120; -static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 121; -static i32 fcoder_metacmd_ID_move_up = 122; -static i32 fcoder_metacmd_ID_move_up_10 = 123; -static i32 fcoder_metacmd_ID_move_up_to_blank_line = 124; -static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 125; -static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 126; -static i32 fcoder_metacmd_ID_open_all_code = 127; -static i32 fcoder_metacmd_ID_open_all_code_recursive = 128; -static i32 fcoder_metacmd_ID_open_file_in_quotes = 129; -static i32 fcoder_metacmd_ID_open_in_other = 130; -static i32 fcoder_metacmd_ID_open_long_braces = 131; -static i32 fcoder_metacmd_ID_open_long_braces_break = 132; -static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 133; -static i32 fcoder_metacmd_ID_open_matching_file_cpp = 134; -static i32 fcoder_metacmd_ID_open_panel_hsplit = 135; -static i32 fcoder_metacmd_ID_open_panel_vsplit = 136; -static i32 fcoder_metacmd_ID_page_down = 137; -static i32 fcoder_metacmd_ID_page_up = 138; -static i32 fcoder_metacmd_ID_paste = 139; -static i32 fcoder_metacmd_ID_paste_and_indent = 140; -static i32 fcoder_metacmd_ID_paste_next = 141; -static i32 fcoder_metacmd_ID_paste_next_and_indent = 142; -static i32 fcoder_metacmd_ID_place_in_scope = 143; -static i32 fcoder_metacmd_ID_profile_clear = 144; -static i32 fcoder_metacmd_ID_profile_disable = 145; -static i32 fcoder_metacmd_ID_profile_enable = 146; -static i32 fcoder_metacmd_ID_profile_inspect = 147; -static i32 fcoder_metacmd_ID_project_command_lister = 148; -static i32 fcoder_metacmd_ID_project_fkey_command = 149; -static i32 fcoder_metacmd_ID_project_go_to_root_directory = 150; -static i32 fcoder_metacmd_ID_query_replace = 151; -static i32 fcoder_metacmd_ID_query_replace_identifier = 152; -static i32 fcoder_metacmd_ID_query_replace_selection = 153; -static i32 fcoder_metacmd_ID_redo = 154; -static i32 fcoder_metacmd_ID_redo_all_buffers = 155; -static i32 fcoder_metacmd_ID_rename_file_query = 156; -static i32 fcoder_metacmd_ID_reopen = 157; -static i32 fcoder_metacmd_ID_replace_in_all_buffers = 158; -static i32 fcoder_metacmd_ID_replace_in_buffer = 159; -static i32 fcoder_metacmd_ID_replace_in_range = 160; -static i32 fcoder_metacmd_ID_reverse_search = 161; -static i32 fcoder_metacmd_ID_reverse_search_identifier = 162; -static i32 fcoder_metacmd_ID_save = 163; -static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 164; -static i32 fcoder_metacmd_ID_save_to_query = 165; -static i32 fcoder_metacmd_ID_search = 166; -static i32 fcoder_metacmd_ID_search_identifier = 167; -static i32 fcoder_metacmd_ID_seek_beginning_of_line = 168; -static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 169; -static i32 fcoder_metacmd_ID_seek_end_of_line = 170; -static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 171; -static i32 fcoder_metacmd_ID_select_all = 172; -static i32 fcoder_metacmd_ID_select_next_scope_absolute = 173; -static i32 fcoder_metacmd_ID_select_next_scope_after_current = 174; -static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 175; -static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 176; -static i32 fcoder_metacmd_ID_select_surrounding_scope = 177; -static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 178; -static i32 fcoder_metacmd_ID_set_eol_mode_from_contents = 179; -static i32 fcoder_metacmd_ID_set_eol_mode_to_binary = 180; -static i32 fcoder_metacmd_ID_set_eol_mode_to_crlf = 181; -static i32 fcoder_metacmd_ID_set_eol_mode_to_lf = 182; -static i32 fcoder_metacmd_ID_set_mark = 183; -static i32 fcoder_metacmd_ID_set_mode_to_notepad_like = 184; -static i32 fcoder_metacmd_ID_set_mode_to_original = 185; -static i32 fcoder_metacmd_ID_setup_build_bat = 186; -static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 187; -static i32 fcoder_metacmd_ID_setup_build_sh = 188; -static i32 fcoder_metacmd_ID_setup_new_project = 189; -static i32 fcoder_metacmd_ID_show_filebar = 190; -static i32 fcoder_metacmd_ID_show_scrollbar = 191; -static i32 fcoder_metacmd_ID_show_the_log_graph = 192; -static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 193; -static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 194; -static i32 fcoder_metacmd_ID_snippet_lister = 195; -static i32 fcoder_metacmd_ID_suppress_mouse = 196; -static i32 fcoder_metacmd_ID_swap_panels = 197; -static i32 fcoder_metacmd_ID_test_double_backspace = 198; -static i32 fcoder_metacmd_ID_theme_lister = 199; -static i32 fcoder_metacmd_ID_to_lowercase = 200; -static i32 fcoder_metacmd_ID_to_uppercase = 201; -static i32 fcoder_metacmd_ID_toggle_filebar = 202; -static i32 fcoder_metacmd_ID_toggle_fps_meter = 203; -static i32 fcoder_metacmd_ID_toggle_fullscreen = 204; -static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 205; -static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 206; -static i32 fcoder_metacmd_ID_toggle_line_numbers = 207; -static i32 fcoder_metacmd_ID_toggle_line_wrap = 208; -static i32 fcoder_metacmd_ID_toggle_mouse = 209; -static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 210; -static i32 fcoder_metacmd_ID_toggle_show_whitespace = 211; -static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 212; -static i32 fcoder_metacmd_ID_tutorial_maximize = 213; -static i32 fcoder_metacmd_ID_tutorial_minimize = 214; -static i32 fcoder_metacmd_ID_uncomment_line = 215; -static i32 fcoder_metacmd_ID_undo = 216; -static i32 fcoder_metacmd_ID_undo_all_buffers = 217; -static i32 fcoder_metacmd_ID_view_buffer_other_panel = 218; -static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 219; -static i32 fcoder_metacmd_ID_word_complete = 220; -static i32 fcoder_metacmd_ID_word_complete_drop_down = 221; -static i32 fcoder_metacmd_ID_write_block = 222; -static i32 fcoder_metacmd_ID_write_hack = 223; -static i32 fcoder_metacmd_ID_write_note = 224; -static i32 fcoder_metacmd_ID_write_space = 225; -static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 226; -static i32 fcoder_metacmd_ID_write_text_input = 227; -static i32 fcoder_metacmd_ID_write_todo = 228; -static i32 fcoder_metacmd_ID_write_underscore = 229; -static i32 fcoder_metacmd_ID_write_zero_struct = 230; +static i32 fcoder_metacmd_ID_begin_clipboard_collection_mode = 7; +static i32 fcoder_metacmd_ID_build_in_build_panel = 8; +static i32 fcoder_metacmd_ID_build_search = 9; +static i32 fcoder_metacmd_ID_center_view = 10; +static i32 fcoder_metacmd_ID_change_active_panel = 11; +static i32 fcoder_metacmd_ID_change_active_panel_backwards = 12; +static i32 fcoder_metacmd_ID_change_to_build_panel = 13; +static i32 fcoder_metacmd_ID_clean_all_lines = 14; +static i32 fcoder_metacmd_ID_clear_all_themes = 15; +static i32 fcoder_metacmd_ID_clear_clipboard = 16; +static i32 fcoder_metacmd_ID_click_set_cursor = 17; +static i32 fcoder_metacmd_ID_click_set_cursor_and_mark = 18; +static i32 fcoder_metacmd_ID_click_set_cursor_if_lbutton = 19; +static i32 fcoder_metacmd_ID_click_set_mark = 20; +static i32 fcoder_metacmd_ID_close_all_code = 21; +static i32 fcoder_metacmd_ID_close_build_panel = 22; +static i32 fcoder_metacmd_ID_close_panel = 23; +static i32 fcoder_metacmd_ID_command_documentation = 24; +static i32 fcoder_metacmd_ID_command_lister = 25; +static i32 fcoder_metacmd_ID_comment_line = 26; +static i32 fcoder_metacmd_ID_comment_line_toggle = 27; +static i32 fcoder_metacmd_ID_copy = 28; +static i32 fcoder_metacmd_ID_cursor_mark_swap = 29; +static i32 fcoder_metacmd_ID_custom_api_documentation = 30; +static i32 fcoder_metacmd_ID_cut = 31; +static i32 fcoder_metacmd_ID_decrease_face_size = 32; +static i32 fcoder_metacmd_ID_default_file_externally_modified = 33; +static i32 fcoder_metacmd_ID_default_startup = 34; +static i32 fcoder_metacmd_ID_default_try_exit = 35; +static i32 fcoder_metacmd_ID_default_view_input_handler = 36; +static i32 fcoder_metacmd_ID_delete_alpha_numeric_boundary = 37; +static i32 fcoder_metacmd_ID_delete_char = 38; +static i32 fcoder_metacmd_ID_delete_current_scope = 39; +static i32 fcoder_metacmd_ID_delete_file_query = 40; +static i32 fcoder_metacmd_ID_delete_line = 41; +static i32 fcoder_metacmd_ID_delete_range = 42; +static i32 fcoder_metacmd_ID_duplicate_line = 43; +static i32 fcoder_metacmd_ID_execute_any_cli = 44; +static i32 fcoder_metacmd_ID_execute_previous_cli = 45; +static i32 fcoder_metacmd_ID_exit_4coder = 46; +static i32 fcoder_metacmd_ID_goto_beginning_of_file = 47; +static i32 fcoder_metacmd_ID_goto_end_of_file = 48; +static i32 fcoder_metacmd_ID_goto_first_jump = 49; +static i32 fcoder_metacmd_ID_goto_first_jump_same_panel_sticky = 50; +static i32 fcoder_metacmd_ID_goto_jump_at_cursor = 51; +static i32 fcoder_metacmd_ID_goto_jump_at_cursor_same_panel = 52; +static i32 fcoder_metacmd_ID_goto_line = 53; +static i32 fcoder_metacmd_ID_goto_next_jump = 54; +static i32 fcoder_metacmd_ID_goto_next_jump_no_skips = 55; +static i32 fcoder_metacmd_ID_goto_prev_jump = 56; +static i32 fcoder_metacmd_ID_goto_prev_jump_no_skips = 57; +static i32 fcoder_metacmd_ID_hide_filebar = 58; +static i32 fcoder_metacmd_ID_hide_scrollbar = 59; +static i32 fcoder_metacmd_ID_hms_demo_tutorial = 60; +static i32 fcoder_metacmd_ID_if0_off = 61; +static i32 fcoder_metacmd_ID_if_read_only_goto_position = 62; +static i32 fcoder_metacmd_ID_if_read_only_goto_position_same_panel = 63; +static i32 fcoder_metacmd_ID_increase_face_size = 64; +static i32 fcoder_metacmd_ID_interactive_kill_buffer = 65; +static i32 fcoder_metacmd_ID_interactive_new = 66; +static i32 fcoder_metacmd_ID_interactive_open = 67; +static i32 fcoder_metacmd_ID_interactive_open_or_new = 68; +static i32 fcoder_metacmd_ID_interactive_switch_buffer = 69; +static i32 fcoder_metacmd_ID_jump_to_definition = 70; +static i32 fcoder_metacmd_ID_keyboard_macro_finish_recording = 71; +static i32 fcoder_metacmd_ID_keyboard_macro_replay = 72; +static i32 fcoder_metacmd_ID_keyboard_macro_start_recording = 73; +static i32 fcoder_metacmd_ID_kill_buffer = 74; +static i32 fcoder_metacmd_ID_kill_tutorial = 75; +static i32 fcoder_metacmd_ID_left_adjust_view = 76; +static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 77; +static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 78; +static i32 fcoder_metacmd_ID_list_all_functions_current_buffer = 79; +static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 80; +static i32 fcoder_metacmd_ID_list_all_locations = 81; +static i32 fcoder_metacmd_ID_list_all_locations_case_insensitive = 82; +static i32 fcoder_metacmd_ID_list_all_locations_of_identifier = 83; +static i32 fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 84; +static i32 fcoder_metacmd_ID_list_all_locations_of_selection = 85; +static i32 fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 86; +static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition = 87; +static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 88; +static i32 fcoder_metacmd_ID_list_all_substring_locations = 89; +static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 90; +static i32 fcoder_metacmd_ID_load_project = 91; +static i32 fcoder_metacmd_ID_load_theme_current_buffer = 92; +static i32 fcoder_metacmd_ID_load_themes_default_folder = 93; +static i32 fcoder_metacmd_ID_load_themes_hot_directory = 94; +static i32 fcoder_metacmd_ID_make_directory_query = 95; +static i32 fcoder_metacmd_ID_miblo_decrement_basic = 96; +static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 97; +static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 98; +static i32 fcoder_metacmd_ID_miblo_increment_basic = 99; +static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 100; +static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 101; +static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 102; +static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 103; +static i32 fcoder_metacmd_ID_move_down = 104; +static i32 fcoder_metacmd_ID_move_down_10 = 105; +static i32 fcoder_metacmd_ID_move_down_textual = 106; +static i32 fcoder_metacmd_ID_move_down_to_blank_line = 107; +static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 108; +static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 109; +static i32 fcoder_metacmd_ID_move_left = 110; +static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 111; +static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 112; +static i32 fcoder_metacmd_ID_move_left_token_boundary = 113; +static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 114; +static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 115; +static i32 fcoder_metacmd_ID_move_line_down = 116; +static i32 fcoder_metacmd_ID_move_line_up = 117; +static i32 fcoder_metacmd_ID_move_right = 118; +static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 119; +static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 120; +static i32 fcoder_metacmd_ID_move_right_token_boundary = 121; +static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 122; +static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 123; +static i32 fcoder_metacmd_ID_move_up = 124; +static i32 fcoder_metacmd_ID_move_up_10 = 125; +static i32 fcoder_metacmd_ID_move_up_to_blank_line = 126; +static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 127; +static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 128; +static i32 fcoder_metacmd_ID_multi_paste_interactive = 129; +static i32 fcoder_metacmd_ID_multi_paste_interactive_quick = 130; +static i32 fcoder_metacmd_ID_open_all_code = 131; +static i32 fcoder_metacmd_ID_open_all_code_recursive = 132; +static i32 fcoder_metacmd_ID_open_file_in_quotes = 133; +static i32 fcoder_metacmd_ID_open_in_other = 134; +static i32 fcoder_metacmd_ID_open_long_braces = 135; +static i32 fcoder_metacmd_ID_open_long_braces_break = 136; +static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 137; +static i32 fcoder_metacmd_ID_open_matching_file_cpp = 138; +static i32 fcoder_metacmd_ID_open_panel_hsplit = 139; +static i32 fcoder_metacmd_ID_open_panel_vsplit = 140; +static i32 fcoder_metacmd_ID_page_down = 141; +static i32 fcoder_metacmd_ID_page_up = 142; +static i32 fcoder_metacmd_ID_paste = 143; +static i32 fcoder_metacmd_ID_paste_and_indent = 144; +static i32 fcoder_metacmd_ID_paste_next = 145; +static i32 fcoder_metacmd_ID_paste_next_and_indent = 146; +static i32 fcoder_metacmd_ID_place_in_scope = 147; +static i32 fcoder_metacmd_ID_profile_clear = 148; +static i32 fcoder_metacmd_ID_profile_disable = 149; +static i32 fcoder_metacmd_ID_profile_enable = 150; +static i32 fcoder_metacmd_ID_profile_inspect = 151; +static i32 fcoder_metacmd_ID_project_command_lister = 152; +static i32 fcoder_metacmd_ID_project_fkey_command = 153; +static i32 fcoder_metacmd_ID_project_go_to_root_directory = 154; +static i32 fcoder_metacmd_ID_query_replace = 155; +static i32 fcoder_metacmd_ID_query_replace_identifier = 156; +static i32 fcoder_metacmd_ID_query_replace_selection = 157; +static i32 fcoder_metacmd_ID_redo = 158; +static i32 fcoder_metacmd_ID_redo_all_buffers = 159; +static i32 fcoder_metacmd_ID_rename_file_query = 160; +static i32 fcoder_metacmd_ID_reopen = 161; +static i32 fcoder_metacmd_ID_replace_in_all_buffers = 162; +static i32 fcoder_metacmd_ID_replace_in_buffer = 163; +static i32 fcoder_metacmd_ID_replace_in_range = 164; +static i32 fcoder_metacmd_ID_reverse_search = 165; +static i32 fcoder_metacmd_ID_reverse_search_identifier = 166; +static i32 fcoder_metacmd_ID_save = 167; +static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 168; +static i32 fcoder_metacmd_ID_save_to_query = 169; +static i32 fcoder_metacmd_ID_search = 170; +static i32 fcoder_metacmd_ID_search_identifier = 171; +static i32 fcoder_metacmd_ID_seek_beginning_of_line = 172; +static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 173; +static i32 fcoder_metacmd_ID_seek_end_of_line = 174; +static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 175; +static i32 fcoder_metacmd_ID_select_all = 176; +static i32 fcoder_metacmd_ID_select_next_scope_absolute = 177; +static i32 fcoder_metacmd_ID_select_next_scope_after_current = 178; +static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 179; +static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 180; +static i32 fcoder_metacmd_ID_select_surrounding_scope = 181; +static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 182; +static i32 fcoder_metacmd_ID_set_eol_mode_from_contents = 183; +static i32 fcoder_metacmd_ID_set_eol_mode_to_binary = 184; +static i32 fcoder_metacmd_ID_set_eol_mode_to_crlf = 185; +static i32 fcoder_metacmd_ID_set_eol_mode_to_lf = 186; +static i32 fcoder_metacmd_ID_set_mark = 187; +static i32 fcoder_metacmd_ID_set_mode_to_notepad_like = 188; +static i32 fcoder_metacmd_ID_set_mode_to_original = 189; +static i32 fcoder_metacmd_ID_setup_build_bat = 190; +static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 191; +static i32 fcoder_metacmd_ID_setup_build_sh = 192; +static i32 fcoder_metacmd_ID_setup_new_project = 193; +static i32 fcoder_metacmd_ID_show_filebar = 194; +static i32 fcoder_metacmd_ID_show_scrollbar = 195; +static i32 fcoder_metacmd_ID_show_the_log_graph = 196; +static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 197; +static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 198; +static i32 fcoder_metacmd_ID_snippet_lister = 199; +static i32 fcoder_metacmd_ID_suppress_mouse = 200; +static i32 fcoder_metacmd_ID_swap_panels = 201; +static i32 fcoder_metacmd_ID_test_double_backspace = 202; +static i32 fcoder_metacmd_ID_theme_lister = 203; +static i32 fcoder_metacmd_ID_to_lowercase = 204; +static i32 fcoder_metacmd_ID_to_uppercase = 205; +static i32 fcoder_metacmd_ID_toggle_filebar = 206; +static i32 fcoder_metacmd_ID_toggle_fps_meter = 207; +static i32 fcoder_metacmd_ID_toggle_fullscreen = 208; +static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 209; +static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 210; +static i32 fcoder_metacmd_ID_toggle_line_numbers = 211; +static i32 fcoder_metacmd_ID_toggle_line_wrap = 212; +static i32 fcoder_metacmd_ID_toggle_mouse = 213; +static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 214; +static i32 fcoder_metacmd_ID_toggle_show_whitespace = 215; +static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 216; +static i32 fcoder_metacmd_ID_tutorial_maximize = 217; +static i32 fcoder_metacmd_ID_tutorial_minimize = 218; +static i32 fcoder_metacmd_ID_uncomment_line = 219; +static i32 fcoder_metacmd_ID_undo = 220; +static i32 fcoder_metacmd_ID_undo_all_buffers = 221; +static i32 fcoder_metacmd_ID_view_buffer_other_panel = 222; +static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 223; +static i32 fcoder_metacmd_ID_word_complete = 224; +static i32 fcoder_metacmd_ID_word_complete_drop_down = 225; +static i32 fcoder_metacmd_ID_write_block = 226; +static i32 fcoder_metacmd_ID_write_hack = 227; +static i32 fcoder_metacmd_ID_write_note = 228; +static i32 fcoder_metacmd_ID_write_space = 229; +static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 230; +static i32 fcoder_metacmd_ID_write_text_input = 231; +static i32 fcoder_metacmd_ID_write_todo = 232; +static i32 fcoder_metacmd_ID_write_underscore = 233; +static i32 fcoder_metacmd_ID_write_zero_struct = 234; #endif diff --git a/custom/generated/custom_api.cpp b/custom/generated/custom_api.cpp index 653783c8..b092dc53 100644 --- a/custom/generated/custom_api.cpp +++ b/custom/generated/custom_api.cpp @@ -8,7 +8,8 @@ vtable->child_process_set_target_buffer = child_process_set_target_buffer; vtable->buffer_get_attached_child_process = buffer_get_attached_child_process; vtable->child_process_get_attached_buffer = child_process_get_attached_buffer; vtable->child_process_get_state = child_process_get_state; -vtable->clipboard_post = clipboard_post; +vtable->clipboard_clear = clipboard_clear; +vtable->clipboard_post_internal_only = clipboard_post_internal_only; vtable->clipboard_count = clipboard_count; vtable->push_clipboard_index = push_clipboard_index; vtable->enqueue_virtual_event = enqueue_virtual_event; @@ -189,7 +190,8 @@ child_process_set_target_buffer = vtable->child_process_set_target_buffer; buffer_get_attached_child_process = vtable->buffer_get_attached_child_process; child_process_get_attached_buffer = vtable->child_process_get_attached_buffer; child_process_get_state = vtable->child_process_get_state; -clipboard_post = vtable->clipboard_post; +clipboard_clear = vtable->clipboard_clear; +clipboard_post_internal_only = vtable->clipboard_post_internal_only; clipboard_count = vtable->clipboard_count; push_clipboard_index = vtable->push_clipboard_index; enqueue_virtual_event = vtable->enqueue_virtual_event; diff --git a/custom/generated/custom_api.h b/custom/generated/custom_api.h index 7e65493a..8a9563a0 100644 --- a/custom/generated/custom_api.h +++ b/custom/generated/custom_api.h @@ -6,7 +6,8 @@ #define custom_buffer_get_attached_child_process_sig() Child_Process_ID custom_buffer_get_attached_child_process(Application_Links* app, Buffer_ID buffer_id) #define custom_child_process_get_attached_buffer_sig() Buffer_ID custom_child_process_get_attached_buffer(Application_Links* app, Child_Process_ID child_process_id) #define custom_child_process_get_state_sig() Process_State custom_child_process_get_state(Application_Links* app, Child_Process_ID child_process_id) -#define custom_clipboard_post_sig() b32 custom_clipboard_post(Application_Links* app, i32 clipboard_id, String_Const_u8 string) +#define custom_clipboard_clear_sig() b32 custom_clipboard_clear(Application_Links* app, i32 clipboard_id) +#define custom_clipboard_post_internal_only_sig() b32 custom_clipboard_post_internal_only(Application_Links* app, i32 clipboard_id, String_Const_u8 string) #define custom_clipboard_count_sig() i32 custom_clipboard_count(Application_Links* app, i32 clipboard_id) #define custom_push_clipboard_index_sig() String_Const_u8 custom_push_clipboard_index(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index) #define custom_enqueue_virtual_event_sig() b32 custom_enqueue_virtual_event(Application_Links* app, Input_Event* event) @@ -183,7 +184,8 @@ typedef b32 custom_child_process_set_target_buffer_type(Application_Links* app, typedef Child_Process_ID custom_buffer_get_attached_child_process_type(Application_Links* app, Buffer_ID buffer_id); typedef Buffer_ID custom_child_process_get_attached_buffer_type(Application_Links* app, Child_Process_ID child_process_id); typedef Process_State custom_child_process_get_state_type(Application_Links* app, Child_Process_ID child_process_id); -typedef b32 custom_clipboard_post_type(Application_Links* app, i32 clipboard_id, String_Const_u8 string); +typedef b32 custom_clipboard_clear_type(Application_Links* app, i32 clipboard_id); +typedef b32 custom_clipboard_post_internal_only_type(Application_Links* app, i32 clipboard_id, String_Const_u8 string); typedef i32 custom_clipboard_count_type(Application_Links* app, i32 clipboard_id); typedef String_Const_u8 custom_push_clipboard_index_type(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index); typedef b32 custom_enqueue_virtual_event_type(Application_Links* app, Input_Event* event); @@ -361,7 +363,8 @@ custom_child_process_set_target_buffer_type *child_process_set_target_buffer; custom_buffer_get_attached_child_process_type *buffer_get_attached_child_process; custom_child_process_get_attached_buffer_type *child_process_get_attached_buffer; custom_child_process_get_state_type *child_process_get_state; -custom_clipboard_post_type *clipboard_post; +custom_clipboard_clear_type *clipboard_clear; +custom_clipboard_post_internal_only_type *clipboard_post_internal_only; custom_clipboard_count_type *clipboard_count; custom_push_clipboard_index_type *push_clipboard_index; custom_enqueue_virtual_event_type *enqueue_virtual_event; @@ -540,7 +543,8 @@ internal b32 child_process_set_target_buffer(Application_Links* app, Child_Proce internal Child_Process_ID buffer_get_attached_child_process(Application_Links* app, Buffer_ID buffer_id); internal Buffer_ID child_process_get_attached_buffer(Application_Links* app, Child_Process_ID child_process_id); internal Process_State child_process_get_state(Application_Links* app, Child_Process_ID child_process_id); -internal b32 clipboard_post(Application_Links* app, i32 clipboard_id, String_Const_u8 string); +internal b32 clipboard_clear(Application_Links* app, i32 clipboard_id); +internal b32 clipboard_post_internal_only(Application_Links* app, i32 clipboard_id, String_Const_u8 string); internal i32 clipboard_count(Application_Links* app, i32 clipboard_id); internal String_Const_u8 push_clipboard_index(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index); internal b32 enqueue_virtual_event(Application_Links* app, Input_Event* event); @@ -719,7 +723,8 @@ global custom_child_process_set_target_buffer_type *child_process_set_target_buf global custom_buffer_get_attached_child_process_type *buffer_get_attached_child_process = 0; global custom_child_process_get_attached_buffer_type *child_process_get_attached_buffer = 0; global custom_child_process_get_state_type *child_process_get_state = 0; -global custom_clipboard_post_type *clipboard_post = 0; +global custom_clipboard_clear_type *clipboard_clear = 0; +global custom_clipboard_post_internal_only_type *clipboard_post_internal_only = 0; global custom_clipboard_count_type *clipboard_count = 0; global custom_push_clipboard_index_type *push_clipboard_index = 0; global custom_enqueue_virtual_event_type *enqueue_virtual_event = 0; diff --git a/custom/generated/custom_api_constructor.cpp b/custom/generated/custom_api_constructor.cpp index 2520a502..8a8fac48 100644 --- a/custom/generated/custom_api_constructor.cpp +++ b/custom/generated/custom_api_constructor.cpp @@ -44,7 +44,12 @@ api_param(arena, call, "Application_Links*", "app"); api_param(arena, call, "Child_Process_ID", "child_process_id"); } { -API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("clipboard_post"), string_u8_litexpr("b32"), string_u8_litexpr("")); +API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("clipboard_clear"), string_u8_litexpr("b32"), string_u8_litexpr("")); +api_param(arena, call, "Application_Links*", "app"); +api_param(arena, call, "i32", "clipboard_id"); +} +{ +API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("clipboard_post_internal_only"), string_u8_litexpr("b32"), string_u8_litexpr("")); api_param(arena, call, "Application_Links*", "app"); api_param(arena, call, "i32", "clipboard_id"); api_param(arena, call, "String_Const_u8", "string"); @@ -557,14 +562,6 @@ api_param(arena, call, "Buffer_ID", "buffer_id"); api_param(arena, call, "Set_Buffer_Flag", "flags"); } { -API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("view_post_fade"), string_u8_litexpr("b32"), string_u8_litexpr("")); -api_param(arena, call, "Application_Links*", "app"); -api_param(arena, call, "View_ID", "view_id"); -api_param(arena, call, "f32", "seconds"); -api_param(arena, call, "Range_i64", "range"); -api_param(arena, call, "ARGB_Color", "color"); -} -{ API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("view_push_context"), string_u8_litexpr("b32"), string_u8_litexpr("")); api_param(arena, call, "Application_Links*", "app"); api_param(arena, call, "View_ID", "view_id"); @@ -992,6 +989,14 @@ api_param(arena, call, "Range_i64", "range"); api_param(arena, call, "ARGB_Color", "color"); } { +API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("paint_text_color_blend"), string_u8_litexpr("void"), string_u8_litexpr("")); +api_param(arena, call, "Application_Links*", "app"); +api_param(arena, call, "Text_Layout_ID", "layout_id"); +api_param(arena, call, "Range_i64", "range"); +api_param(arena, call, "ARGB_Color", "color"); +api_param(arena, call, "f32", "blend"); +} +{ API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("text_layout_free"), string_u8_litexpr("b32"), string_u8_litexpr("")); api_param(arena, call, "Application_Links*", "app"); api_param(arena, call, "Text_Layout_ID", "text_layout_id"); diff --git a/custom/generated/custom_api_master_list.h b/custom/generated/custom_api_master_list.h index 60e06631..a8eb6f63 100644 --- a/custom/generated/custom_api_master_list.h +++ b/custom/generated/custom_api_master_list.h @@ -6,7 +6,8 @@ api(custom) function b32 child_process_set_target_buffer(Application_Links* app, api(custom) function Child_Process_ID buffer_get_attached_child_process(Application_Links* app, Buffer_ID buffer_id); api(custom) function Buffer_ID child_process_get_attached_buffer(Application_Links* app, Child_Process_ID child_process_id); api(custom) function Process_State child_process_get_state(Application_Links* app, Child_Process_ID child_process_id); -api(custom) function b32 clipboard_post(Application_Links* app, i32 clipboard_id, String_Const_u8 string); +api(custom) function b32 clipboard_clear(Application_Links* app, i32 clipboard_id); +api(custom) function b32 clipboard_post_internal_only(Application_Links* app, i32 clipboard_id, String_Const_u8 string); api(custom) function i32 clipboard_count(Application_Links* app, i32 clipboard_id); api(custom) function String_Const_u8 push_clipboard_index(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index); api(custom) function b32 enqueue_virtual_event(Application_Links* app, Input_Event* event); diff --git a/custom/generated/system_api.cpp b/custom/generated/system_api.cpp index 155bee65..990f8768 100644 --- a/custom/generated/system_api.cpp +++ b/custom/generated/system_api.cpp @@ -18,7 +18,10 @@ vtable->wake_up_timer_release = system_wake_up_timer_release; vtable->wake_up_timer_set = system_wake_up_timer_set; vtable->signal_step = system_signal_step; vtable->sleep = system_sleep; +vtable->get_clipboard = system_get_clipboard; vtable->post_clipboard = system_post_clipboard; +vtable->set_clipboard_catch_all = system_set_clipboard_catch_all; +vtable->get_clipboard_catch_all = system_get_clipboard_catch_all; vtable->cli_call = system_cli_call; vtable->cli_begin_update = system_cli_begin_update; vtable->cli_update_step = system_cli_update_step; @@ -69,7 +72,10 @@ system_wake_up_timer_release = vtable->wake_up_timer_release; system_wake_up_timer_set = vtable->wake_up_timer_set; system_signal_step = vtable->signal_step; system_sleep = vtable->sleep; +system_get_clipboard = vtable->get_clipboard; system_post_clipboard = vtable->post_clipboard; +system_set_clipboard_catch_all = vtable->set_clipboard_catch_all; +system_get_clipboard_catch_all = vtable->get_clipboard_catch_all; system_cli_call = vtable->cli_call; system_cli_begin_update = vtable->cli_begin_update; system_cli_update_step = vtable->cli_update_step; diff --git a/custom/generated/system_api.h b/custom/generated/system_api.h index f67a518f..e7159282 100644 --- a/custom/generated/system_api.h +++ b/custom/generated/system_api.h @@ -16,7 +16,10 @@ #define system_wake_up_timer_set_sig() void system_wake_up_timer_set(Plat_Handle handle, u32 time_milliseconds) #define system_signal_step_sig() void system_signal_step(u32 code) #define system_sleep_sig() void system_sleep(u64 microseconds) +#define system_get_clipboard_sig() String_Const_u8 system_get_clipboard(Arena* arena) #define system_post_clipboard_sig() void system_post_clipboard(String_Const_u8 str) +#define system_set_clipboard_catch_all_sig() void system_set_clipboard_catch_all(b32 enabled) +#define system_get_clipboard_catch_all_sig() b32 system_get_clipboard_catch_all(void) #define system_cli_call_sig() b32 system_cli_call(Arena* scratch, char* path, char* script, CLI_Handles* cli_out) #define system_cli_begin_update_sig() void system_cli_begin_update(CLI_Handles* cli) #define system_cli_update_step_sig() b32 system_cli_update_step(CLI_Handles* cli, char* dest, u32 max, u32* amount) @@ -63,7 +66,10 @@ typedef void system_wake_up_timer_release_type(Plat_Handle handle); typedef void system_wake_up_timer_set_type(Plat_Handle handle, u32 time_milliseconds); typedef void system_signal_step_type(u32 code); typedef void system_sleep_type(u64 microseconds); +typedef String_Const_u8 system_get_clipboard_type(Arena* arena); typedef void system_post_clipboard_type(String_Const_u8 str); +typedef void system_set_clipboard_catch_all_type(b32 enabled); +typedef b32 system_get_clipboard_catch_all_type(void); typedef b32 system_cli_call_type(Arena* scratch, char* path, char* script, CLI_Handles* cli_out); typedef void system_cli_begin_update_type(CLI_Handles* cli); typedef b32 system_cli_update_step_type(CLI_Handles* cli, char* dest, u32 max, u32* amount); @@ -93,53 +99,56 @@ typedef b32 system_set_fullscreen_type(b32 full_screen); typedef b32 system_is_fullscreen_type(void); typedef Input_Modifier_Set system_get_keyboard_modifiers_type(Arena* arena); struct API_VTable_system{ - system_get_path_type *get_path; - system_get_canonical_type *get_canonical; - system_get_file_list_type *get_file_list; - system_quick_file_attributes_type *quick_file_attributes; - system_load_handle_type *load_handle; - system_load_attributes_type *load_attributes; - system_load_file_type *load_file; - system_load_close_type *load_close; - system_save_file_type *save_file; - system_load_library_type *load_library; - system_release_library_type *release_library; - system_get_proc_type *get_proc; - system_now_time_type *now_time; - system_wake_up_timer_create_type *wake_up_timer_create; - system_wake_up_timer_release_type *wake_up_timer_release; - system_wake_up_timer_set_type *wake_up_timer_set; - system_signal_step_type *signal_step; - system_sleep_type *sleep; - system_post_clipboard_type *post_clipboard; - system_cli_call_type *cli_call; - system_cli_begin_update_type *cli_begin_update; - system_cli_update_step_type *cli_update_step; - system_cli_end_update_type *cli_end_update; - system_open_color_picker_type *open_color_picker; - system_get_screen_scale_factor_type *get_screen_scale_factor; - system_thread_launch_type *thread_launch; - system_thread_join_type *thread_join; - system_thread_free_type *thread_free; - system_thread_get_id_type *thread_get_id; - system_acquire_global_frame_mutex_type *acquire_global_frame_mutex; - system_release_global_frame_mutex_type *release_global_frame_mutex; - system_mutex_make_type *mutex_make; - system_mutex_acquire_type *mutex_acquire; - system_mutex_release_type *mutex_release; - system_mutex_free_type *mutex_free; - system_condition_variable_make_type *condition_variable_make; - system_condition_variable_wait_type *condition_variable_wait; - system_condition_variable_signal_type *condition_variable_signal; - system_condition_variable_free_type *condition_variable_free; - system_memory_allocate_type *memory_allocate; - system_memory_set_protection_type *memory_set_protection; - system_memory_free_type *memory_free; - system_memory_annotation_type *memory_annotation; - system_show_mouse_cursor_type *show_mouse_cursor; - system_set_fullscreen_type *set_fullscreen; - system_is_fullscreen_type *is_fullscreen; - system_get_keyboard_modifiers_type *get_keyboard_modifiers; +system_get_path_type *get_path; +system_get_canonical_type *get_canonical; +system_get_file_list_type *get_file_list; +system_quick_file_attributes_type *quick_file_attributes; +system_load_handle_type *load_handle; +system_load_attributes_type *load_attributes; +system_load_file_type *load_file; +system_load_close_type *load_close; +system_save_file_type *save_file; +system_load_library_type *load_library; +system_release_library_type *release_library; +system_get_proc_type *get_proc; +system_now_time_type *now_time; +system_wake_up_timer_create_type *wake_up_timer_create; +system_wake_up_timer_release_type *wake_up_timer_release; +system_wake_up_timer_set_type *wake_up_timer_set; +system_signal_step_type *signal_step; +system_sleep_type *sleep; +system_get_clipboard_type *get_clipboard; +system_post_clipboard_type *post_clipboard; +system_set_clipboard_catch_all_type *set_clipboard_catch_all; +system_get_clipboard_catch_all_type *get_clipboard_catch_all; +system_cli_call_type *cli_call; +system_cli_begin_update_type *cli_begin_update; +system_cli_update_step_type *cli_update_step; +system_cli_end_update_type *cli_end_update; +system_open_color_picker_type *open_color_picker; +system_get_screen_scale_factor_type *get_screen_scale_factor; +system_thread_launch_type *thread_launch; +system_thread_join_type *thread_join; +system_thread_free_type *thread_free; +system_thread_get_id_type *thread_get_id; +system_acquire_global_frame_mutex_type *acquire_global_frame_mutex; +system_release_global_frame_mutex_type *release_global_frame_mutex; +system_mutex_make_type *mutex_make; +system_mutex_acquire_type *mutex_acquire; +system_mutex_release_type *mutex_release; +system_mutex_free_type *mutex_free; +system_condition_variable_make_type *condition_variable_make; +system_condition_variable_wait_type *condition_variable_wait; +system_condition_variable_signal_type *condition_variable_signal; +system_condition_variable_free_type *condition_variable_free; +system_memory_allocate_type *memory_allocate; +system_memory_set_protection_type *memory_set_protection; +system_memory_free_type *memory_free; +system_memory_annotation_type *memory_annotation; +system_show_mouse_cursor_type *show_mouse_cursor; +system_set_fullscreen_type *set_fullscreen; +system_is_fullscreen_type *is_fullscreen; +system_get_keyboard_modifiers_type *get_keyboard_modifiers; }; #if defined(STATIC_LINK_API) internal String_Const_u8 system_get_path(Arena* arena, System_Path_Code path_code); @@ -160,7 +169,10 @@ internal void system_wake_up_timer_release(Plat_Handle handle); internal void system_wake_up_timer_set(Plat_Handle handle, u32 time_milliseconds); internal void system_signal_step(u32 code); internal void system_sleep(u64 microseconds); +internal String_Const_u8 system_get_clipboard(Arena* arena); internal void system_post_clipboard(String_Const_u8 str); +internal void system_set_clipboard_catch_all(b32 enabled); +internal b32 system_get_clipboard_catch_all(void); internal b32 system_cli_call(Arena* scratch, char* path, char* script, CLI_Handles* cli_out); internal void system_cli_begin_update(CLI_Handles* cli); internal b32 system_cli_update_step(CLI_Handles* cli, char* dest, u32 max, u32* amount); @@ -209,7 +221,10 @@ global system_wake_up_timer_release_type *system_wake_up_timer_release = 0; global system_wake_up_timer_set_type *system_wake_up_timer_set = 0; global system_signal_step_type *system_signal_step = 0; global system_sleep_type *system_sleep = 0; +global system_get_clipboard_type *system_get_clipboard = 0; global system_post_clipboard_type *system_post_clipboard = 0; +global system_set_clipboard_catch_all_type *system_set_clipboard_catch_all = 0; +global system_get_clipboard_catch_all_type *system_get_clipboard_catch_all = 0; global system_cli_call_type *system_cli_call = 0; global system_cli_begin_update_type *system_cli_begin_update = 0; global system_cli_update_step_type *system_cli_update_step = 0; diff --git a/custom/generated/system_api_constructor.cpp b/custom/generated/system_api_constructor.cpp index 530774fe..99b42173 100644 --- a/custom/generated/system_api_constructor.cpp +++ b/custom/generated/system_api_constructor.cpp @@ -88,10 +88,22 @@ API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("sleep" api_param(arena, call, "u64", "microseconds"); } { +API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_clipboard"), string_u8_litexpr("String_Const_u8"), string_u8_litexpr("")); +api_param(arena, call, "Arena*", "arena"); +} +{ API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("post_clipboard"), string_u8_litexpr("void"), string_u8_litexpr("")); api_param(arena, call, "String_Const_u8", "str"); } { +API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_clipboard_catch_all"), string_u8_litexpr("void"), string_u8_litexpr("")); +api_param(arena, call, "b32", "enabled"); +} +{ +API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_clipboard_catch_all"), string_u8_litexpr("b32"), string_u8_litexpr("")); +(void)call; +} +{ API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("cli_call"), string_u8_litexpr("b32"), string_u8_litexpr("")); api_param(arena, call, "Arena*", "scratch"); api_param(arena, call, "char*", "path"); diff --git a/custom/generated/system_api_master_list.h b/custom/generated/system_api_master_list.h index 5e49a84d..c734dc81 100644 --- a/custom/generated/system_api_master_list.h +++ b/custom/generated/system_api_master_list.h @@ -16,7 +16,10 @@ api(system) function void wake_up_timer_release(Plat_Handle handle); api(system) function void wake_up_timer_set(Plat_Handle handle, u32 time_milliseconds); api(system) function void signal_step(u32 code); api(system) function void sleep(u64 microseconds); +api(system) function String_Const_u8 get_clipboard(Arena* arena); api(system) function void post_clipboard(String_Const_u8 str); +api(system) function void set_clipboard_catch_all(b32 enabled); +api(system) function b32 get_clipboard_catch_all(void); api(system) function b32 cli_call(Arena* scratch, char* path, char* script, CLI_Handles* cli_out); api(system) function void cli_begin_update(CLI_Handles* cli); api(system) function b32 cli_update_step(CLI_Handles* cli, char* dest, u32 max, u32* amount); diff --git a/docs/4ed_doc_custom_api_global.cpp b/docs/4ed_doc_custom_api_global.cpp index 3071886d..b2f9c763 100644 --- a/docs/4ed_doc_custom_api_global.cpp +++ b/docs/4ed_doc_custom_api_global.cpp @@ -171,8 +171,8 @@ doc_custom_api__global(Arena *arena, API_Definition *api_def, Doc_Cluster *clust //////////////////////////////// - if (begin_doc_call(arena, cluster, api_def, "clipboard_post", &func)){ - doc_function_brief(arena, &func, "Post a string to 4coder internal clipboard and the system clipboard"); + if (begin_doc_call(arena, cluster, api_def, "clipboard_post_internal_only", &func)){ + doc_function_brief(arena, &func, "Post a string to 4coder's internal list clipboard history; the string is not posted to the system's clipboard with this call"); // params Doc_Block *params = doc_function_begin_params(arena, &func); diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp index c83fe429..aa72d6cb 100644 --- a/platform_win32/win32_4ed.cpp +++ b/platform_win32/win32_4ed.cpp @@ -165,10 +165,10 @@ struct Win32_Vars{ String_Const_u8 binary_path; - Arena *clipboard_arena; - String_Const_u8 clipboard_contents; - b32 next_clipboard_is_self; + b8 clip_catch_all; + b8 next_clipboard_is_self; DWORD clipboard_sequence; + Plat_Handle clip_wakeup_timer; Arena clip_post_arena; String_Const_u8 clip_post; @@ -351,6 +351,51 @@ system_get_keyboard_modifiers_sig(){ // Clipboard // +internal String_Const_u8 +win32_read_clipboard_contents(Thread_Context *tctx, Arena *arena){ + Scratch_Block scratch(tctx); + + String_Const_u8 result = {}; + + b32 has_text = false; + b32 has_unicode = IsClipboardFormatAvailable(CF_UNICODETEXT); + if (!has_unicode){ + has_text = IsClipboardFormatAvailable(CF_TEXT); + } + b32 can_read = has_unicode || has_text; + + if (can_read){ + if (OpenClipboard(win32vars.window_handle)){ + if (has_unicode){ + HANDLE clip_data = GetClipboardData(CF_UNICODETEXT); + if (clip_data != 0){ + u16 *clip_16_ptr = (u16*)GlobalLock(clip_data); + if (clip_16_ptr != 0){ + String_Const_u16 clip_16 = SCu16(clip_16_ptr); + result = string_u8_from_string_u16(arena, clip_16, StringFill_NullTerminate).string; + } + } + GlobalUnlock(clip_data); + } + else{ + HANDLE clip_data = GetClipboardData(CF_TEXT); + if (clip_data != 0){ + char *clip_ascii_ptr = (char*)GlobalLock(clip_data); + if (clip_ascii_ptr != 0){ + String_Const_char clip_ascii = SCchar(clip_ascii_ptr); + result = string_u8_from_string_char(arena, clip_ascii, StringFill_NullTerminate).string; + } + } + GlobalUnlock(clip_data); + } + + CloseClipboard(); + } + } + + return(result); +} + internal void win32_post_clipboard(Arena *scratch, char *text, i32 len){ if (OpenClipboard(win32vars.window_handle)){ @@ -370,6 +415,27 @@ win32_post_clipboard(Arena *scratch, char *text, i32 len){ } } +internal +system_get_clipboard_sig(){ + String_Const_u8 result = {}; + DWORD new_number = GetClipboardSequenceNumber(); + if (new_number != win32vars.clipboard_sequence){ + win32vars.clipboard_sequence = new_number; + if (win32vars.next_clipboard_is_self){ + win32vars.next_clipboard_is_self = false; + } + else{ + for (i32 R = 0; R < 8; ++R){ + result = win32_read_clipboard_contents(win32vars.tctx, arena); + if (result.str == 0){ + break; + } + } + } + } + return(result); +} + internal system_post_clipboard_sig(){ Arena *arena = &win32vars.clip_post_arena; @@ -390,60 +456,15 @@ system_post_clipboard_sig(){ } } -internal b32 -win32_read_clipboard_contents(Arena *scratch){ - Temp_Memory temp = begin_temp(scratch); - - b32 result = false; - - b32 has_text = false; - b32 has_unicode = IsClipboardFormatAvailable(CF_UNICODETEXT); - if (!has_unicode){ - has_text = IsClipboardFormatAvailable(CF_TEXT); - } - b32 can_read = has_unicode || has_text; - - if (can_read){ - if (OpenClipboard(win32vars.window_handle)){ - result = true; - String_u8 contents = {}; - Arena *clip_arena = win32vars.clipboard_arena; - if (has_unicode){ - HANDLE clip_data = GetClipboardData(CF_UNICODETEXT); - if (clip_data != 0){ - u16 *clip_16_ptr = (u16*)GlobalLock(clip_data); - if (clip_16_ptr != 0){ - linalloc_clear(clip_arena); - String_Const_u16 clip_16 = SCu16(clip_16_ptr); - contents = string_u8_from_string_u16(clip_arena, clip_16, StringFill_NullTerminate); - } - } - GlobalUnlock(clip_data); - } - else{ - HANDLE clip_data = GetClipboardData(CF_TEXT); - if (clip_data != 0){ - char *clip_ascii_ptr = (char*)GlobalLock(clip_data); - if (clip_ascii_ptr != 0){ - linalloc_clear(clip_arena); - String_Const_char clip_ascii = SCchar(clip_ascii_ptr); - contents = string_u8_from_string_char(clip_arena, clip_ascii, StringFill_NullTerminate); - } - } - GlobalUnlock(clip_data); - } - - win32vars.clipboard_contents = contents.string; - - CloseClipboard(); - } - } - - end_temp(temp); - - return(result); +internal +system_set_clipboard_catch_all_sig(){ + win32vars.clip_catch_all = enabled?true:false; } +internal +system_get_clipboard_catch_all_sig(){ + return(win32vars.clip_catch_all); +} // // Command Line Exectuion @@ -1200,9 +1221,11 @@ win32_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ case WM_CLIPBOARDUPDATE: { - win32vars.got_useful_event = true; - LogEventLit(win32vars.log_string(M), scratch, 0, 0, system_thread_get_id(), - "new clipboard contents"); + if (win32vars.clip_catch_all){ + win32vars.got_useful_event = true; + LogEventLit(win32vars.log_string(M), scratch, 0, 0, system_thread_get_id(), + "new clipboard contents"); + } }break; case WM_CLOSE: @@ -1312,9 +1335,9 @@ win32_gl_create_window(HWND *wnd_out, HGLRC *context_out, DWORD style, RECT rect // NOTE(allen): Load wgl extensions #define LoadWGL(f,l) Stmnt((f) = (f##_Function*)wglGetProcAddress(#f); \ -(l) = (l) && win32_wgl_good((Void_Func*)(f));) - - b32 load_success = true; + (l) = (l) && win32_wgl_good((Void_Func*)(f));) + + b32 load_success = true; LoadWGL(wglCreateContextAttribsARB, load_success); LoadWGL(wglChoosePixelFormatARB, load_success); LoadWGL(wglGetExtensionsStringEXT, load_success); @@ -1417,9 +1440,9 @@ win32_gl_create_window(HWND *wnd_out, HGLRC *context_out, DWORD style, RECT rect /*0*/WGL_CONTEXT_MAJOR_VERSION_ARB, 3, /*2*/WGL_CONTEXT_MINOR_VERSION_ARB, 2, /*4*/WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB - #if GL_DEBUG_MODE +#if GL_DEBUG_MODE |WGL_CONTEXT_DEBUG_BIT_ARB - #endif +#endif , /*6*/WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB, /*8*/0 @@ -1652,24 +1675,17 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS win32_output_error_string(scratch, ErrorString_UseLog); } - win32vars.clipboard_arena = reserve_arena(win32vars.tctx); - + win32vars.clip_wakeup_timer = system_wake_up_timer_create(); win32vars.clipboard_sequence = GetClipboardSequenceNumber(); if (win32vars.clipboard_sequence == 0){ Scratch_Block scratch(win32vars.tctx, Scratch_Share); win32_post_clipboard(scratch, "", 0); - win32vars.clipboard_sequence = GetClipboardSequenceNumber(); win32vars.next_clipboard_is_self = 0; - if (win32vars.clipboard_sequence == 0){ OutputDebugStringA("Failure while initializing clipboard\n"); } } - else{ - Scratch_Block scratch(win32vars.tctx, Scratch_Share); - win32_read_clipboard_contents(scratch); - } win32_keycode_init(); @@ -1696,7 +1712,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS Scratch_Block scratch(win32vars.tctx, Scratch_Share); String_Const_u8 curdir = system_get_path(scratch, SystemPath_CurrentDirectory); curdir = string_mod_replace_character(curdir, '\\', '/'); - app.init(win32vars.tctx, &target, base_ptr, win32vars.clipboard_contents, curdir, custom); + app.init(win32vars.tctx, &target, base_ptr, curdir, custom); } // @@ -1835,6 +1851,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS // TODO(allen): CROSS REFERENCE WITH LINUX SPECIAL CODE "TIC898989" Win32_Input_Chunk input_chunk = win32vars.input_chunk; + Scratch_Block scratch(win32vars.tctx); Application_Step_Input input = {}; input.first_step = win32vars.first; @@ -1864,39 +1881,15 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS } // NOTE(allen): Frame Clipboard Input - block_zero_struct(&win32vars.clipboard_contents); - input.clipboard_changed = false; - if (win32vars.clipboard_sequence != 0){ - DWORD new_number = GetClipboardSequenceNumber(); - if (new_number != win32vars.clipboard_sequence){ - if (win32vars.next_clipboard_is_self){ - win32vars.next_clipboard_is_self = false; - } - else{ - for (i32 R = 0; R < 4; ++R){ - Scratch_Block scratch(win32vars.tctx, Scratch_Share); - if (win32_read_clipboard_contents(scratch)){ - input.clipboard_changed = true; - break; - } - } - } - win32vars.clipboard_sequence = new_number; - } + if (win32vars.clip_catch_all){ + input.clipboard = system_get_clipboard(scratch); } - input.clipboard = win32vars.clipboard_contents; win32vars.clip_post.size = 0; // NOTE(allen): Application Core Update - Application_Step_Result result = {}; - if (app.step != 0){ - result = app.step(win32vars.tctx, &target, base_ptr, &input); - } - else{ - //LOG("app.step == 0 -- skipping\n"); - } + Application_Step_Result result = app.step(win32vars.tctx, &target, base_ptr, &input); // NOTE(allen): Finish the Loop if (result.perform_kill){ @@ -1905,13 +1898,11 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS // NOTE(allen): Post New Clipboard Content if (win32vars.clip_post.size > 0){ - Scratch_Block scratch(win32vars.tctx, Scratch_Share); win32_post_clipboard(scratch, (char*)win32vars.clip_post.str, (i32)win32vars.clip_post.size); } // NOTE(allen): Switch to New Title if (result.has_new_title){ - Scratch_Block scratch(win32vars.tctx, Scratch_Share); SetWindowText_utf8(scratch, win32vars.window_handle, (u8*)result.title_string); } @@ -1959,6 +1950,9 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS if (result.animating){ system_schedule_step(0); } + else if (win32vars.clip_catch_all){ + system_wake_up_timer_set(win32vars.clip_wakeup_timer, 250); + } // NOTE(allen): sleep a bit to cool off :) system_mutex_release(win32vars.global_frame_mutex); diff --git a/ship_files/changes.txt b/ship_files/changes.txt index 9f20efcb..90c538c2 100644 --- a/ship_files/changes.txt +++ b/ship_files/changes.txt @@ -1,4 +1,12 @@ +4.1.4 + + clipboard is only read when the requests to, or when the collect-all mode is started via the command 'begin_clipboard_collection_mode' + + 'clear_clipboard' command + + in config.4coder the variable virtual_whitespace_regular_indent determines the number of space-widths to use as the regular indentation in a virtual whitespace layout + + Fix: tabs are measured with the correct amount of width for the user's settings + + Fix: virtual whitespace toggling works when the config initially diabled virtual whitespace + + Fix: never miss the most recent post to the clipboard on windows + 4.1.3 + Unkillable buffer setting + UI elements in listers and buttons can have different highlight backgrounds diff --git a/ship_files/config.4coder b/ship_files/config.4coder index cbf71c6b..77c9fcfa 100644 --- a/ship_files/config.4coder +++ b/ship_files/config.4coder @@ -24,6 +24,7 @@ show_line_number_margins = false; // Code Wrapping treat_as_code = ".cpp.c.hpp.h.cc.cs.java.rs.glsl.m.mm"; enable_virtual_whitespace = true; +virtual_whitespace_regular_indent = 4; enable_code_wrapping = true; // This only applies to code files in code-wrapping mode.