From 8a11860fc3c10a900e2e7adc6e9abb019df3e384 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Wed, 30 Oct 2019 16:27:37 -0700 Subject: [PATCH] Basics of programmable layout working --- 4ed_api_implementation.cpp | 25 +- 4ed_buffer.cpp | 36 +- 4ed_file.cpp | 29 +- 4ed_view.cpp | 17 +- custom/4coder_base_commands.cpp | 54 +- custom/4coder_default_framework.cpp | 5 + custom/4coder_default_hooks.cpp | 19 +- custom/4coder_default_include.cpp | 3 +- custom/4coder_helper.cpp | 38 ++ custom/4coder_layout_rule.cpp | 706 ++++++++++++++++------ custom/4coder_layout_rule.h | 32 + custom/4coder_types.h | 5 +- custom/generated/command_metadata.h | 208 +++---- custom/generated/custom_api.cpp | 8 +- custom/generated/custom_api.h | 20 +- custom/generated/custom_api_master_list.h | 4 +- platform_win32/win32_4ed.cpp | 5 +- todo.txt | 1 + 18 files changed, 818 insertions(+), 397 deletions(-) create mode 100644 custom/4coder_layout_rule.h diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index c9b7802d..36342ba4 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -412,20 +412,20 @@ buffer_pos_at_relative_xy(Application_Links *app, Buffer_ID buffer_id, return(result); } -api(custom) function Vec2_f32 -buffer_relative_xy_of_pos(Application_Links *app, Buffer_ID buffer_id, - f32 width, Face_ID face_id, - i64 base_line, i64 pos){ +api(custom) function Rect_f32 +buffer_relative_box_of_pos(Application_Links *app, Buffer_ID buffer_id, + f32 width, Face_ID face_id, + i64 base_line, i64 pos){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); - Vec2_f32 result = {}; + Rect_f32 result = {}; if (api_check_buffer(file)){ Face *face = font_set_face_from_id(&models->font_set, face_id); if (face != 0){ Layout_Function *layout_func = models->layout_func; - result = file_relative_xy_of_pos(app->tctx, models, file, - layout_func, width, face, - base_line, pos); + result = file_relative_box_of_pos(app->tctx, models, file, + layout_func, width, face, + base_line, pos); } } return(result); @@ -469,7 +469,6 @@ buffer_pos_from_relative_character(Application_Links *app, Buffer_ID buffer_id, } - api(custom) function f32 view_line_y_difference(Application_Links *app, View_ID view_id, i64 line_a, i64 line_b){ Models *models = (Models*)app->cmd_context; @@ -503,13 +502,13 @@ view_pos_at_relative_xy(Application_Links *app, View_ID view_id, i64 base_line, return(result); } -api(custom) function Vec2_f32 -view_relative_xy_of_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){ +api(custom) function Rect_f32 +view_relative_box_of_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); - Vec2_f32 result = {}; + Rect_f32 result = {}; if (api_check_view(view)){ - result = view_relative_xy_of_pos(app->tctx, models, view, base_line, pos); + result = view_relative_box_of_pos(app->tctx, models, view, base_line, pos); } return(result); } diff --git a/4ed_buffer.cpp b/4ed_buffer.cpp index a4789966..b9605afc 100644 --- a/4ed_buffer.cpp +++ b/4ed_buffer.cpp @@ -860,14 +860,14 @@ internal i64 buffer_layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){ i64 closest_match = 0; if (p.y < 0.f){ - closest_match = list.index_range.min; + closest_match = list.manifested_index_range.min; } else if (p.y >= list.height){ - closest_match = list.index_range.max + 1; + closest_match = list.manifested_index_range.max; } else{ if (0.f < p.x && p.x < max_f32){ - f32 bottom_extension = list.bottom_extension; + f32 bottom_padding = list.bottom_padding; f32 closest_x = -max_f32; for (Layout_Item_Block *block = list.first; block != 0; @@ -879,7 +879,7 @@ buffer_layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){ if (p.y < item->rect.y0){ goto double_break; } - if (item->rect.y1 + bottom_extension <= p.y){ + if (item->rect.y1 + bottom_padding <= p.y){ continue; } f32 dist0 = p.x - item->rect.x0; @@ -923,7 +923,7 @@ buffer_layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){ closest_match = prev_item->index; } else{ - closest_match = list.index_range.max; + closest_match = list.manifested_index_range.max; } } else{ @@ -950,7 +950,7 @@ buffer_layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){ closest_match = closest_item->index; } else{ - closest_match = list.index_range.min; + closest_match = list.manifested_index_range.min; } } } @@ -962,10 +962,10 @@ internal i64 buffer_layout_get_pos_at_character(Layout_Item_List list, i64 character){ i64 result = 0; if (character <= 0){ - result = list.index_range.min; + result = list.manifested_index_range.min; } else if (character >= list.character_count){ - result = list.index_range.max + 1; + result = list.manifested_index_range.max; } else{ i64 counter = 0; @@ -1025,12 +1025,12 @@ buffer_layout_get_first_with_index(Layout_Item_List list, i64 index){ return(result); } -internal Vec2_f32 -buffer_layout_xy_center_of_pos(Layout_Item_List list, i64 index){ - Vec2_f32 result = {}; +internal Rect_f32 +buffer_layout_box_of_pos(Layout_Item_List list, i64 index){ + Rect_f32 result = {}; Layout_Item *item = buffer_layout_get_first_with_index(list, index); if (item != 0){ - result = rect_center(item->rect); + result = item->rect; } return(result); } @@ -1038,12 +1038,11 @@ buffer_layout_xy_center_of_pos(Layout_Item_List list, i64 index){ internal i64 buffer_layout_character_from_pos(Layout_Item_List list, i64 index){ i64 result = 0; - i64 character_count = 0; i64 prev_index = -1; - if (index <= list.index_range.first){ + if (index <= list.manifested_index_range.first){ result = 0; } - else if (index > list.index_range.one_past_last){ + else if (index > list.manifested_index_range.one_past_last){ result = list.character_count - 1; } else{ @@ -1053,13 +1052,12 @@ buffer_layout_character_from_pos(Layout_Item_List list, i64 index){ Layout_Item *item = node->items; i64 count = node->count; for (i64 i = 0; i < count; i += 1, item += 1){ - if (item->index == index){ - result = character_count; + if (item->index >= index){ goto double_break; } - if (item->index != prev_index){ + if (item->index > prev_index){ prev_index = item->index; - character_count += 1; + result += 1; } } } diff --git a/4ed_file.cpp b/4ed_file.cpp index 6cf50875..be144879 100644 --- a/4ed_file.cpp +++ b/4ed_file.cpp @@ -432,20 +432,35 @@ file_pos_at_relative_xy(Thread_Context *tctx, Models *models, Editing_File *file return(buffer_layout_nearest_pos_to_xy(line, relative_xy)); } -internal Vec2_f32 -file_relative_xy_of_pos(Thread_Context *tctx, Models *models, Editing_File *file, - Layout_Function *layout_func, f32 width, Face *face, - i64 base_line, i64 pos){ +internal Rect_f32 +file_relative_box_of_pos(Thread_Context *tctx, Models *models, Editing_File *file, + Layout_Function *layout_func, f32 width, Face *face, + i64 base_line, i64 pos){ i64 line_number = buffer_get_line_index(&file->state.buffer, pos) + 1; Layout_Item_List line = file_get_line_layout(tctx, models, file, layout_func, width, face, line_number); - Vec2_f32 result = buffer_layout_xy_center_of_pos(line, pos); - result.y += file_line_y_difference(tctx, models, file, - layout_func, width, face, line_number, base_line); + Rect_f32 result = buffer_layout_box_of_pos(line, pos); + + f32 y_difference = file_line_y_difference(tctx, models, file, + layout_func, width, face, + line_number, base_line); + result.y0 += y_difference; + result.y1 += y_difference; + return(result); } +function Vec2_f32 +file_relative_xy_of_pos(Thread_Context *tctx, Models *models, Editing_File *file, + Layout_Function *layout_func, f32 width, Face *face, + i64 base_line, i64 pos){ + Rect_f32 rect = file_relative_box_of_pos(tctx, models, file, + layout_func, width, face, + base_line, pos); + return(rect_center(rect)); +} + internal Buffer_Point file_normalize_buffer_point(Thread_Context *tctx, Models *models, Editing_File *file, Layout_Function *layout_func, f32 width, Face *face, diff --git a/4ed_view.cpp b/4ed_view.cpp index 264399ba..6198118d 100644 --- a/4ed_view.cpp +++ b/4ed_view.cpp @@ -226,15 +226,22 @@ view_pos_at_relative_xy(Thread_Context *tctx, Models *models, View *view, layout_func, width, face, base_line, relative_xy)); } -internal Vec2_f32 -view_relative_xy_of_pos(Thread_Context *tctx, Models *models, View *view, - i64 base_line, i64 pos){ +internal Rect_f32 +view_relative_box_of_pos(Thread_Context *tctx, Models *models, View *view, + i64 base_line, i64 pos){ Editing_File *file = view->file; Face *face = file_get_face(models, file); f32 width = view_width(tctx, models, view); Layout_Function *layout_func = view_get_layout_func(view); - return(file_relative_xy_of_pos(tctx, models, file, - layout_func, width, face, base_line, pos)); + return(file_relative_box_of_pos(tctx, models, file, + layout_func, width, face, base_line, pos)); +} + +internal Vec2_f32 +view_relative_xy_of_pos(Thread_Context *tctx, Models *models, View *view, + i64 base_line, i64 pos){ + Rect_f32 rect = view_relative_box_of_pos(tctx, models, view, base_line, pos); + return(rect_center(rect)); } internal Buffer_Point diff --git a/custom/4coder_base_commands.cpp b/custom/4coder_base_commands.cpp index 8bb14721..23721540 100644 --- a/custom/4coder_base_commands.cpp +++ b/custom/4coder_base_commands.cpp @@ -167,9 +167,6 @@ CUSTOM_DOC("Delete characters between the cursor position and the first alphanum push_boundary_list(scratch, boundary_alpha_numeric)); } -#define backspace_word backspace_alpha_numeric_boundary -#define delete_word delete_alpha_numeric_boundary - function void current_view_snipe_delete(Application_Links *app, Scan_Direction direction, Boundary_Function_List funcs){ View_ID view = get_active_view(app, Access_ReadWriteVisible); @@ -299,17 +296,29 @@ move_vertical_pixels(Application_Links *app, f32 pixels){ } internal void -move_vertical_lines(Application_Links *app, View_ID view, f32 lines){ - Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible); - Face_ID face_id = get_face_id(app, buffer); - Face_Metrics metrics = get_face_metrics(app, face_id); - - f32 delta_y = lines*metrics.line_height; - move_vertical_pixels(app, delta_y); +move_vertical_lines(Application_Links *app, View_ID view, i64 lines){ + if (lines > 0){ + for (i64 i = 0; i < lines; i += 1){ + i64 pos = view_get_cursor_pos(app, view); + Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos)); + Rect_f32 box = view_relative_box_of_pos(app, view, cursor.line, cursor.pos); + f32 half_height = rect_height(box)*0.5f; + move_vertical_pixels(app, half_height + 2.f); + } + } + else{ + for (i64 i = 0; i > lines; i -= 1){ + i64 pos = view_get_cursor_pos(app, view); + Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos)); + Rect_f32 box = view_relative_box_of_pos(app, view, cursor.line, cursor.pos); + f32 half_height = rect_height(box)*0.5f; + move_vertical_pixels(app, -half_height - 2.f); + } + } } internal void -move_vertical_lines(Application_Links *app, f32 lines){ +move_vertical_lines(Application_Links *app, i64 lines){ View_ID view = get_active_view(app, Access_ReadVisible); move_vertical_lines(app, view, lines); } @@ -323,25 +332,25 @@ get_page_jump(Application_Links *app, View_ID view){ CUSTOM_COMMAND_SIG(move_up) CUSTOM_DOC("Moves the cursor up one line.") { - move_vertical_lines(app, -1.f); + move_vertical_lines(app, -1); } CUSTOM_COMMAND_SIG(move_down) CUSTOM_DOC("Moves the cursor down one line.") { - move_vertical_lines(app, 1.f); + move_vertical_lines(app, 1); } CUSTOM_COMMAND_SIG(move_up_10) CUSTOM_DOC("Moves the cursor up ten lines.") { - move_vertical_lines(app, -10.f); + move_vertical_lines(app, -10); } CUSTOM_COMMAND_SIG(move_down_10) CUSTOM_DOC("Moves the cursor down ten lines.") { - move_vertical_lines(app, 10.f); + move_vertical_lines(app, 10); } CUSTOM_COMMAND_SIG(move_down_textual) @@ -431,11 +440,7 @@ CUSTOM_COMMAND_SIG(move_left) CUSTOM_DOC("Moves the cursor one character to the left.") { View_ID view = get_active_view(app, Access_ReadVisible); - i64 pos = view_get_cursor_pos(app, view); - Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos)); - i64 character = view_relative_character_from_pos(app, view, cursor.line, pos); - i64 new_pos = view_pos_from_relative_character(app, view, cursor.line, character - 1); - view_set_cursor_and_preferred_x(app, view, seek_pos(new_pos)); + view_set_cursor_by_character_delta(app, view, -1); no_mark_snap_to_cursor_if_shift(app, view); } @@ -443,11 +448,7 @@ CUSTOM_COMMAND_SIG(move_right) CUSTOM_DOC("Moves the cursor one character to the right.") { View_ID view = get_active_view(app, Access_ReadVisible); - i64 pos = view_get_cursor_pos(app, view); - Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos)); - i64 character = view_relative_character_from_pos(app, view, cursor.line, pos); - i64 new_pos = view_pos_from_relative_character(app, view, cursor.line, character + 1); - view_set_cursor_and_preferred_x(app, view, seek_pos(new_pos)); + view_set_cursor_by_character_delta(app, view, 1); no_mark_snap_to_cursor_if_shift(app, view); } @@ -2023,8 +2024,7 @@ CUSTOM_DOC("Loads all the theme files in the theme folder, replacing duplicates CUSTOM_COMMAND_SIG(open_in_other) CUSTOM_DOC("Interactively opens a file in the other panel.") { - change_active_panel(app); - interactive_open_or_new(app); + change_active_panel_send_command(app, interactive_open_or_new); } CUSTOM_COMMAND_SIG(default_file_externally_modified) diff --git a/custom/4coder_default_framework.cpp b/custom/4coder_default_framework.cpp index 90da0819..345435fa 100644 --- a/custom/4coder_default_framework.cpp +++ b/custom/4coder_default_framework.cpp @@ -267,6 +267,11 @@ view_buffer_set(Application_Links *app, Buffer_ID *buffers, i32 *positions, i32 //////////////////////////////// +function void +change_active_panel_send_command(Application_Links *app, Custom_Command_Function *custom_func){ + NotImplemented; +} + CUSTOM_COMMAND_SIG(change_active_panel) CUSTOM_DOC("Change the currently active panel, moving to the panel with the next highest view_id.") { diff --git a/custom/4coder_default_hooks.cpp b/custom/4coder_default_hooks.cpp index a2628cf4..e164f50b 100644 --- a/custom/4coder_default_hooks.cpp +++ b/custom/4coder_default_hooks.cpp @@ -282,10 +282,13 @@ default_buffer_region(Application_Links *app, View_ID view_id, Rect_f32 region){ } function void -default_render_buffer(Application_Links *app, View_ID view_id, b32 is_active_view, +default_render_buffer(Application_Links *app, View_ID view_id, Face_ID face_id, Buffer_ID buffer, Text_Layout_ID text_layout_id, Rect_f32 rect){ ProfileScope(app, "render buffer"); + + View_ID active_view = get_active_view(app, Access_Always); + b32 is_active_view = (active_view == view_id); Rect_f32 prev_clip = draw_set_clip(app, rect); // NOTE(allen): Token colorizing @@ -304,7 +307,8 @@ default_render_buffer(Application_Links *app, View_ID view_id, b32 is_active_vie } } - i64 cursor_pos = view_get_cursor_pos(app, view_id); + i64 cursor_pos = view_correct_cursor(app, view_id); + view_correct_mark(app, view_id); // NOTE(allen): Scope highlight if (global_config.use_scope_highlight){ @@ -352,7 +356,8 @@ default_render_buffer(Application_Links *app, View_ID view_id, b32 is_active_vie } // NOTE(allen): Cursor shape - f32 cursor_roundness = 4.f; + Face_Metrics metrics = get_face_metrics(app, face_id); + f32 cursor_roundness = (metrics.normal_advance*0.5f)*0.9f; f32 mark_thickness = 2.f; // NOTE(allen): Cursor @@ -450,7 +455,7 @@ default_render_caller(Application_Links *app, Frame_Info frame_info, View_ID vie } // NOTE(allen): draw the buffer - default_render_buffer(app, view_id, is_active_view, + default_render_buffer(app, view_id, face_id, buffer, text_layout_id, region); @@ -932,7 +937,11 @@ set_all_default_hooks(Application_Links *app){ set_custom_hook(app, HookID_BufferEditRange, default_buffer_edit_range); set_custom_hook(app, HookID_BufferRegion, default_buffer_region); - set_custom_hook(app, HookID_Layout, layout_wrap_whitespace); + //set_custom_hook(app, HookID_Layout, layout_unwrapped); + //set_custom_hook(app, HookID_Layout, layout_wrap_anywhere); + //set_custom_hook(app, HookID_Layout, layout_wrap_whitespace); + set_custom_hook(app, HookID_Layout, layout_generic_virtual_whitespace); + //set_custom_hook(app, HookID_Layout, layout_unwrapped_small_blank_lines); } // BOTTOM diff --git a/custom/4coder_default_include.cpp b/custom/4coder_default_include.cpp index bd21e883..b423c56e 100644 --- a/custom/4coder_default_include.cpp +++ b/custom/4coder_default_include.cpp @@ -32,6 +32,7 @@ #include "4coder_string_match.h" #include "4coder_helper.h" #include "4coder_delta_rule.h" +#include "4coder_layout_rule.h" #include "4coder_draw.h" #include "4coder_insertion.h" #include "4coder_lister_base.h" @@ -75,12 +76,12 @@ #include "4coder_default_framework_variables.cpp" #include "4coder_helper.cpp" #include "4coder_delta_rule.cpp" +#include "4coder_layout_rule.cpp" #include "4coder_fancy.cpp" #include "4coder_draw.cpp" #include "4coder_font_helper.cpp" #include "4coder_config.cpp" #include "4coder_default_framework.cpp" -#include "4coder_layout_rule.cpp" #include "4coder_lister_base.cpp" #include "4coder_base_commands.cpp" #include "4coder_insertion.cpp" diff --git a/custom/4coder_helper.cpp b/custom/4coder_helper.cpp index 2a90131a..1d1ad81c 100644 --- a/custom/4coder_helper.cpp +++ b/custom/4coder_helper.cpp @@ -183,6 +183,12 @@ view_zero_scroll(Application_Links *app, View_ID view){ view_set_buffer_scroll(app, view, scroll, SetBufferScroll_SnapCursorIntoView); } +internal Vec2_f32 +view_relative_xy_of_pos(Application_Links *app, View_ID view, i64 base_line, i64 pos){ + Rect_f32 rect = view_relative_box_of_pos(app, view, base_line, pos); + return(rect_center(rect)); +} + internal void view_set_cursor_and_preferred_x(Application_Links *app, View_ID view, Buffer_Seek seek){ view_set_cursor(app, view, seek); @@ -191,6 +197,38 @@ view_set_cursor_and_preferred_x(Application_Links *app, View_ID view, Buffer_See view_set_preferred_x(app, view, p.x); } +function i64 +view_set_pos_by_character_delta(Application_Links *app, View_ID view, i64 pos, i64 character_delta){ + Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos)); + i64 character = view_relative_character_from_pos(app, view, cursor.line, cursor.pos); + i64 new_pos = view_pos_from_relative_character(app, view, cursor.line, character + character_delta); + return(new_pos); +} + +function i64 +view_set_cursor_by_character_delta(Application_Links *app, View_ID view, i64 character_delta){ + i64 pos = view_get_cursor_pos(app, view); + i64 new_pos = view_set_pos_by_character_delta(app, view, pos, character_delta); + view_set_cursor_and_preferred_x(app, view, seek_pos(new_pos)); + return(new_pos); +} + +function i64 +view_correct_cursor(Application_Links *app, View_ID view){ + i64 pos = view_get_cursor_pos(app, view); + i64 new_pos = view_set_pos_by_character_delta(app, view, pos, 0); + view_set_cursor(app, view, seek_pos(new_pos)); + return(new_pos); +} + +function i64 +view_correct_mark(Application_Links *app, View_ID view){ + i64 pos = view_get_mark_pos(app, view); + i64 new_pos = view_set_pos_by_character_delta(app, view, pos, 0); + view_set_mark(app, view, seek_pos(new_pos)); + return(new_pos); +} + function Vec2_f32 buffer_point_difference(Application_Links *app, Buffer_ID buffer, f32 width, Face_ID face_id, Buffer_Point a, Buffer_Point b){ diff --git a/custom/4coder_layout_rule.cpp b/custom/4coder_layout_rule.cpp index b60090e6..e1218c20 100644 --- a/custom/4coder_layout_rule.cpp +++ b/custom/4coder_layout_rule.cpp @@ -4,6 +4,25 @@ // TOP +function i64 +layout_index_from_ptr(u8 *ptr, u8 *string_base, i64 index_base){ + return((i64)(ptr - string_base) + index_base); +} + +function Layout_Item_List +get_empty_item_list(Range_i64 input_range){ + Layout_Item_List list = {}; + list.input_index_range = input_range; + list.manifested_index_range = Ii64_neg_inf; + return(list); +} + +function void +layout_item_list_finish(Layout_Item_List *list, f32 bottom_padding){ + list->bottom_padding = bottom_padding; + list->height += bottom_padding; +} + function void layout_write(Arena *arena, Layout_Item_List *list, i64 index, u32 codepoint, Layout_Item_Flag flags, Rect_f32 rect){ @@ -30,10 +49,13 @@ layout_write(Arena *arena, Layout_Item_List *list, } list->total_count += 1; - if (index > list->index_range.max){ + if (index < list->manifested_index_range.min){ + list->manifested_index_range.min = index; + } + if (index > list->manifested_index_range.max){ block->character_count += 1; list->character_count += 1; - list->index_range.max = index; + list->manifested_index_range.max = index; } item->index = index; @@ -43,147 +65,420 @@ layout_write(Arena *arena, Layout_Item_List *list, list->height = max(list->height, rect.y1); } +//// + +function Newline_Layout_Vars +get_newline_layout_vars(void){ + Newline_Layout_Vars result = {}; + result.newline_character_index = -1; + return(result); +} + +function void +newline_layout_consume_CR(Newline_Layout_Vars *vars, i64 index){ + if (!vars->consuming_newline_characters){ + vars->consuming_newline_characters = true; + vars->newline_character_index = index; + } + vars->prev_did_emit_newline = false; +} + +function i64 +newline_layout_consume_LF(Newline_Layout_Vars *vars, i64 index){ + if (!vars->consuming_newline_characters){ + vars->newline_character_index = index; + } + vars->prev_did_emit_newline = true; + vars->consuming_newline_characters = false; + return(vars->newline_character_index); +} + +function void +newline_layout_consume_default(Newline_Layout_Vars *vars){ + vars->consuming_newline_characters = false; + vars->prev_did_emit_newline = false; +} + +function b32 +newline_layout_consume_finish(Newline_Layout_Vars *vars){ + return((!vars->prev_did_emit_newline)); +} + +//// + +#if 0 +function void +lr_tb_write_blank(LefRig_TopBot_Layout_Vars *vars, + Arena *arena, Layout_Item_List *list, i64 index){ + f32 advance = vars->metrics->space_advance; + lr_tb_write_blank_dim(vars, V2f32(advance, vars->metrics->text_height), + arena, list, index); +} +#endif + +function LefRig_TopBot_Layout_Vars +get_lr_tb_layout_vars(Face_Advance_Map *advance_map, Face_Metrics *metrics, f32 width){ + f32 text_height = metrics->text_height; + f32 line_height = metrics->line_height; + + LefRig_TopBot_Layout_Vars result = {}; + result.advance_map = advance_map; + result.metrics = metrics; + result.line_to_text_shift = text_height - line_height; + + result.blank_dim = V2f32(metrics->space_advance, text_height); + + result.line_y = line_height; + result.text_y = text_height; + result.width = width; + return(result); +} + +function b32 +lr_tb_crosses_width(LefRig_TopBot_Layout_Vars *vars, f32 advance, f32 width){ + return(vars->p.x + advance > width); +} + +function b32 +lr_tb_crosses_width(LefRig_TopBot_Layout_Vars *vars, f32 advance){ + return(vars->p.x + advance > vars->width); +} + +function f32 +lr_tb_advance(LefRig_TopBot_Layout_Vars *vars, u32 codepoint){ + return(font_get_glyph_advance(vars->advance_map, vars->metrics, codepoint)); +} + +function void +lr_tb_write_with_advance(LefRig_TopBot_Layout_Vars *vars, f32 advance, + Arena *arena, Layout_Item_List *list, i64 index, u32 codepoint){ + if (codepoint == '\t'){ + codepoint = ' '; + } + vars->p.x = f32_ceil32(vars->p.x); + f32 next_x = vars->p.x + advance; + layout_write(arena, list, index, codepoint, 0, + Rf32(vars->p, V2f32(next_x, vars->text_y))); + vars->p.x = next_x; +} + +function void +lr_tb_write(LefRig_TopBot_Layout_Vars *vars, + Arena *arena, Layout_Item_List *list, i64 index, u32 codepoint){ + f32 advance = lr_tb_advance(vars, codepoint); + lr_tb_write_with_advance(vars, advance, arena, list, index, codepoint); +} + +function f32 +lr_tb_advance_byte(LefRig_TopBot_Layout_Vars *vars){ + return(vars->metrics->byte_advance); +} + +function void +lr_tb_write_byte_with_advance(LefRig_TopBot_Layout_Vars *vars, f32 advance, + Arena *arena, Layout_Item_List *list, i64 index, u8 byte){ + Face_Metrics *metrics = vars->metrics; + + f32 final_next_x = vars->p.x + advance; + u32 lo = ((u32)byte)&0xF; + u32 hi = ((u32)byte >> 4)&0xF; + + Vec2_f32 p = vars->p; + p.x = f32_ceil32(p.x); + f32 next_x = p.x + metrics->byte_sub_advances[0]; + f32 text_y = vars->text_y; + + layout_write(arena, list, index, '\\', 0, + Rf32(p, V2f32(next_x, text_y))); + p.x = next_x; + next_x += metrics->byte_sub_advances[1]; + layout_write(arena, list, index, integer_symbols[hi], 0, + Rf32(p, V2f32(next_x, text_y))); + p.x = next_x; + next_x += metrics->byte_sub_advances[2]; + layout_write(arena, list, index, integer_symbols[lo], 0, + Rf32(p, V2f32(next_x, text_y))); + + vars->p.x = final_next_x; +} + +function void +lr_tb_write_byte(LefRig_TopBot_Layout_Vars *vars, + Arena *arena, Layout_Item_List *list, i64 index, u8 byte){ + lr_tb_write_byte_with_advance(vars, vars->metrics->byte_advance, + arena, list, index, byte); +} + +function void +lr_tb_write_blank_dim(LefRig_TopBot_Layout_Vars *vars, Vec2_f32 dim, + Arena *arena, Layout_Item_List *list, i64 index){ + layout_write(arena, list, index, ' ', 0, Rf32_xy_wh(vars->p, dim)); + vars->p.x += dim.x; +} + +function void +lr_tb_write_blank(LefRig_TopBot_Layout_Vars *vars, + Arena *arena, Layout_Item_List *list, i64 index){ + lr_tb_write_blank_dim(vars, vars->blank_dim, arena, list, index); +} + +function void +lr_tb_next_line(LefRig_TopBot_Layout_Vars *vars){ + vars->p.x = 0.f; + vars->p.y = vars->line_y; + vars->line_y += vars->metrics->line_height; + vars->text_y = vars->line_y + vars->line_to_text_shift; +} + +function void +lr_tb_next_line_padded(LefRig_TopBot_Layout_Vars *vars, f32 top, f32 bot){ + vars->p.x = 0.f; + vars->p.y = vars->line_y + top; + vars->line_y += top + vars->metrics->line_height; + vars->text_y = vars->line_y + vars->line_to_text_shift; + vars->line_y += bot; +} + +function void +lr_tb_advance_x_without_item(LefRig_TopBot_Layout_Vars *vars, f32 advance){ + vars->p.x += advance; +} + +//////////////////////////////// + function Layout_Item_List -layout_wrap_anywhere(Application_Links *app, Arena *arena, Buffer_ID buffer, - Range_i64 range, Face_ID face, f32 width){ +layout_unwrapped_small_blank_lines(Application_Links *app, Arena *arena, + Buffer_ID buffer, Range_i64 range, Face_ID face, + f32 width){ + Layout_Item_List list = get_empty_item_list(range); + Scratch_Block scratch(app); - - Layout_Item_List list = {}; - list.index_range.first = range.first; - list.index_range.one_past_last = range.first - 1; - String_Const_u8 text = push_buffer_range(app, scratch, buffer, range); Face_Advance_Map advance_map = get_face_advance_map(app, face); Face_Metrics metrics = get_face_metrics(app, face); - f32 line_height = metrics.line_height; - f32 text_height = metrics.text_height; - f32 line_to_text_shift = text_height - line_height; - f32 space_advance = metrics.space_advance; + LefRig_TopBot_Layout_Vars pos_vars = get_lr_tb_layout_vars(&advance_map, &metrics, width); + + pos_vars.blank_dim = V2f32(metrics.space_advance, metrics.text_height*0.5f); if (text.size == 0){ - f32 next_x = space_advance; - layout_write(arena, &list, range.first, ' ', 0, - Rf32(V2(0.f, 0.f), V2f32(next_x, text_height))); + lr_tb_write_blank(&pos_vars, arena, &list, range.start); } else{ - Vec2_f32 p = {}; - f32 line_y = line_height; - f32 text_y = text_height; + Newline_Layout_Vars newline_vars = get_newline_layout_vars(); - i64 index = range.first; + b32 all_whitespace = true; + for (umem i = 0; i < text.size; i += 1){ + if (!character_is_whitespace(text.str[i])){ + all_whitespace = false; + break; + } + } - b32 first_of_the_line = true; - b32 consuming_newline_characters = false; - i64 newline_character_index = -1; - b32 prev_did_emit_newline = false; + if (!all_whitespace){ + pos_vars.blank_dim.y = metrics.text_height; + } u8 *ptr = text.str; u8 *end_ptr = ptr + text.size; for (;ptr < end_ptr;){ Character_Consume_Result consume = utf8_consume(ptr, (umem)(end_ptr - ptr)); - u32 render_codepoint = consume.codepoint; - b32 emit_newline = false; + + i64 index = layout_index_from_ptr(ptr, text.str, range.first); switch (consume.codepoint){ case '\t': { - render_codepoint = ' '; - }//fallthrough; + newline_layout_consume_default(&newline_vars); + Vec2_f32 dim = pos_vars.blank_dim; + dim.x = lr_tb_advance(&pos_vars, '\t'); + lr_tb_write_blank_dim(&pos_vars, dim, + arena, &list, index); + }break; + + case ' ': + case '\f': + case '\v': + { + newline_layout_consume_default(&newline_vars); + lr_tb_write_blank(&pos_vars, arena, &list, index); + }break; + default: { - f32 advance = font_get_glyph_advance(&advance_map, &metrics, - consume.codepoint); - f32 next_x = p.x + advance; - if (!first_of_the_line && next_x > width){ - p.y = line_y; - p.x = 0.f; - line_y += line_height; - text_y = line_y + line_to_text_shift; - next_x = advance; + newline_layout_consume_default(&newline_vars); + lr_tb_write(&pos_vars, arena, &list, index, consume.codepoint); + }break; + + case '\r': + { + newline_layout_consume_CR(&newline_vars, index); + }break; + + case '\n': + { + i64 newline_index = newline_layout_consume_LF(&newline_vars, index); + lr_tb_write_blank(&pos_vars, arena, &list, newline_index); + lr_tb_next_line(&pos_vars); + }break; + + case max_u32: + { + newline_layout_consume_default(&newline_vars); + lr_tb_write_byte(&pos_vars, arena, &list, index, *ptr); + }break; + } + + ptr += consume.inc; + } + + if (newline_layout_consume_finish(&newline_vars)){ + i64 index = layout_index_from_ptr(ptr, text.str, range.first); + lr_tb_write_blank(&pos_vars, arena, &list, index); + } + } + + layout_item_list_finish(&list, -pos_vars.line_to_text_shift); + + return(list); +} + +function Layout_Item_List +layout_unwrapped(Application_Links *app, Arena *arena, Buffer_ID buffer, + Range_i64 range, Face_ID face, f32 width){ + Layout_Item_List list = get_empty_item_list(range); + + Scratch_Block scratch(app); + String_Const_u8 text = push_buffer_range(app, scratch, buffer, range); + + Face_Advance_Map advance_map = get_face_advance_map(app, face); + Face_Metrics metrics = get_face_metrics(app, face); + LefRig_TopBot_Layout_Vars pos_vars = get_lr_tb_layout_vars(&advance_map, &metrics, width); + + if (text.size == 0){ + lr_tb_write_blank(&pos_vars, arena, &list, range.first); + } + else{ + Newline_Layout_Vars newline_vars = get_newline_layout_vars(); + + u8 *ptr = text.str; + u8 *end_ptr = ptr + text.size; + for (;ptr < end_ptr;){ + Character_Consume_Result consume = utf8_consume(ptr, (umem)(end_ptr - ptr)); + + i64 index = layout_index_from_ptr(ptr, text.str, range.first); + switch (consume.codepoint){ + default: + { + newline_layout_consume_default(&newline_vars); + lr_tb_write(&pos_vars, arena, &list, index, consume.codepoint); + }break; + + case '\r': + { + newline_layout_consume_CR(&newline_vars, index); + }break; + + case '\n': + { + i64 newline_index = newline_layout_consume_LF(&newline_vars, index); + lr_tb_write_blank(&pos_vars, arena, &list, newline_index); + lr_tb_next_line(&pos_vars); + }break; + + case max_u32: + { + newline_layout_consume_default(&newline_vars); + lr_tb_write_byte(&pos_vars, arena, &list, index, *ptr); + }break; + } + + ptr += consume.inc; + } + + if (newline_layout_consume_finish(&newline_vars)){ + i64 index = layout_index_from_ptr(ptr, text.str, range.first); + lr_tb_write_blank(&pos_vars, arena, &list, index); + } + } + + layout_item_list_finish(&list, -pos_vars.line_to_text_shift); + + return(list); +} + +function Layout_Item_List +layout_wrap_anywhere(Application_Links *app, Arena *arena, Buffer_ID buffer, + Range_i64 range, Face_ID face, f32 width){ + Scratch_Block scratch(app); + + Layout_Item_List list = get_empty_item_list(range); + + String_Const_u8 text = push_buffer_range(app, scratch, buffer, range); + + Face_Advance_Map advance_map = get_face_advance_map(app, face); + Face_Metrics metrics = get_face_metrics(app, face); + LefRig_TopBot_Layout_Vars pos_vars = get_lr_tb_layout_vars(&advance_map, &metrics, width); + + if (text.size == 0){ + lr_tb_write_blank(&pos_vars, arena, &list, range.first); + } + else{ + b32 first_of_the_line = true; + Newline_Layout_Vars newline_vars = get_newline_layout_vars(); + + u8 *ptr = text.str; + u8 *end_ptr = ptr + text.size; + for (;ptr < end_ptr;){ + Character_Consume_Result consume = utf8_consume(ptr, (umem)(end_ptr - ptr)); + i64 index = layout_index_from_ptr(ptr, text.str, range.first); + switch (consume.codepoint){ + default: + { + newline_layout_consume_default(&newline_vars); + f32 advance = lr_tb_advance(&pos_vars, consume.codepoint); + if (!first_of_the_line && lr_tb_crosses_width(&pos_vars, advance)){ + lr_tb_next_line(&pos_vars); } - layout_write(arena, &list, index, - render_codepoint, 0, - Rf32(p, V2f32(next_x, text_y))); - p.x = next_x; - ptr += consume.inc; - index += consume.inc; + lr_tb_write_with_advance(&pos_vars, advance, + arena, &list, index, consume.codepoint); first_of_the_line = false; }break; case '\r': { - if (!consuming_newline_characters){ - consuming_newline_characters = true; - newline_character_index = index; - } - ptr += 1; - index += 1; + newline_layout_consume_CR(&newline_vars, index); }break; case '\n': { - if (!consuming_newline_characters){ - consuming_newline_characters = true; - newline_character_index = index; - } - emit_newline = true; - ptr += 1; - index += 1; + i64 newline_index = newline_layout_consume_LF(&newline_vars, index); + lr_tb_write_blank(&pos_vars, arena, &list, newline_index); + lr_tb_next_line(&pos_vars); + first_of_the_line = true; }break; case max_u32: { - f32 next_x = p.x + metrics.byte_advance; - if (!first_of_the_line && next_x > width){ - p.y = line_y; - p.x = 0.f; - line_y += line_height; - text_y = line_y + line_to_text_shift; - next_x = p.x + metrics.byte_advance; + newline_layout_consume_default(&newline_vars); + f32 advance = lr_tb_advance_byte(&pos_vars); + if (!first_of_the_line && lr_tb_crosses_width(&pos_vars, advance)){ + lr_tb_next_line(&pos_vars); } - u32 v = *ptr; - u32 lo = v&0xF; - u32 hi = (v >> 4)&0xF; - f32 advance = metrics.byte_sub_advances[0]; - layout_write(arena, &list, index, '\\', 0, - Rf32(p, V2f32(p.x + advance, text_y))); - p.x += advance; - advance = metrics.byte_sub_advances[1]; - layout_write(arena, &list, index, integer_symbols[hi], 0, - Rf32(p, V2f32(p.x + advance, text_y))); - p.x += advance; - advance = metrics.byte_sub_advances[2]; - layout_write(arena, &list, index, integer_symbols[lo], 0, - Rf32(p, V2f32(p.x + advance, text_y))); - p.x = next_x; - ptr += 1; - index += 1; + lr_tb_write_byte_with_advance(&pos_vars, advance, + arena, &list, index, *ptr); first_of_the_line = false; }break; } - - prev_did_emit_newline = false; - if (emit_newline){ - f32 next_x = p.x + space_advance; - layout_write(arena, &list, newline_character_index, ' ', 0, - Rf32(p, V2f32(next_x, text_y))); - p.y = line_y; - p.x = 0.f; - line_y += line_height; - text_y = line_y + line_to_text_shift; - first_of_the_line = true; - prev_did_emit_newline = true; - } + ptr += consume.inc; } - if (!prev_did_emit_newline){ - f32 next_x = p.x + space_advance; - layout_write(arena, &list, index, ' ', 0, - Rf32(p, V2f32(next_x, text_y))); + if (newline_layout_consume_finish(&newline_vars)){ + i64 index = layout_index_from_ptr(ptr, text.str, range.first); + lr_tb_write_blank(&pos_vars, arena, &list, index); } } - list.bottom_extension = -line_to_text_shift; - list.height += list.bottom_extension; + + layout_item_list_finish(&list, -pos_vars.line_to_text_shift); return(list); } @@ -193,33 +488,20 @@ layout_wrap_whitespace(Application_Links *app, Arena *arena, Buffer_ID buffer, Range_i64 range, Face_ID face, f32 width){ Scratch_Block scratch(app); - Layout_Item_List list = {}; - list.index_range.first = range.first; - list.index_range.one_past_last = range.first - 1; + Layout_Item_List list = get_empty_item_list(range); String_Const_u8 text = push_buffer_range(app, scratch, buffer, range); Face_Advance_Map advance_map = get_face_advance_map(app, face); Face_Metrics metrics = get_face_metrics(app, face); - f32 line_height = metrics.line_height; - f32 text_height = metrics.text_height; - f32 line_to_text_shift = text_height - line_height; - f32 space_advance = metrics.space_advance; + LefRig_TopBot_Layout_Vars pos_vars = get_lr_tb_layout_vars(&advance_map, &metrics, width); if (text.size == 0){ - f32 next_x = space_advance; - layout_write(arena, &list, range.first, ' ', 0, - Rf32(V2(0.f, 0.f), V2f32(next_x, text_height))); + lr_tb_write_blank(&pos_vars, arena, &list, range.first); } else{ - Vec2_f32 p = {}; - f32 line_y = line_height; - f32 text_y = text_height; - b32 first_of_the_line = true; - b32 consuming_newline_characters = false; - i64 newline_character_index = -1; - b32 prev_did_emit_newline = false; + Newline_Layout_Vars newline_vars = get_newline_layout_vars(); u8 *ptr = text.str; u8 *end_ptr = ptr + text.size; @@ -230,9 +512,6 @@ layout_wrap_whitespace(Application_Links *app, Arena *arena, Buffer_ID buffer, } consuming_non_whitespace: - consuming_newline_characters = false; - newline_character_index = -1; - for (;ptr <= end_ptr; ptr += 1){ if (ptr == end_ptr || character_is_whitespace(*ptr)){ break; @@ -240,6 +519,8 @@ layout_wrap_whitespace(Application_Links *app, Arena *arena, Buffer_ID buffer, } { + newline_layout_consume_default(&newline_vars); + String_Const_u8 word = SCu8(word_ptr, ptr); u8 *word_end = ptr; @@ -250,23 +531,16 @@ layout_wrap_whitespace(Application_Links *app, Arena *arena, Buffer_ID buffer, Character_Consume_Result consume = utf8_consume(ptr, (umem)(word_end - ptr)); if (consume.codepoint != max_u32){ - f32 advance = font_get_glyph_advance(&advance_map, &metrics, - consume.codepoint); - total_advance += advance; + total_advance += lr_tb_advance(&pos_vars, consume.codepoint); } else{ - total_advance += metrics.byte_advance; + total_advance += lr_tb_advance_byte(&pos_vars); } ptr += consume.inc; } - f32 next_x = p.x + total_advance; - if (next_x > width){ - p.y = line_y; - p.x = 0.f; - line_y += line_height; - text_y = line_y + line_to_text_shift; - next_x = total_advance; + if (lr_tb_crosses_width(&pos_vars, total_advance)){ + lr_tb_next_line(&pos_vars); } } @@ -275,33 +549,13 @@ layout_wrap_whitespace(Application_Links *app, Arena *arena, Buffer_ID buffer, for (; ptr < word_end;){ Character_Consume_Result consume = utf8_consume(ptr, (umem)(word_end - ptr)); + i64 index = layout_index_from_ptr(ptr, text.str, range.first); if (consume.codepoint != max_u32){ - f32 advance = font_get_glyph_advance(&advance_map, &metrics, - consume.codepoint); - i64 index = (i64)(ptr - text.str) + range.first; - layout_write(arena, &list, index, - consume.codepoint, 0, - Rf32(p, V2f32(p.x + advance, text_y))); - p.x += advance; + lr_tb_write(&pos_vars, arena, &list, index, consume.codepoint); } else{ - u32 v = *ptr; - u32 lo = v&0xF; - u32 hi = (v >> 4)&0xF; - i64 index = (i64)(ptr - text.str) + range.first; - f32 advance = metrics.byte_sub_advances[0]; - layout_write(arena, &list, index, '\\', 0, - Rf32(p, V2f32(p.x + advance, text_y))); - p.x += advance; - advance = metrics.byte_sub_advances[1]; - layout_write(arena, &list, index, integer_symbols[hi], 0, - Rf32(p, V2f32(p.x + advance, text_y))); - p.x += advance; - advance = metrics.byte_sub_advances[2]; - layout_write(arena, &list, index, integer_symbols[lo], 0, - Rf32(p, V2f32(p.x + advance, text_y))); - p.x += advance; + lr_tb_write_byte(&pos_vars, arena, &list, index, *ptr); } ptr += consume.inc; @@ -317,71 +571,129 @@ layout_wrap_whitespace(Application_Links *app, Arena *arena, Buffer_ID buffer, goto consuming_non_whitespace; } - b32 emit_newline = false; - + i64 index = layout_index_from_ptr(ptr, text.str, range.first); switch (*ptr){ default: { - f32 advance = space_advance; - if (*ptr == '\t'){ - advance *= 4.f; + newline_layout_consume_default(&newline_vars); + f32 advance = lr_tb_advance(&pos_vars, *ptr); + if (!first_of_the_line && lr_tb_crosses_width(&pos_vars, advance)){ + lr_tb_next_line(&pos_vars); } - f32 next_x = p.x + advance; - if (!first_of_the_line && next_x > width){ - p.y = line_y; - p.x = 0.f; - line_y += line_height; - text_y = line_y + line_to_text_shift; - next_x = advance; - } - i64 index = (i64)(ptr - text.str) + range.first; - layout_write(arena, &list, index, - ' ', 0, - Rf32(p, V2f32(next_x, text_y))); - p.x = next_x; + lr_tb_write_with_advance(&pos_vars, advance, + arena, &list, index, *ptr); first_of_the_line = false; }break; case '\r': { - if (!consuming_newline_characters){ - consuming_newline_characters = true; - newline_character_index = (i64)(ptr - text.str) + range.first; - } + newline_layout_consume_CR(&newline_vars, index); }break; case '\n': { - if (!consuming_newline_characters){ - consuming_newline_characters = true; - newline_character_index = (i64)(ptr - text.str) + range.first; + u64 newline_index = newline_layout_consume_LF(&newline_vars, index); + lr_tb_write_blank(&pos_vars, arena, &list, newline_index); + lr_tb_next_line(&pos_vars); + first_of_the_line = true; + }break; + } + } + + if (newline_layout_consume_finish(&newline_vars)){ + i64 index = layout_index_from_ptr(ptr, text.str, range.first); + lr_tb_write_blank(&pos_vars, arena, &list, index); + } + } + + layout_item_list_finish(&list, -pos_vars.line_to_text_shift); + + return(list); +} + +function Layout_Item_List +layout_generic_virtual_whitespace(Application_Links *app, Arena *arena, + Buffer_ID buffer, Range_i64 range, Face_ID face, + f32 width){ + Scratch_Block scratch(app); + + Layout_Item_List list = get_empty_item_list(range); + + String_Const_u8 text = push_buffer_range(app, scratch, buffer, range); + + Face_Advance_Map advance_map = get_face_advance_map(app, face); + Face_Metrics metrics = get_face_metrics(app, face); + LefRig_TopBot_Layout_Vars pos_vars = get_lr_tb_layout_vars(&advance_map, &metrics, width); + + if (text.size == 0){ + lr_tb_write_blank(&pos_vars, arena, &list, range.start); + } + else{ + b32 skipping_leading_whitespace = true; + Newline_Layout_Vars newline_vars = get_newline_layout_vars(); + + u8 *ptr = text.str; + u8 *end_ptr = ptr + text.size; + for (;ptr < end_ptr;){ + Character_Consume_Result consume = utf8_consume(ptr, (umem)(end_ptr - ptr)); + + if (consume.codepoint != ' ' && + consume.codepoint != '\t'){ + skipping_leading_whitespace = false; + } + + i64 index = layout_index_from_ptr(ptr, text.str, range.first); + switch (consume.codepoint){ + case '\t': + case ' ': + { + newline_layout_consume_default(&newline_vars); + f32 advance = lr_tb_advance(&pos_vars, consume.codepoint); + if (!skipping_leading_whitespace){ + lr_tb_write_with_advance(&pos_vars, advance, + arena, &list, index, + consume.codepoint); } - emit_newline = true; + else{ + lr_tb_advance_x_without_item(&pos_vars, advance); + } + }break; + + default: + { + newline_layout_consume_default(&newline_vars); + lr_tb_write(&pos_vars, arena, &list, index, consume.codepoint); + }break; + + case '\r': + { + newline_layout_consume_CR(&newline_vars, index); + }break; + + case '\n': + { + i64 newline_index = newline_layout_consume_LF(&newline_vars, index); + lr_tb_write_blank(&pos_vars, arena, &list, newline_index); + lr_tb_next_line(&pos_vars); + }break; + + case max_u32: + { + newline_layout_consume_default(&newline_vars); + lr_tb_write_byte(&pos_vars, arena, &list, index, *ptr); }break; } - if (emit_newline){ - f32 next_x = p.x + space_advance; - layout_write(arena, &list, newline_character_index, ' ', 0, - Rf32(p, V2f32(next_x, text_y))); - p.y = line_y; - p.x = 0.f; - line_y += line_height; - text_y = line_y + line_to_text_shift; - first_of_the_line = true; - } - prev_did_emit_newline = emit_newline; + ptr += consume.inc; } - if (!prev_did_emit_newline){ - f32 next_x = p.x + space_advance; - i64 index = (i64)(ptr - text.str) + range.first; - layout_write(arena, &list, index, ' ', 0, - Rf32(p, V2f32(next_x, text_y))); + if (newline_layout_consume_finish(&newline_vars)){ + i64 index = layout_index_from_ptr(ptr, text.str, range.first); + lr_tb_write_blank(&pos_vars, arena, &list, index); } } - list.bottom_extension = -line_to_text_shift; - list.height += list.bottom_extension; + + layout_item_list_finish(&list, -pos_vars.line_to_text_shift); return(list); } diff --git a/custom/4coder_layout_rule.h b/custom/4coder_layout_rule.h new file mode 100644 index 00000000..71dad86c --- /dev/null +++ b/custom/4coder_layout_rule.h @@ -0,0 +1,32 @@ +/* +4coder_layout_rule.h - Built in layout rule types. +*/ + +// TOP + +#if !defined(FCODER_LAYOUT_RULE_H) +#define FCODER_LAYOUT_RULE_H + +struct Newline_Layout_Vars{ + i64 newline_character_index; + b32 consuming_newline_characters; + b32 prev_did_emit_newline; +}; + +struct LefRig_TopBot_Layout_Vars{ + Face_Advance_Map *advance_map; + Face_Metrics *metrics; + f32 line_to_text_shift; + + Vec2_f32 blank_dim; + + Vec2_f32 p; + f32 line_y; + f32 text_y; + f32 width; +}; + +#endif + +// BOTTOM + diff --git a/custom/4coder_types.h b/custom/4coder_types.h index 0cab24da..e104bbbe 100644 --- a/custom/4coder_types.h +++ b/custom/4coder_types.h @@ -635,9 +635,10 @@ struct Layout_Item_List{ i32 node_count; i32 total_count; f32 height; - f32 bottom_extension; + f32 bottom_padding; i64 character_count; - Interval_i64 index_range; + Range_i64 input_index_range; + Range_i64 manifested_index_range; }; typedef Layout_Item_List Layout_Function(Application_Links *app, Arena *arena, diff --git a/custom/generated/command_metadata.h b/custom/generated/command_metadata.h index dd35690c..0e82bb55 100644 --- a/custom/generated/command_metadata.h +++ b/custom/generated/command_metadata.h @@ -240,25 +240,25 @@ static Command_Metadata fcoder_metacmd_table[214] = { { PROC_LINKS(profile_enable, 0), false, "profile_enable", 14, "Allow 4coder's self profiler to gather new profiling information.", 65, "w:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 207 }, { 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, 214 }, { 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, 221 }, -{ 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, 2119 }, -{ 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, 2125 }, -{ 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, 2131 }, -{ 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, 2137 }, -{ 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, 2143 }, -{ 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, 2151 }, -{ PROC_LINKS(change_active_panel, 0), false, "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 270 }, -{ PROC_LINKS(change_active_panel_backwards, 0), false, "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 280 }, -{ 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, 290 }, -{ PROC_LINKS(open_panel_hsplit, 0), false, "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 300 }, -{ PROC_LINKS(suppress_mouse, 0), false, "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 365 }, -{ 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, 371 }, -{ 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, 377 }, -{ PROC_LINKS(set_mode_to_original, 0), false, "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 383 }, -{ PROC_LINKS(set_mode_to_notepad_like, 0), false, "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 389 }, -{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), false, "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 395 }, -{ PROC_LINKS(toggle_highlight_enclosing_scopes, 0), false, "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 401 }, -{ 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, 407 }, -{ PROC_LINKS(toggle_fullscreen, 0), false, "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 413 }, +{ 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, 2157 }, +{ 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, 2163 }, +{ 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, 2169 }, +{ 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, 2175 }, +{ 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, 2181 }, +{ 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, 2189 }, +{ PROC_LINKS(change_active_panel, 0), false, "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 275 }, +{ PROC_LINKS(change_active_panel_backwards, 0), false, "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 285 }, +{ 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, 295 }, +{ PROC_LINKS(open_panel_hsplit, 0), false, "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 305 }, +{ PROC_LINKS(suppress_mouse, 0), false, "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 370 }, +{ 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, 376 }, +{ 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, 382 }, +{ PROC_LINKS(set_mode_to_original, 0), false, "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 388 }, +{ PROC_LINKS(set_mode_to_notepad_like, 0), false, "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 394 }, +{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), false, "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 400 }, +{ PROC_LINKS(toggle_highlight_enclosing_scopes, 0), false, "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 406 }, +{ 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, 412 }, +{ PROC_LINKS(toggle_fullscreen, 0), false, "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 418 }, { PROC_LINKS(write_text_input, 0), false, "write_text_input", 16, "Inserts whatever character was used to trigger this command.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 59 }, { PROC_LINKS(write_space, 0), false, "write_space", 11, "Inserts an underscore.", 22, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 67 }, { PROC_LINKS(write_underscore, 0), false, "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 73 }, @@ -269,91 +269,91 @@ static Command_Metadata fcoder_metacmd_table[214] = { { PROC_LINKS(delete_range, 0), false, "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 134 }, { 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, 154 }, { PROC_LINKS(delete_alpha_numeric_boundary, 0), false, "delete_alpha_numeric_boundary", 29, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 162 }, -{ PROC_LINKS(snipe_backward_whitespace_or_token_boundary, 0), false, "snipe_backward_whitespace_or_token_boundary", 43, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 182 }, -{ PROC_LINKS(snipe_forward_whitespace_or_token_boundary, 0), false, "snipe_forward_whitespace_or_token_boundary", 42, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 190 }, -{ 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, 200 }, -{ PROC_LINKS(left_adjust_view, 0), false, "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 214 }, -{ 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, 226 }, -{ 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, 236 }, -{ 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, 246 }, -{ PROC_LINKS(click_set_mark, 0), false, "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 258 }, -{ PROC_LINKS(mouse_wheel_scroll, 0), false, "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 268 }, -{ PROC_LINKS(move_up, 0), false, "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 323 }, -{ PROC_LINKS(move_down, 0), false, "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 329 }, -{ PROC_LINKS(move_up_10, 0), false, "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 335 }, -{ PROC_LINKS(move_down_10, 0), false, "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 341 }, -{ PROC_LINKS(move_down_textual, 0), false, "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 347 }, -{ 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, 357 }, -{ 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, 365 }, -{ 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, 394 }, -{ PROC_LINKS(move_down_to_blank_line, 0), false, "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 400 }, -{ 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, 406 }, -{ PROC_LINKS(move_down_to_blank_line_skip_whitespace, 0), false, "move_down_to_blank_line_skip_whitespace", 39, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "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, 418 }, -{ PROC_LINKS(move_down_to_blank_line_end, 0), false, "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 424 }, -{ PROC_LINKS(move_left, 0), false, "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 430 }, -{ PROC_LINKS(move_right, 0), false, "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 442 }, -{ PROC_LINKS(move_right_whitespace_boundary, 0), false, "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 464 }, -{ PROC_LINKS(move_left_whitespace_boundary, 0), false, "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 472 }, -{ PROC_LINKS(move_right_token_boundary, 0), false, "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 480 }, -{ PROC_LINKS(move_left_token_boundary, 0), false, "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 488 }, -{ PROC_LINKS(move_right_whitespace_or_token_boundary, 0), false, "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 496 }, -{ PROC_LINKS(move_left_whitespace_or_token_boundary, 0), false, "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 504 }, -{ PROC_LINKS(move_right_alpha_numeric_boundary, 0), false, "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 512 }, -{ PROC_LINKS(move_left_alpha_numeric_boundary, 0), false, "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 520 }, -{ PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), false, "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 528 }, -{ PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), false, "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 536 }, -{ 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, 546 }, -{ PROC_LINKS(to_uppercase, 0), false, "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 559 }, -{ PROC_LINKS(to_lowercase, 0), false, "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 572 }, -{ 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, 585 }, -{ 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, 620 }, -{ PROC_LINKS(close_panel, 0), false, "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 628 }, -{ PROC_LINKS(show_scrollbar, 0), false, "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 637 }, -{ PROC_LINKS(hide_scrollbar, 0), false, "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 644 }, -{ PROC_LINKS(show_filebar, 0), false, "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 651 }, -{ PROC_LINKS(hide_filebar, 0), false, "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 658 }, -{ PROC_LINKS(toggle_filebar, 0), false, "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 665 }, -{ PROC_LINKS(toggle_fps_meter, 0), false, "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 674 }, -{ PROC_LINKS(increase_face_size, 0), false, "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 680 }, -{ 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, 691 }, -{ PROC_LINKS(mouse_wheel_change_face_size, 0), false, "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 702 }, -{ 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_base_commands.cpp", 43, 719 }, -{ 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, 728 }, -{ PROC_LINKS(toggle_line_numbers, 0), false, "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 737 }, -{ PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 743 }, -{ PROC_LINKS(goto_line, 0), false, "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 751 }, -{ 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, 979 }, -{ PROC_LINKS(reverse_search, 0), false, "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 985 }, -{ 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, 991 }, -{ PROC_LINKS(reverse_search_identifier, 0), false, "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 997 }, -{ PROC_LINKS(replace_in_range, 0), false, "replace_in_range", 16, "Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.", 150, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1044 }, -{ PROC_LINKS(replace_in_buffer, 0), false, "replace_in_buffer", 17, "Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.", 109, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1053 }, -{ PROC_LINKS(replace_in_all_buffers, 0), false, "replace_in_all_buffers", 22, "Queries the user for a needle and string. Replaces all occurences of needle with string in all editable buffers.", 112, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1062 }, -{ PROC_LINKS(query_replace, 0), false, "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1152 }, -{ PROC_LINKS(query_replace_identifier, 0), false, "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1173 }, -{ PROC_LINKS(query_replace_selection, 0), false, "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1189 }, -{ PROC_LINKS(save_all_dirty_buffers, 0), false, "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1225 }, -{ PROC_LINKS(delete_file_query, 0), false, "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1250 }, -{ 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, 1294 }, -{ PROC_LINKS(rename_file_query, 0), false, "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1327 }, -{ 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, 1365 }, -{ PROC_LINKS(move_line_up, 0), false, "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1399 }, -{ PROC_LINKS(move_line_down, 0), false, "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1405 }, -{ PROC_LINKS(duplicate_line, 0), false, "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1411 }, -{ PROC_LINKS(delete_line, 0), false, "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1425 }, -{ 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, 1490 }, -{ PROC_LINKS(open_matching_file_cpp, 0), false, "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1522 }, -{ PROC_LINKS(view_buffer_other_panel, 0), false, "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1535 }, -{ PROC_LINKS(swap_buffers_between_panels, 0), false, "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1547 }, -{ PROC_LINKS(kill_buffer, 0), false, "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1581 }, -{ PROC_LINKS(save, 0), false, "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1589 }, -{ PROC_LINKS(reopen, 0), false, "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1599 }, -{ PROC_LINKS(undo, 0), false, "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1824 }, -{ PROC_LINKS(redo, 0), false, "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1837 }, -{ PROC_LINKS(undo_all_buffers, 0), false, "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1851 }, -{ PROC_LINKS(redo_all_buffers, 0), false, "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1922 }, -{ PROC_LINKS(open_in_other, 0), false, "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 2023 }, +{ PROC_LINKS(snipe_backward_whitespace_or_token_boundary, 0), false, "snipe_backward_whitespace_or_token_boundary", 43, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 179 }, +{ PROC_LINKS(snipe_forward_whitespace_or_token_boundary, 0), false, "snipe_forward_whitespace_or_token_boundary", 42, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 187 }, +{ 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, 197 }, +{ PROC_LINKS(left_adjust_view, 0), false, "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 211 }, +{ 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, 223 }, +{ 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, 233 }, +{ 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, 243 }, +{ PROC_LINKS(click_set_mark, 0), false, "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 255 }, +{ PROC_LINKS(mouse_wheel_scroll, 0), false, "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 265 }, +{ PROC_LINKS(move_up, 0), false, "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 332 }, +{ PROC_LINKS(move_down, 0), false, "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 338 }, +{ PROC_LINKS(move_up_10, 0), false, "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 344 }, +{ PROC_LINKS(move_down_10, 0), false, "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 350 }, +{ PROC_LINKS(move_down_textual, 0), false, "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 356 }, +{ 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, 366 }, +{ 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, 374 }, +{ 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, 403 }, +{ PROC_LINKS(move_down_to_blank_line, 0), false, "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 409 }, +{ 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, 415 }, +{ PROC_LINKS(move_down_to_blank_line_skip_whitespace, 0), false, "move_down_to_blank_line_skip_whitespace", 39, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 421 }, +{ 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, 427 }, +{ PROC_LINKS(move_down_to_blank_line_end, 0), false, "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 433 }, +{ PROC_LINKS(move_left, 0), false, "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 439 }, +{ PROC_LINKS(move_right, 0), false, "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 447 }, +{ PROC_LINKS(move_right_whitespace_boundary, 0), false, "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 465 }, +{ PROC_LINKS(move_left_whitespace_boundary, 0), false, "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 473 }, +{ PROC_LINKS(move_right_token_boundary, 0), false, "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 481 }, +{ PROC_LINKS(move_left_token_boundary, 0), false, "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 489 }, +{ PROC_LINKS(move_right_whitespace_or_token_boundary, 0), false, "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 497 }, +{ PROC_LINKS(move_left_whitespace_or_token_boundary, 0), false, "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 505 }, +{ PROC_LINKS(move_right_alpha_numeric_boundary, 0), false, "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 513 }, +{ PROC_LINKS(move_left_alpha_numeric_boundary, 0), false, "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 521 }, +{ PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), false, "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 529 }, +{ PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), false, "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 537 }, +{ 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, 547 }, +{ PROC_LINKS(to_uppercase, 0), false, "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 560 }, +{ PROC_LINKS(to_lowercase, 0), false, "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 573 }, +{ 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, 586 }, +{ 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, 621 }, +{ PROC_LINKS(close_panel, 0), false, "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 629 }, +{ PROC_LINKS(show_scrollbar, 0), false, "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 638 }, +{ PROC_LINKS(hide_scrollbar, 0), false, "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 645 }, +{ PROC_LINKS(show_filebar, 0), false, "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 652 }, +{ PROC_LINKS(hide_filebar, 0), false, "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 659 }, +{ PROC_LINKS(toggle_filebar, 0), false, "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 666 }, +{ PROC_LINKS(toggle_fps_meter, 0), false, "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 675 }, +{ PROC_LINKS(increase_face_size, 0), false, "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 681 }, +{ 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, 692 }, +{ PROC_LINKS(mouse_wheel_change_face_size, 0), false, "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 703 }, +{ 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_base_commands.cpp", 43, 720 }, +{ 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, 729 }, +{ PROC_LINKS(toggle_line_numbers, 0), false, "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 738 }, +{ PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 744 }, +{ PROC_LINKS(goto_line, 0), false, "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 752 }, +{ 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, 980 }, +{ PROC_LINKS(reverse_search, 0), false, "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 986 }, +{ 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, 992 }, +{ PROC_LINKS(reverse_search_identifier, 0), false, "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 998 }, +{ PROC_LINKS(replace_in_range, 0), false, "replace_in_range", 16, "Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.", 150, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1045 }, +{ PROC_LINKS(replace_in_buffer, 0), false, "replace_in_buffer", 17, "Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.", 109, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1054 }, +{ PROC_LINKS(replace_in_all_buffers, 0), false, "replace_in_all_buffers", 22, "Queries the user for a needle and string. Replaces all occurences of needle with string in all editable buffers.", 112, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1063 }, +{ PROC_LINKS(query_replace, 0), false, "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1153 }, +{ PROC_LINKS(query_replace_identifier, 0), false, "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1174 }, +{ PROC_LINKS(query_replace_selection, 0), false, "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1190 }, +{ PROC_LINKS(save_all_dirty_buffers, 0), false, "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1226 }, +{ PROC_LINKS(delete_file_query, 0), false, "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1251 }, +{ 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, 1295 }, +{ PROC_LINKS(rename_file_query, 0), false, "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1328 }, +{ 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, 1366 }, +{ PROC_LINKS(move_line_up, 0), false, "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1400 }, +{ PROC_LINKS(move_line_down, 0), false, "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1406 }, +{ PROC_LINKS(duplicate_line, 0), false, "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1412 }, +{ PROC_LINKS(delete_line, 0), false, "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1426 }, +{ 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, 1491 }, +{ PROC_LINKS(open_matching_file_cpp, 0), false, "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1523 }, +{ PROC_LINKS(view_buffer_other_panel, 0), false, "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1536 }, +{ PROC_LINKS(swap_buffers_between_panels, 0), false, "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1548 }, +{ PROC_LINKS(kill_buffer, 0), false, "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1582 }, +{ PROC_LINKS(save, 0), false, "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1590 }, +{ PROC_LINKS(reopen, 0), false, "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1600 }, +{ PROC_LINKS(undo, 0), false, "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1825 }, +{ PROC_LINKS(redo, 0), false, "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1838 }, +{ PROC_LINKS(undo_all_buffers, 0), false, "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1852 }, +{ PROC_LINKS(redo_all_buffers, 0), false, "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1923 }, +{ PROC_LINKS(open_in_other, 0), false, "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 2024 }, { 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, 2030 }, { PROC_LINKS(set_eol_mode_to_crlf, 0), false, "set_eol_mode_to_crlf", 20, "Puts the buffer in crlf line ending mode.", 41, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 86 }, { PROC_LINKS(set_eol_mode_to_lf, 0), false, "set_eol_mode_to_lf", 18, "Puts the buffer in lf line ending mode.", 39, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 97 }, diff --git a/custom/generated/custom_api.cpp b/custom/generated/custom_api.cpp index 676164fe..53cfcd2d 100644 --- a/custom/generated/custom_api.cpp +++ b/custom/generated/custom_api.cpp @@ -23,13 +23,13 @@ vtable->buffer_seek_character_class = buffer_seek_character_class; vtable->buffer_line_y_difference = buffer_line_y_difference; vtable->buffer_line_shift_y = buffer_line_shift_y; vtable->buffer_pos_at_relative_xy = buffer_pos_at_relative_xy; -vtable->buffer_relative_xy_of_pos = buffer_relative_xy_of_pos; +vtable->buffer_relative_box_of_pos = buffer_relative_box_of_pos; vtable->buffer_relative_character_from_pos = buffer_relative_character_from_pos; vtable->buffer_pos_from_relative_character = buffer_pos_from_relative_character; vtable->view_line_y_difference = view_line_y_difference; vtable->view_line_shift_y = view_line_shift_y; vtable->view_pos_at_relative_xy = view_pos_at_relative_xy; -vtable->view_relative_xy_of_pos = view_relative_xy_of_pos; +vtable->view_relative_box_of_pos = view_relative_box_of_pos; vtable->view_relative_character_from_pos = view_relative_character_from_pos; vtable->view_pos_from_relative_character = view_pos_from_relative_character; vtable->buffer_exists = buffer_exists; @@ -200,13 +200,13 @@ buffer_seek_character_class = vtable->buffer_seek_character_class; buffer_line_y_difference = vtable->buffer_line_y_difference; buffer_line_shift_y = vtable->buffer_line_shift_y; buffer_pos_at_relative_xy = vtable->buffer_pos_at_relative_xy; -buffer_relative_xy_of_pos = vtable->buffer_relative_xy_of_pos; +buffer_relative_box_of_pos = vtable->buffer_relative_box_of_pos; buffer_relative_character_from_pos = vtable->buffer_relative_character_from_pos; buffer_pos_from_relative_character = vtable->buffer_pos_from_relative_character; view_line_y_difference = vtable->view_line_y_difference; view_line_shift_y = vtable->view_line_shift_y; view_pos_at_relative_xy = vtable->view_pos_at_relative_xy; -view_relative_xy_of_pos = vtable->view_relative_xy_of_pos; +view_relative_box_of_pos = vtable->view_relative_box_of_pos; view_relative_character_from_pos = vtable->view_relative_character_from_pos; view_pos_from_relative_character = vtable->view_pos_from_relative_character; buffer_exists = vtable->buffer_exists; diff --git a/custom/generated/custom_api.h b/custom/generated/custom_api.h index 3bd90f0c..4e7f8546 100644 --- a/custom/generated/custom_api.h +++ b/custom/generated/custom_api.h @@ -21,13 +21,13 @@ #define custom_buffer_line_y_difference_sig() f32 custom_buffer_line_y_difference(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b) #define custom_buffer_line_shift_y_sig() Line_Shift_Vertical custom_buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift) #define custom_buffer_pos_at_relative_xy_sig() i64 custom_buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy) -#define custom_buffer_relative_xy_of_pos_sig() Vec2_f32 custom_buffer_relative_xy_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) +#define custom_buffer_relative_box_of_pos_sig() Rect_f32 custom_buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) #define custom_buffer_relative_character_from_pos_sig() i64 custom_buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) #define custom_buffer_pos_from_relative_character_sig() i64 custom_buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character) #define custom_view_line_y_difference_sig() f32 custom_view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b) #define custom_view_line_shift_y_sig() Line_Shift_Vertical custom_view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift) #define custom_view_pos_at_relative_xy_sig() i64 custom_view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy) -#define custom_view_relative_xy_of_pos_sig() Vec2_f32 custom_view_relative_xy_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos) +#define custom_view_relative_box_of_pos_sig() Rect_f32 custom_view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos) #define custom_view_relative_character_from_pos_sig() i64 custom_view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos) #define custom_view_pos_from_relative_character_sig() i64 custom_view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character) #define custom_buffer_exists_sig() b32 custom_buffer_exists(Application_Links* app, Buffer_ID buffer_id) @@ -194,13 +194,13 @@ typedef String_Match custom_buffer_seek_character_class_type(Application_Links* typedef f32 custom_buffer_line_y_difference_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b); typedef Line_Shift_Vertical custom_buffer_line_shift_y_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift); typedef i64 custom_buffer_pos_at_relative_xy_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy); -typedef Vec2_f32 custom_buffer_relative_xy_of_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); +typedef Rect_f32 custom_buffer_relative_box_of_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); typedef i64 custom_buffer_relative_character_from_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); typedef i64 custom_buffer_pos_from_relative_character_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character); typedef f32 custom_view_line_y_difference_type(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b); typedef Line_Shift_Vertical custom_view_line_shift_y_type(Application_Links* app, View_ID view_id, i64 line, f32 y_shift); typedef i64 custom_view_pos_at_relative_xy_type(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy); -typedef Vec2_f32 custom_view_relative_xy_of_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); +typedef Rect_f32 custom_view_relative_box_of_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); typedef i64 custom_view_relative_character_from_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); typedef i64 custom_view_pos_from_relative_character_type(Application_Links* app, View_ID view_id, i64 base_line, i64 character); typedef b32 custom_buffer_exists_type(Application_Links* app, Buffer_ID buffer_id); @@ -368,13 +368,13 @@ custom_buffer_seek_character_class_type *buffer_seek_character_class; custom_buffer_line_y_difference_type *buffer_line_y_difference; custom_buffer_line_shift_y_type *buffer_line_shift_y; custom_buffer_pos_at_relative_xy_type *buffer_pos_at_relative_xy; -custom_buffer_relative_xy_of_pos_type *buffer_relative_xy_of_pos; +custom_buffer_relative_box_of_pos_type *buffer_relative_box_of_pos; custom_buffer_relative_character_from_pos_type *buffer_relative_character_from_pos; custom_buffer_pos_from_relative_character_type *buffer_pos_from_relative_character; custom_view_line_y_difference_type *view_line_y_difference; custom_view_line_shift_y_type *view_line_shift_y; custom_view_pos_at_relative_xy_type *view_pos_at_relative_xy; -custom_view_relative_xy_of_pos_type *view_relative_xy_of_pos; +custom_view_relative_box_of_pos_type *view_relative_box_of_pos; custom_view_relative_character_from_pos_type *view_relative_character_from_pos; custom_view_pos_from_relative_character_type *view_pos_from_relative_character; custom_buffer_exists_type *buffer_exists; @@ -543,13 +543,13 @@ internal String_Match buffer_seek_character_class(Application_Links* app, Buffer internal f32 buffer_line_y_difference(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b); internal Line_Shift_Vertical buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift); internal i64 buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy); -internal Vec2_f32 buffer_relative_xy_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); +internal Rect_f32 buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); internal i64 buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); internal i64 buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character); internal f32 view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b); internal Line_Shift_Vertical view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift); internal i64 view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy); -internal Vec2_f32 view_relative_xy_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); +internal Rect_f32 view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); internal i64 view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); internal i64 view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character); internal b32 buffer_exists(Application_Links* app, Buffer_ID buffer_id); @@ -718,13 +718,13 @@ global custom_buffer_seek_character_class_type *buffer_seek_character_class = 0; global custom_buffer_line_y_difference_type *buffer_line_y_difference = 0; global custom_buffer_line_shift_y_type *buffer_line_shift_y = 0; global custom_buffer_pos_at_relative_xy_type *buffer_pos_at_relative_xy = 0; -global custom_buffer_relative_xy_of_pos_type *buffer_relative_xy_of_pos = 0; +global custom_buffer_relative_box_of_pos_type *buffer_relative_box_of_pos = 0; global custom_buffer_relative_character_from_pos_type *buffer_relative_character_from_pos = 0; global custom_buffer_pos_from_relative_character_type *buffer_pos_from_relative_character = 0; global custom_view_line_y_difference_type *view_line_y_difference = 0; global custom_view_line_shift_y_type *view_line_shift_y = 0; global custom_view_pos_at_relative_xy_type *view_pos_at_relative_xy = 0; -global custom_view_relative_xy_of_pos_type *view_relative_xy_of_pos = 0; +global custom_view_relative_box_of_pos_type *view_relative_box_of_pos = 0; global custom_view_relative_character_from_pos_type *view_relative_character_from_pos = 0; global custom_view_pos_from_relative_character_type *view_pos_from_relative_character = 0; global custom_buffer_exists_type *buffer_exists = 0; diff --git a/custom/generated/custom_api_master_list.h b/custom/generated/custom_api_master_list.h index c4ccee6d..34c86f00 100644 --- a/custom/generated/custom_api_master_list.h +++ b/custom/generated/custom_api_master_list.h @@ -21,13 +21,13 @@ api(custom) function String_Match buffer_seek_character_class(Application_Links* api(custom) function f32 buffer_line_y_difference(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b); api(custom) function Line_Shift_Vertical buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift); api(custom) function i64 buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy); -api(custom) function Vec2_f32 buffer_relative_xy_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); +api(custom) function Rect_f32 buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); api(custom) function i64 buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); api(custom) function i64 buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character); api(custom) function f32 view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b); api(custom) function Line_Shift_Vertical view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift); api(custom) function i64 view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy); -api(custom) function Vec2_f32 view_relative_xy_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); +api(custom) function Rect_f32 view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); api(custom) function i64 view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); api(custom) function i64 view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character); api(custom) function b32 buffer_exists(Application_Links* app, Buffer_ID buffer_id); diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp index 099ab38f..723340d1 100644 --- a/platform_win32/win32_4ed.cpp +++ b/platform_win32/win32_4ed.cpp @@ -953,7 +953,10 @@ win32_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ Scratch_Block scratch(win32vars.tctx); switch (uMsg){ - case WM_MENUCHAR:break; + case WM_MENUCHAR: + { + result = (MNC_CLOSE << 16); + }break; case WM_SYSKEYDOWN: case WM_SYSKEYUP: diff --git a/todo.txt b/todo.txt index ab90a5eb..a09c15ed 100644 --- a/todo.txt +++ b/todo.txt @@ -7,6 +7,7 @@ usability: Long Term { + Foo; Features { [] Project FKey Remapper