From 9ac5c44a0787c0312166e471cbb32a294a45f5ed Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Sat, 6 Apr 2019 16:36:53 -0700 Subject: [PATCH] view summary blah blah lbha --- 4coder_api_transition_30_31_helpers.cpp | 24 +- 4coder_base_commands.cpp | 863 ++++++++++++++---------- 4coder_generated/command_metadata.h | 154 ++--- 4coder_helper.cpp | 43 +- 4 files changed, 612 insertions(+), 472 deletions(-) diff --git a/4coder_api_transition_30_31_helpers.cpp b/4coder_api_transition_30_31_helpers.cpp index 7f76c4fb..4009225c 100644 --- a/4coder_api_transition_30_31_helpers.cpp +++ b/4coder_api_transition_30_31_helpers.cpp @@ -277,9 +277,7 @@ view_buffer_snipe_range(Application_Links *app, View_Summary *view, Buffer_Summa static void query_replace_base(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, i32 pos, String r, String w){ - if (buffer != 0){ - query_replace_base(app, view, buffer->buffer_id, pos, r, w); - } + query_replace_base(app, view==0?0:view->view_id, buffer==0?0:buffer->buffer_id, pos, r, w); } static Statement_Parser @@ -638,6 +636,26 @@ view_set_to_region(Application_Links *app, View_Summary *view, i32 major_pos, i3 view_set_to_region(app, view==0?0:view->view_id, major_pos, minor_pos, normalized_threshold); } +static i32 +character_pos_to_pos(Application_Links *app, View_Summary *view, i32 character_pos){ + return(character_pos_to_pos(app, view==0?0:view->view_id, character_pos)); +} + +static b32 +view_open_file(Application_Links *app, View_Summary *view, char *filename, i32 filename_len, b32 never_new){ + return(view_open_file(app, view==0?0:view->view_id, filename, filename_len, never_new)); +} + +static f32 +get_page_jump(Application_Links *app, View_Summary *view){ + return(get_page_jump(app, view==0?0:view->view_id)); +} + +static void +isearch__update_highlight(Application_Links *app, View_Summary *view, Managed_Object highlight, i32 start, i32 end){ + isearch__update_highlight(app, view==0?0:view->view_id, highlight, start, end); +} + #endif // BOTTOM diff --git a/4coder_base_commands.cpp b/4coder_base_commands.cpp index b873f024..9aaf1d75 100644 --- a/4coder_base_commands.cpp +++ b/4coder_base_commands.cpp @@ -8,17 +8,20 @@ moving the cursor, which work even without the default 4coder framework. static void write_character_parameter(Application_Links *app, u8 *character, u32 length){ if (length != 0){ - View_Summary view = get_active_view(app, AccessOpen); - if_view_has_highlighted_range_delete_range(app, view.view_id); - view = get_view(app, view.view_id, AccessAll); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); + if_view_has_highlighted_range_delete_range(app, view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer); - i32 pos = view.cursor.pos; + view_get_buffer(app, view, AccessOpen, &buffer); + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_pos(pos), &cursor); // NOTE(allen): setup markers to figure out the new position of cursor after the insert Marker next_cursor_marker = {}; - next_cursor_marker.pos = character_pos_to_pos(app, &view, view.cursor.character_pos); + next_cursor_marker.pos = character_pos_to_pos(app, view, cursor.character_pos); next_cursor_marker.lean_right = true; Managed_Object handle = alloc_buffer_markers_on_buffer(app, buffer, 1, 0); managed_object_store_data(app, handle, 0, 1, &next_cursor_marker); @@ -60,7 +63,7 @@ write_character_parameter(Application_Links *app, u8 *character, u32 length){ managed_object_load_data(app, handle, 0, 1, &next_cursor_marker); managed_object_free(app, handle); if (edit_success){ - view_set_cursor(app, &view, seek_pos(next_cursor_marker.pos), true); + view_set_cursor(app, view, seek_pos(next_cursor_marker.pos), true); } } } @@ -84,17 +87,19 @@ CUSTOM_DOC("Inserts an underscore.") CUSTOM_COMMAND_SIG(delete_char) CUSTOM_DOC("Deletes the character to the right of the cursor.") { - View_Summary view = get_active_view(app, AccessOpen); - if (!if_view_has_highlighted_range_delete_range(app, view.view_id)){ - view = get_view(app, view.view_id, AccessAll); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); + if (!if_view_has_highlighted_range_delete_range(app, view)){ Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer); - i32 start = view.cursor.pos; + view_get_buffer(app, view, AccessOpen, &buffer); + i32 start = 0; + view_get_cursor_pos(app, view, &start); i32 buffer_size = 0; buffer_get_size(app, buffer, &buffer_size); if (0 <= start && start < buffer_size){ Full_Cursor cursor = {}; - view_compute_cursor(app, &view, seek_character_pos(view.cursor.character_pos + 1), &cursor); + view_compute_cursor(app, view, seek_pos(start), &cursor); + view_compute_cursor(app, view, seek_character_pos(cursor.character_pos + 1), &cursor); i32 end = cursor.pos; buffer_replace_range(app, buffer, make_range(start, end), make_lit_string("")); } @@ -104,20 +109,22 @@ CUSTOM_DOC("Deletes the character to the right of the cursor.") CUSTOM_COMMAND_SIG(backspace_char) CUSTOM_DOC("Deletes the character to the left of the cursor.") { - View_Summary view = get_active_view(app, AccessOpen); - if (!if_view_has_highlighted_range_delete_range(app, view.view_id)){ - view = get_view(app, view.view_id, AccessAll); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); + if (!if_view_has_highlighted_range_delete_range(app, view)){ Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer); - i32 end = view.cursor.pos; + view_get_buffer(app, view, AccessOpen, &buffer); + i32 end = 0; + view_get_cursor_pos(app, view, &end); i32 buffer_size = 0; buffer_get_size(app, buffer, &buffer_size); if (0 < end && end <= buffer_size){ Full_Cursor cursor = {}; - view_compute_cursor(app, &view, seek_character_pos(view.cursor.character_pos - 1), &cursor); + view_compute_cursor(app, view, seek_pos(end), &cursor); + view_compute_cursor(app, view, seek_character_pos(cursor.character_pos - 1), &cursor); i32 start = cursor.pos; if (buffer_replace_range(app, buffer, make_range(start, end), make_lit_string(""))){ - view_set_cursor(app, &view, seek_character_pos(view.cursor.character_pos - 1), true); + view_set_cursor(app, view, seek_pos(start), true); } } } @@ -126,28 +133,35 @@ CUSTOM_DOC("Deletes the character to the left of the cursor.") CUSTOM_COMMAND_SIG(set_mark) CUSTOM_DOC("Sets the mark to the current position of the cursor.") { - View_Summary view = get_active_view(app, AccessProtected); - view_set_mark(app, &view, seek_pos(view.cursor.pos)); - view_set_cursor(app, &view, seek_pos(view.cursor.pos), 1); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); + view_set_mark(app, view, seek_pos(pos)); + view_set_cursor(app, view, seek_pos(pos), true); } CUSTOM_COMMAND_SIG(cursor_mark_swap) CUSTOM_DOC("Swaps the position of the cursor and the mark.") { - View_Summary view = get_active_view(app, AccessProtected); - i32 cursor = view.cursor.pos; - i32 mark = view.mark.pos; - view_set_cursor(app, &view, seek_pos(mark), true); - view_set_mark(app, &view, seek_pos(cursor)); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + i32 cursor = 0; + view_get_cursor_pos(app, view, &cursor); + i32 mark = 0; + view_get_mark_pos(app, view, &mark); + view_set_cursor(app, view, seek_pos(mark), true); + view_set_mark(app, view, seek_pos(cursor)); } CUSTOM_COMMAND_SIG(delete_range) CUSTOM_DOC("Deletes the text in the range between the cursor and the mark.") { - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer); - Range range = get_view_range(app, view.view_id); + view_get_buffer(app, view, AccessOpen, &buffer); + Range range = get_view_range(app, view); buffer_replace_range(app, buffer, range, make_lit_string("")); } @@ -156,33 +170,31 @@ CUSTOM_DOC("Deletes the text in the range between the cursor and the mark.") CUSTOM_COMMAND_SIG(center_view) CUSTOM_DOC("Centers the view vertically on the line on which the cursor sits.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Rect_i32 region = {}; - view_get_buffer_region(app, view.view_id, ®ion); - GUI_Scroll_Vars scroll = view.scroll_vars; + view_get_buffer_region(app, view, ®ion); + GUI_Scroll_Vars scroll = {}; + view_get_scroll_vars(app, view, &scroll); f32 h = (f32)(rect_height(region)); - f32 y = get_view_y(&view); + f32 y = get_view_y(app, view); y = y - h*.5f; scroll.target_y = (i32)(y + .5f); - view_set_scroll(app, &view, scroll); + view_set_scroll(app, view, scroll); } CUSTOM_COMMAND_SIG(left_adjust_view) CUSTOM_DOC("Sets the left size of the view near the x position of the cursor.") { - View_Summary view = get_active_view(app, AccessProtected); - - GUI_Scroll_Vars scroll = view.scroll_vars; - - f32 x = get_view_x(&view) - 30.f; - if (x < 0){ - x = 0.f; - } - + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + GUI_Scroll_Vars scroll = {}; + view_get_scroll_vars(app, view, &scroll); + f32 x = clamp_bottom(0.f, get_view_x(app, view) - 30.f); scroll.target_x = (i32)(x + .5f); - view_set_scroll(app, &view, scroll); + view_set_scroll(app, view, scroll); } static b32 @@ -201,70 +213,86 @@ view_space_from_screen_space_checked(Vec2_i32 p, Rect_i32 file_region, Vec2 scro CUSTOM_COMMAND_SIG(click_set_cursor_and_mark) CUSTOM_DOC("Sets the cursor position and mark to the mouse position.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + Rect_i32 region = {}; + view_get_buffer_region(app, view, ®ion); + GUI_Scroll_Vars scroll_vars = {}; + view_get_scroll_vars(app, view, &scroll_vars); Mouse_State mouse = get_mouse_state(app); Vec2 p = {}; - Rect_i32 region = {}; - view_get_buffer_region(app, view.view_id, ®ion); - if (view_space_from_screen_space_checked(mouse.p, region, view.scroll_vars.scroll_p, &p)){ - view_set_cursor(app, &view, seek_xy(p.x, p.y, true, view.unwrapped_lines), true); - view_set_mark(app, &view, seek_pos(view.cursor.pos)); + if (view_space_from_screen_space_checked(mouse.p, region, scroll_vars.scroll_p, &p)){ + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_wrapped_xy(p.x, p.y, true), &cursor); + view_set_cursor(app, view, seek_pos(cursor.pos), true); + view_set_mark(app, view, seek_pos(cursor.pos)); } } CUSTOM_COMMAND_SIG(click_set_cursor) CUSTOM_DOC("Sets the cursor position to the mouse position.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + Rect_i32 region = {}; + view_get_buffer_region(app, view, ®ion); + GUI_Scroll_Vars scroll_vars = {}; + view_get_scroll_vars(app, view, &scroll_vars); Mouse_State mouse = get_mouse_state(app); Vec2 p = {}; - Rect_i32 region = {}; - view_get_buffer_region(app, view.view_id, ®ion); - if (view_space_from_screen_space_checked(mouse.p, region, view.scroll_vars.scroll_p, &p)){ - view_set_cursor(app, &view, seek_xy(p.x, p.y, true, view.unwrapped_lines), true); + if (view_space_from_screen_space_checked(mouse.p, region, scroll_vars.scroll_p, &p)){ + view_set_cursor(app, view, seek_wrapped_xy(p.x, p.y, true), true); } - no_mark_snap_to_cursor(app, view.view_id); + no_mark_snap_to_cursor(app, view); } CUSTOM_COMMAND_SIG(click_set_cursor_if_lbutton) CUSTOM_DOC("If the mouse left button is pressed, sets the cursor position to the mouse position.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Mouse_State mouse = get_mouse_state(app); if (mouse.l){ - Vec2 p = {}; Rect_i32 region = {}; - view_get_buffer_region(app, view.view_id, ®ion); - if (view_space_from_screen_space_checked(mouse.p, region, view.scroll_vars.scroll_p, &p)){ - view_set_cursor(app, &view, seek_xy(p.x, p.y, true, view.unwrapped_lines), true); + view_get_buffer_region(app, view, ®ion); + GUI_Scroll_Vars scroll_vars = {}; + view_get_scroll_vars(app, view, &scroll_vars); + Vec2 p = {}; + if (view_space_from_screen_space_checked(mouse.p, region, scroll_vars.scroll_p, &p)){ + view_set_cursor(app, view, seek_wrapped_xy(p.x, p.y, true), true); } } - no_mark_snap_to_cursor(app, view.view_id); + no_mark_snap_to_cursor(app, view); } CUSTOM_COMMAND_SIG(click_set_mark) CUSTOM_DOC("Sets the mark position to the mouse position.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + Rect_i32 region = {}; + view_get_buffer_region(app, view, ®ion); + GUI_Scroll_Vars scroll_vars = {}; + view_get_scroll_vars(app, view, &scroll_vars); Mouse_State mouse = get_mouse_state(app); Vec2 p = {}; - Rect_i32 region = {}; - view_get_buffer_region(app, view.view_id, ®ion); - if (view_space_from_screen_space_checked(mouse.p, region, view.scroll_vars.scroll_p, &p)){ - view_set_mark(app, &view, seek_xy(p.x, p.y, true, view.unwrapped_lines)); + if (view_space_from_screen_space_checked(mouse.p, region, scroll_vars.scroll_p, &p)){ + view_set_mark(app, view, seek_wrapped_xy(p.x, p.y, true)); } - no_mark_snap_to_cursor(app, view.view_id); + no_mark_snap_to_cursor(app, view); } CUSTOM_COMMAND_SIG(mouse_wheel_scroll) CUSTOM_DOC("Reads the scroll wheel value from the mouse state and scrolls accordingly.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Mouse_State mouse = get_mouse_state(app); if (mouse.wheel != 0){ - GUI_Scroll_Vars scroll = view.scroll_vars; + GUI_Scroll_Vars scroll = {}; + view_get_scroll_vars(app, view, &scroll); scroll.target_y += mouse.wheel; - view_set_scroll(app, &view, scroll); + view_set_scroll(app, view, scroll); } } @@ -272,46 +300,60 @@ CUSTOM_DOC("Reads the scroll wheel value from the mouse state and scrolls accord static void move_vertical(Application_Links *app, f32 line_multiplier){ - u32 access = AccessProtected; - View_Summary view = get_active_view(app, access); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); - f32 delta_y = line_multiplier*view.line_height; - f32 new_y = get_view_y(&view) + delta_y; - f32 x = view.preferred_x; + Buffer_ID buffer = 0; + view_get_buffer(app, view, AccessProtected, &buffer); + Face_ID face_id = 0; + get_face_id(app, buffer, &face_id); + Face_Metrics metrics = {}; + get_face_metrics(app, face_id, &metrics); - view_set_cursor(app, &view, seek_xy(x, new_y, 0, view.unwrapped_lines), 0); - f32 actual_new_y = get_view_y(&view); + f32 delta_y = line_multiplier*metrics.line_height; + f32 new_y = get_view_y(app, view) + delta_y; + f32 x = 0; + view_get_preferred_x(app, view, &x); + + view_set_cursor(app, view, seek_wrapped_xy(x, new_y, false), false); + f32 actual_new_y = get_view_y(app, view); if (actual_new_y < new_y){ Rect_i32 file_region = {}; - view_get_buffer_region(app, view.view_id, &file_region); + view_get_buffer_region(app, view, &file_region); i32 height = rect_height(file_region); i32 full_scroll_y = (i32)actual_new_y - height/2; - if (view.scroll_vars.target_y < full_scroll_y){ - GUI_Scroll_Vars new_scroll_vars = view.scroll_vars; + GUI_Scroll_Vars scroll_vars = {}; + view_get_scroll_vars(app, view, &scroll_vars); + if (scroll_vars.target_y < full_scroll_y){ + GUI_Scroll_Vars new_scroll_vars = scroll_vars; new_scroll_vars.target_y += (i32)delta_y; if (new_scroll_vars.target_y > full_scroll_y){ new_scroll_vars.target_y = full_scroll_y; } - view_set_scroll(app, &view, new_scroll_vars); + view_set_scroll(app, view, new_scroll_vars); } } - no_mark_snap_to_cursor_if_shift(app, view.view_id); + no_mark_snap_to_cursor_if_shift(app, view); } static f32 -get_page_jump(Application_Links *app, View_Summary *view){ +get_page_jump(Application_Links *app, View_ID view){ Rect_i32 region = {}; - view_get_buffer_region(app, view->view_id, ®ion); + view_get_buffer_region(app, view, ®ion); + Buffer_ID buffer = 0; + view_get_buffer(app, view, AccessProtected, &buffer); + Face_ID face_id = 0; + get_face_id(app, buffer, &face_id); + Face_Metrics metrics = {}; + get_face_metrics(app, face_id, &metrics); f32 page_jump = 1.f; - if (view->line_height > 0.f){ - i32 height = region.y1 - region.y0; - f32 line_count = (f32)(height)/view->line_height; + if (metrics.line_height > 0.f){ + i32 height = rect_height(region); + f32 line_count = (f32)(height)/metrics.line_height; i32 line_count_rounded = (i32)line_count; page_jump = (f32)line_count_rounded - 3.f; - if (page_jump <= 1.f){ - page_jump = 1.f; - } + page_jump = clamp_bottom(1.f, page_jump); } return(page_jump); } @@ -343,29 +385,32 @@ CUSTOM_DOC("Moves the cursor down ten lines.") CUSTOM_COMMAND_SIG(move_down_textual) CUSTOM_DOC("Moves down to the next line of actual text, regardless of line wrapping.") { - View_Summary view = get_active_view(app, AccessOpen); - if (!view.exists){ - return; + View_ID view = 0; + if (get_active_view(app, AccessOpen, &view)){ + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_pos(pos), &cursor); + i32 next_line = cursor.line + 1; + view_set_cursor(app, view, seek_line_char(next_line, 1), true); } - i32 next_line = view.cursor.line + 1; - view_set_cursor(app, &view, seek_line_char(next_line, 1), true); } CUSTOM_COMMAND_SIG(page_up) CUSTOM_DOC("Scrolls the view up one view height and moves the cursor up one view height.") { - u32 access = AccessProtected; - View_Summary view = get_active_view(app, access); - f32 page_jump = get_page_jump(app, &view); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + f32 page_jump = get_page_jump(app, view); move_vertical(app, -page_jump); } CUSTOM_COMMAND_SIG(page_down) CUSTOM_DOC("Scrolls the view down one view height and moves the cursor down one view height.") { - u32 access = AccessProtected; - View_Summary view = get_active_view(app, access); - f32 page_jump = get_page_jump(app, &view); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + f32 page_jump = get_page_jump(app, view); move_vertical(app, page_jump); } @@ -374,34 +419,43 @@ CUSTOM_DOC("Scrolls the view down one view height and moves the cursor down one CUSTOM_COMMAND_SIG(move_left) CUSTOM_DOC("Moves the cursor one character to the left.") { - u32 access = AccessProtected; - View_Summary view = get_active_view(app, access); - i32 new_pos = view.cursor.character_pos - 1; - view_set_cursor(app, &view, seek_character_pos(new_pos), 1); - no_mark_snap_to_cursor_if_shift(app, view.view_id); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_pos(pos), &cursor); + i32 new_pos = clamp_bottom(0, cursor.character_pos - 1); + view_set_cursor(app, view, seek_character_pos(new_pos), true); + no_mark_snap_to_cursor_if_shift(app, view); } CUSTOM_COMMAND_SIG(move_right) CUSTOM_DOC("Moves the cursor one character to the right.") { - u32 access = AccessProtected; - View_Summary view = get_active_view(app, access); - i32 new_pos = view.cursor.character_pos + 1; - view_set_cursor(app, &view, seek_character_pos(new_pos), 1); - no_mark_snap_to_cursor_if_shift(app, view.view_id); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_pos(pos), &cursor); + i32 new_pos = cursor.character_pos + 1; + view_set_cursor(app, view, seek_character_pos(new_pos), 1); + no_mark_snap_to_cursor_if_shift(app, view); } CUSTOM_COMMAND_SIG(select_all) CUSTOM_DOC("Puts the cursor at the top of the file, and the mark at the bottom of the file.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer); + view_get_buffer(app, view, AccessProtected, &buffer); i32 buffer_size = 0; buffer_get_size(app, buffer, &buffer_size); - view_set_cursor(app, &view, seek_pos(0), true); - view_set_mark(app, &view, seek_pos(buffer_size)); - no_mark_snap_to_cursor(app, view.view_id); + view_set_cursor(app, view, seek_pos(0), true); + view_set_mark(app, view, seek_pos(buffer_size)); + no_mark_snap_to_cursor(app, view); } //////////////////////////////// @@ -409,11 +463,12 @@ CUSTOM_DOC("Puts the cursor at the top of the file, and the mark at the bottom o CUSTOM_COMMAND_SIG(to_uppercase) CUSTOM_DOC("Converts all ascii text in the range between the cursor and the mark to uppercase.") { - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer); - Range range = get_view_range(app, view.view_id); - i32 size = range.max - range.min; + view_get_buffer(app, view, AccessOpen, &buffer); + Range range = get_view_range(app, view); + i32 size = get_width(range); if (size <= app->memory_size){ char *mem = (char*)app->memory; buffer_read_range(app, buffer, range.min, range.max, mem); @@ -421,18 +476,19 @@ CUSTOM_DOC("Converts all ascii text in the range between the cursor and the mark mem[i] = char_to_upper(mem[i]); } buffer_replace_range(app, buffer, range, make_string(mem, size)); - view_set_cursor(app, &view, seek_pos(range.max), true); + view_set_cursor(app, view, seek_pos(range.max), true); } } CUSTOM_COMMAND_SIG(to_lowercase) CUSTOM_DOC("Converts all ascii text in the range between the cursor and the mark to lowercase.") { - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer); - Range range = get_view_range(app, view.view_id); - i32 size = range.max - range.min; + view_get_buffer(app, view, AccessOpen, &buffer); + Range range = get_view_range(app, view); + i32 size = get_width(range); if (size <= app->memory_size){ char *mem = (char*)app->memory; buffer_read_range(app, buffer, range.min, range.max, mem); @@ -440,7 +496,7 @@ CUSTOM_DOC("Converts all ascii text in the range between the cursor and the mark mem[i] = char_to_lower(mem[i]); } buffer_replace_range(app, buffer, range, make_string(mem, size)); - view_set_cursor(app, &view, seek_pos(range.max), true); + view_set_cursor(app, view, seek_pos(range.max), true); } } @@ -450,9 +506,10 @@ CUSTOM_DOC("Removes trailing whitespace from all lines in the current buffer.") // TODO(allen): This command always iterates accross the entire // buffer, so streaming it is actually the wrong call. Rewrite this // to minimize calls to buffer_read_range. - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer_id = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer_id); + view_get_buffer(app, view, AccessOpen, &buffer_id); i32 buffer_size = 0; i32 line_count = 0; @@ -516,16 +573,18 @@ CUSTOM_DOC("Removes trailing whitespace from all lines in the current buffer.") CUSTOM_COMMAND_SIG(basic_change_active_panel) CUSTOM_DOC("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.") { - View_Summary view = get_active_view(app, AccessAll); - get_next_view_looped_all_panels(app, &view, AccessAll); - set_active_view(app, &view); + View_ID view = 0; + get_active_view(app, AccessAll, &view); + get_next_view_looped_all_panels(app, view, AccessAll); + view_set_active(app, view); } CUSTOM_COMMAND_SIG(close_panel) CUSTOM_DOC("Closes the currently active panel if it is not the only panel open.") { - View_Summary view = get_active_view(app, AccessAll); - close_view(app, &view); + View_ID view = 0; + get_active_view(app, AccessAll, &view); + view_close(app, view); } //////////////////////////////// @@ -533,48 +592,55 @@ CUSTOM_DOC("Closes the currently active panel if it is not the only panel open." CUSTOM_COMMAND_SIG(show_scrollbar) CUSTOM_DOC("Sets the current view to show it's scrollbar.") { - View_Summary view = get_active_view(app, AccessAll); - view_set_setting(app, &view, ViewSetting_ShowScrollbar, true); + View_ID view = 0; + get_active_view(app, AccessAll, &view); + view_set_setting(app, view, ViewSetting_ShowScrollbar, true); } CUSTOM_COMMAND_SIG(hide_scrollbar) CUSTOM_DOC("Sets the current view to hide it's scrollbar.") { - View_Summary view = get_active_view(app, AccessAll); - view_set_setting(app, &view, ViewSetting_ShowScrollbar, false); + View_ID view = 0; + get_active_view(app, AccessAll, &view); + view_set_setting(app, view, ViewSetting_ShowScrollbar, false); } CUSTOM_COMMAND_SIG(show_filebar) CUSTOM_DOC("Sets the current view to show it's filebar.") { - View_Summary view = get_active_view(app, AccessAll); - view_set_setting(app, &view, ViewSetting_ShowFileBar, true); + View_ID view = 0; + get_active_view(app, AccessAll, &view); + view_set_setting(app, view, ViewSetting_ShowFileBar, true); } CUSTOM_COMMAND_SIG(hide_filebar) CUSTOM_DOC("Sets the current view to hide it's filebar.") { - View_Summary view = get_active_view(app, AccessAll); - view_set_setting(app, &view, ViewSetting_ShowFileBar, false); + View_ID view = 0; + get_active_view(app, AccessAll, &view); + view_set_setting(app, view, ViewSetting_ShowFileBar, false); } CUSTOM_COMMAND_SIG(toggle_filebar) CUSTOM_DOC("Toggles the visibility status of the current view's filebar.") { - View_Summary view = get_active_view(app, AccessAll); + View_ID view = 0; + get_active_view(app, AccessAll, &view); b32 value; - view_get_setting(app, &view, ViewSetting_ShowFileBar, &value); - view_set_setting(app, &view, ViewSetting_ShowFileBar, !value); + view_get_setting(app, view, ViewSetting_ShowFileBar, &value); + view_set_setting(app, view, ViewSetting_ShowFileBar, !value); } CUSTOM_COMMAND_SIG(toggle_line_wrap) CUSTOM_DOC("Toggles the current buffer's line wrapping status.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer); - b32 unwrapped = view.unwrapped_lines; - buffer_set_setting(app, buffer, BufferSetting_WrapLine, unwrapped); + view_get_buffer(app, view, AccessProtected, &buffer); + b32 wrapped; + buffer_get_setting(app, buffer, BufferSetting_WrapLine, &wrapped); + buffer_set_setting(app, buffer, BufferSetting_WrapLine, !wrapped); } CUSTOM_COMMAND_SIG(toggle_fps_meter) @@ -586,9 +652,10 @@ CUSTOM_DOC("Toggles the visibility of the FPS performance meter") CUSTOM_COMMAND_SIG(increase_line_wrap) CUSTOM_DOC("Increases the current buffer's width for line wrapping.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer); + view_get_buffer(app, view, AccessProtected, &buffer); i32 wrap = 0; buffer_get_setting(app, buffer, BufferSetting_WrapPosition, &wrap); buffer_set_setting(app, buffer, BufferSetting_WrapPosition, wrap + 10); @@ -597,9 +664,10 @@ CUSTOM_DOC("Increases the current buffer's width for line wrapping.") CUSTOM_COMMAND_SIG(decrease_line_wrap) CUSTOM_DOC("Decrases the current buffer's width for line wrapping.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer); + view_get_buffer(app, view, AccessProtected, &buffer); i32 wrap = 0; buffer_get_setting(app, buffer, BufferSetting_WrapPosition, &wrap); buffer_set_setting(app, buffer, BufferSetting_WrapPosition, wrap - 10); @@ -608,9 +676,10 @@ CUSTOM_DOC("Decrases the current buffer's width for line wrapping.") CUSTOM_COMMAND_SIG(increase_face_size) CUSTOM_DOC("Increase the size of the face used by the current buffer.") { - View_Summary view = get_active_view(app, AccessAll); + View_ID view = 0; + get_active_view(app, AccessAll, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessAll, &buffer); + view_get_buffer(app, view, AccessAll, &buffer); Face_ID face_id = 0; get_face_id(app, buffer, &face_id); Face_Description description = get_face_description(app, face_id); @@ -621,9 +690,10 @@ CUSTOM_DOC("Increase the size of the face used by the current buffer.") CUSTOM_COMMAND_SIG(decrease_face_size) CUSTOM_DOC("Decrease the size of the face used by the current buffer.") { - View_Summary view = get_active_view(app, AccessAll); + View_ID view = 0; + get_active_view(app, AccessAll, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessAll, &buffer); + view_get_buffer(app, view, AccessAll, &buffer); Face_ID face_id = 0; get_face_id(app, buffer, &face_id); Face_Description description = get_face_description(app, face_id); @@ -651,9 +721,10 @@ CUSTOM_DOC("Reads the state of the mouse wheel and uses it to either increase or CUSTOM_COMMAND_SIG(toggle_virtual_whitespace) CUSTOM_DOC("Toggles the current buffer's virtual whitespace status.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer); + view_get_buffer(app, view, AccessProtected, &buffer); i32 vwhite = 0; buffer_get_setting(app, buffer, BufferSetting_VirtualWhitespace, &vwhite); buffer_set_setting(app, buffer, BufferSetting_VirtualWhitespace, !vwhite); @@ -662,8 +733,11 @@ CUSTOM_DOC("Toggles the current buffer's virtual whitespace status.") CUSTOM_COMMAND_SIG(toggle_show_whitespace) CUSTOM_DOC("Toggles the current buffer's whitespace visibility status.") { - View_Summary view = get_active_view(app, AccessProtected); - view_set_setting(app, &view, ViewSetting_ShowWhitespace, !view.show_whitespace); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + b32 show_whitespace; + view_get_setting(app, view, ViewSetting_ShowWhitespace, &show_whitespace); + view_set_setting(app, view, ViewSetting_ShowWhitespace, !show_whitespace); } CUSTOM_COMMAND_SIG(toggle_line_numbers) @@ -675,18 +749,20 @@ CUSTOM_DOC("Toggles the left margin line numbers.") CUSTOM_COMMAND_SIG(eol_dosify) CUSTOM_DOC("Puts the buffer in DOS line ending mode.") { - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer); + view_get_buffer(app, view, AccessOpen, &buffer); buffer_set_setting(app, buffer, BufferSetting_Eol, 1); } CUSTOM_COMMAND_SIG(eol_nixify) CUSTOM_DOC("Puts the buffer in NIX line ending mode.") { - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer); + view_get_buffer(app, view, AccessOpen, &buffer); buffer_set_setting(app, buffer, BufferSetting_Eol, 0); } @@ -701,19 +777,15 @@ CUSTOM_DOC("Attempts to close 4coder.") CUSTOM_COMMAND_SIG(goto_line) CUSTOM_DOC("Queries the user for a number, and jumps the cursor to the corresponding line.") { - u32 access = AccessProtected; - Query_Bar bar = {}; char string_space[256]; - bar.prompt = make_lit_string("Goto Line: "); bar.string = make_fixed_width_string(string_space); - if (query_user_number(app, &bar)){ i32 line_number = str_to_int_s(bar.string); - - View_Summary view = get_active_view(app, access); - view_set_cursor(app, &view, seek_line_char(line_number, 0), true); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + view_set_cursor(app, view, seek_line_char(line_number, 0), true); } } @@ -721,8 +793,7 @@ CUSTOM_COMMAND_SIG(search); CUSTOM_COMMAND_SIG(reverse_search); static void -isearch__update_highlight(Application_Links *app, View_Summary *view, Managed_Object highlight, - i32 start, i32 end){ +isearch__update_highlight(Application_Links *app, View_ID view, Managed_Object highlight, i32 start, i32 end){ Marker markers[4] = {}; markers[0].pos = start; markers[1].pos = end; @@ -732,9 +803,10 @@ isearch__update_highlight(Application_Links *app, View_Summary *view, Managed_Ob static void isearch(Application_Links *app, b32 start_reversed, String query_init, b32 on_the_query_init_string){ - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer_id = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer_id); + view_get_buffer(app, view, AccessProtected, &buffer_id); if (!buffer_exists(app, buffer_id)){ return; } @@ -745,7 +817,8 @@ isearch(Application_Links *app, b32 start_reversed, String query_init, b32 on_th } b32 reverse = start_reversed; - i32 first_pos = view.cursor.pos; + i32 first_pos = 0; + view_get_cursor_pos(app, view, &first_pos); i32 pos = first_pos; if (query_init.size != 0){ @@ -764,16 +837,16 @@ isearch(Application_Links *app, b32 start_reversed, String query_init, b32 on_th b32 first_step = true; - Managed_Scope view_scope = view_get_managed_scope(app, view.view_id); + Managed_Scope view_scope = view_get_managed_scope(app, view); Managed_Object highlight = alloc_buffer_markers_on_buffer(app, buffer_id, 2, &view_scope); Marker_Visual visual = create_marker_visual(app, highlight); marker_visual_set_effect(app, visual, VisualType_CharacterHighlightRanges, Stag_Highlight, Stag_At_Highlight, 0); - marker_visual_set_view_key(app, visual, view.view_id); + marker_visual_set_view_key(app, visual, view); marker_visual_set_priority(app, visual, VisualPriority_Default + 1); - isearch__update_highlight(app, &view, highlight, match.start, match.end); + isearch__update_highlight(app, view, highlight, match.start, match.end); cursor_is_hidden = true; User_Input in = {}; @@ -905,7 +978,7 @@ isearch(Application_Links *app, b32 start_reversed, String query_init, b32 on_th } if (!suppress_highligh_update){ - isearch__update_highlight(app, &view, highlight, match.start, match.end); + isearch__update_highlight(app, view, highlight, match.start, match.end); } } @@ -916,7 +989,7 @@ isearch(Application_Links *app, b32 start_reversed, String query_init, b32 on_th String previous_isearch_query_str = make_fixed_width_string(previous_isearch_query); append(&previous_isearch_query_str, bar.string); terminate_with_null(&previous_isearch_query_str); - view_set_cursor(app, &view, seek_pos(first_pos), true); + view_set_cursor(app, view, seek_pos(first_pos), true); } } @@ -937,81 +1010,80 @@ CUSTOM_DOC("Begins an incremental search up through the current buffer for a use CUSTOM_COMMAND_SIG(search_identifier) CUSTOM_DOC("Begins an incremental search down through the current buffer for the word or token under the cursor.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer_id = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer_id); + view_get_buffer(app, view, AccessProtected, &buffer_id); + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); char space[256]; - String query = read_identifier_at_pos(app, buffer_id, view.cursor.pos, space, sizeof(space), 0); + String query = read_identifier_at_pos(app, buffer_id, pos, space, sizeof(space), 0); isearch(app, false, query, true); } CUSTOM_COMMAND_SIG(reverse_search_identifier) CUSTOM_DOC("Begins an incremental search up through the current buffer for the word or token under the cursor.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer_id = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer_id); + view_get_buffer(app, view, AccessProtected, &buffer_id); + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); char space[256]; - String query = read_identifier_at_pos(app, buffer_id, view.cursor.pos, space, sizeof(space), 0); + String query = read_identifier_at_pos(app, buffer_id, pos, space, sizeof(space), 0); isearch(app, true, query, true); } CUSTOM_COMMAND_SIG(replace_in_range) CUSTOM_DOC("Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.") { - Query_Bar replace; + Query_Bar replace = {}; char replace_space[1024]; replace.prompt = make_lit_string("Replace: "); replace.string = make_fixed_width_string(replace_space); - Query_Bar with; + Query_Bar with = {}; char with_space[1024]; with.prompt = make_lit_string("With: "); with.string = make_fixed_width_string(with_space); - if (!query_user_string(app, &replace)) return; - if (replace.string.size == 0) return; - - if (!query_user_string(app, &with)) return; - - String r = replace.string; - String w = with.string; - - u32 access = AccessOpen; - View_Summary view = get_active_view(app, access); - Buffer_ID buffer_id = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer_id); - - Range range = get_view_range(app, view.view_id); - - i32 pos = range.min; - i32 new_pos; - buffer_seek_string_forward(app, buffer_id, pos, 0, r.str, r.size, &new_pos); - - global_history_edit_group_begin(app); - for (;new_pos + r.size <= range.end;){ - buffer_replace_range(app, buffer_id, make_range(new_pos, new_pos + r.size), w); - refresh_view(app, &view); - range = get_view_range(app, view.view_id); - pos = new_pos + w.size; + if (query_user_string(app, &replace) && replace.string.size != 0 && query_user_string(app, &with)){ + String r = replace.string; + String w = with.string; + + View_Summary view = get_active_view(app, AccessOpen); + Buffer_ID buffer_id = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer_id); + + Range range = get_view_range(app, view.view_id); + + i32 pos = range.min; + i32 new_pos; buffer_seek_string_forward(app, buffer_id, pos, 0, r.str, r.size, &new_pos); + + global_history_edit_group_begin(app); + for (;new_pos + r.size <= range.end;){ + buffer_replace_range(app, buffer_id, make_range(new_pos, new_pos + r.size), w); + refresh_view(app, &view); + range = get_view_range(app, view.view_id); + pos = new_pos + w.size; + buffer_seek_string_forward(app, buffer_id, pos, 0, r.str, r.size, &new_pos); + } + global_history_edit_group_end(app); } - global_history_edit_group_end(app); } static void -query_replace_base(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, i32 pos, String r, String w){ +query_replace_base(Application_Links *app, View_ID view, Buffer_ID buffer_id, i32 pos, String r, String w){ i32 new_pos = 0; buffer_seek_string_forward(app, buffer_id, pos, 0, r.str, r.size, &new_pos); - Managed_Scope view_scope = view_get_managed_scope(app, view->view_id); + Managed_Scope view_scope = view_get_managed_scope(app, view); Managed_Object highlight = alloc_buffer_markers_on_buffer(app, buffer_id, 2, &view_scope); Marker_Visual visual = create_marker_visual(app, highlight); - marker_visual_set_effect(app, visual, - VisualType_CharacterHighlightRanges, - Stag_Highlight, - Stag_At_Highlight, 0); - marker_visual_set_view_key(app, visual, view->view_id); + marker_visual_set_effect(app, visual, VisualType_CharacterHighlightRanges, Stag_Highlight, Stag_At_Highlight, 0); + marker_visual_set_view_key(app, visual, view); cursor_is_hidden = true; i32 buffer_size = 0; @@ -1062,32 +1134,32 @@ query_replace_parameter(Application_Links *app, String replace_str, i32 start_po with.prompt = make_lit_string("With: "); with.string = make_fixed_width_string(with_space); - if (!query_user_string(app, &with)){ - return; + if (query_user_string(app, &with)){ + String r = replace.string; + String w = with.string; + + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + Buffer_ID buffer_id = 0; + view_get_buffer(app, view, AccessProtected, &buffer_id); + i32 pos = start_pos; + + Query_Bar bar; + bar.prompt = make_lit_string("Replace? (y)es, (n)ext, (esc)\n"); + bar.string = null_string; + start_query_bar(app, &bar, 0); + + query_replace_base(app, view, buffer_id, pos, r, w); } - - String r = replace.string; - String w = with.string; - - View_Summary view = get_active_view(app, AccessOpen); - Buffer_ID buffer_id = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer_id); - i32 pos = start_pos; - - Query_Bar bar; - bar.prompt = make_lit_string("Replace? (y)es, (n)ext, (esc)\n"); - bar.string = null_string; - start_query_bar(app, &bar, 0); - - query_replace_base(app, &view, buffer_id, pos, r, w); } CUSTOM_COMMAND_SIG(query_replace) CUSTOM_DOC("Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.") { - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer); + view_get_buffer(app, view, AccessOpen, &buffer); if (buffer != 0){ Query_Bar replace = {}; char replace_space[1024]; @@ -1095,7 +1167,9 @@ CUSTOM_DOC("Queries the user for two strings, and incrementally replaces every o replace.string = make_fixed_width_string(replace_space); if (query_user_string(app, &replace)){ if (replace.string.size > 0){ - query_replace_parameter(app, replace.string, view.cursor.pos, false); + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); + query_replace_parameter(app, replace.string, pos, false); } } } @@ -1104,14 +1178,16 @@ CUSTOM_DOC("Queries the user for two strings, and incrementally replaces every o CUSTOM_COMMAND_SIG(query_replace_identifier) CUSTOM_DOC("Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.") { - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer_id = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer_id); + view_get_buffer(app, view, AccessOpen, &buffer_id); if (buffer_id != 0){ + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); Range range = {}; char space[256]; - String replace = read_identifier_at_pos(app, buffer_id, view.cursor.pos, space, sizeof(space), &range); - + String replace = read_identifier_at_pos(app, buffer_id, pos, space, sizeof(space), &range); if (replace.size != 0){ query_replace_parameter(app, replace, range.min, true); } @@ -1121,15 +1197,14 @@ CUSTOM_DOC("Queries the user for a string, and incrementally replace every occur CUSTOM_COMMAND_SIG(query_replace_selection) CUSTOM_DOC("Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.") { - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessOpen, &buffer); + view_get_buffer(app, view, AccessOpen, &buffer); if (buffer != 0){ - Partition *part = &global_part; Temp_Memory temp = begin_temp_memory(part); - - Range range = get_view_range(app, view.view_id); + Range range = get_view_range(app, view); i32 replace_length = range.max - range.min; if (replace_length != 0){ char *replace_space = push_array(part, char, replace_length); @@ -1138,7 +1213,6 @@ CUSTOM_DOC("Queries the user for a string, and incrementally replace every occur query_replace_parameter(app, replace, range.min, true); } } - end_temp_memory(temp); } } @@ -1197,9 +1271,10 @@ delete_file_base(Application_Links *app, String file_name, Buffer_ID buffer_id){ CUSTOM_COMMAND_SIG(delete_file_query) CUSTOM_DOC("Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.") { - View_Summary view = get_active_view(app, AccessAll); + View_ID view = 0; + get_active_view(app, AccessAll, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessAll, &buffer); + view_get_buffer(app, view, AccessAll, &buffer); Arena *scratch = context_get_arena(app); Temp_Memory_Arena temp = begin_temp_memory(scratch); String file_name = buffer_push_file_name(app, buffer, scratch); @@ -1224,9 +1299,10 @@ CUSTOM_DOC("Deletes the file of the current buffer if 4coder has the appropriate CUSTOM_COMMAND_SIG(save_to_query) CUSTOM_DOC("Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.") { - View_Summary view = get_active_view(app, AccessAll); + View_ID view = 0; + get_active_view(app, AccessAll, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessAll, &buffer); + view_get_buffer(app, view, AccessAll, &buffer); Arena *scratch = context_get_arena(app); Temp_Memory_Arena temp = begin_temp_memory(scratch); @@ -1255,7 +1331,7 @@ CUSTOM_DOC("Queries the user for a file name and saves the contents of the curre create_buffer(app, new_file_name, BufferCreate_NeverNew|BufferCreate_JustChangedFile, &new_buffer); if (new_buffer != 0 && new_buffer != buffer){ kill_buffer(app, buffer_identifier(buffer), 0, BufferKill_AlwaysKill); - view_set_buffer(app, &view, new_buffer, 0); + view_set_buffer(app, view, new_buffer, 0); } } } @@ -1269,9 +1345,10 @@ CUSTOM_DOC("Queries the user for a file name and saves the contents of the curre CUSTOM_COMMAND_SIG(rename_file_query) CUSTOM_DOC("Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.") { - View_Summary view = get_active_view(app, AccessAll); + View_ID view = 0; + get_active_view(app, AccessAll, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessAll, &buffer); + view_get_buffer(app, view, AccessAll, &buffer); Arena *scratch = context_get_arena(app); Temp_Memory_Arena temp = begin_temp_memory(scratch); @@ -1305,7 +1382,7 @@ CUSTOM_DOC("Queries the user for a new name and renames the file of the current create_buffer(app, new_file_name, BufferCreate_NeverNew|BufferCreate_JustChangedFile, &new_buffer); if (new_buffer != 0 && new_buffer != buffer){ delete_file_base(app, file_name, buffer); - view_set_buffer(app, &view, new_buffer, 0); + view_set_buffer(app, view, new_buffer, 0); } } } @@ -1352,21 +1429,27 @@ CUSTOM_DOC("Queries the user for a name and creates a new directory with the giv CUSTOM_COMMAND_SIG(move_line_up) CUSTOM_DOC("Swaps the line under the cursor with the line above it, and moves the cursor up with it.") { - View_Summary view = get_active_view(app, AccessOpen); - if (view.cursor.line > 1){ + View_ID view = 0; + get_active_view(app, AccessOpen, &view); + i32 cursor_pos = 0; + view_get_cursor_pos(app, view, &cursor_pos); + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_pos(cursor_pos), &cursor); + + if (cursor.line > 1){ Buffer_ID buffer = 0; - if (view_get_buffer(app, view.view_id, AccessOpen, &buffer)){ + if (view_get_buffer(app, view, AccessOpen, &buffer)){ Full_Cursor prev_line_cursor = {}; Full_Cursor this_line_cursor = {}; Full_Cursor next_line_cursor = {}; - i32 this_line = view.cursor.line; + i32 this_line = cursor.line; i32 prev_line = this_line - 1; i32 next_line = this_line + 1; - if (view_compute_cursor(app, &view, seek_line_char(prev_line, 1), &prev_line_cursor) && - view_compute_cursor(app, &view, seek_line_char(this_line, 1), &this_line_cursor) && - view_compute_cursor(app, &view, seek_line_char(next_line, 1), &next_line_cursor)){ + if (view_compute_cursor(app, view, seek_line_char(prev_line, 1), &prev_line_cursor) && + view_compute_cursor(app, view, seek_line_char(this_line, 1), &this_line_cursor) && + view_compute_cursor(app, view, seek_line_char(next_line, 1), &next_line_cursor)){ i32 prev_line_pos = prev_line_cursor.pos; i32 this_line_pos = this_line_cursor.pos; @@ -1398,7 +1481,7 @@ CUSTOM_DOC("Swaps the line under the cursor with the line above it, and moves th if (buffer_read_range(app, buffer, prev_line_pos, this_line_pos, swap + first_len)){ buffer_replace_range(app, buffer, make_range(prev_line_pos, next_line_pos), make_string(swap, length)); - view_set_cursor(app, &view, seek_line_char(prev_line, 1), true); + view_set_cursor(app, view, seek_line_char(prev_line, 1), true); } } @@ -1411,13 +1494,18 @@ CUSTOM_DOC("Swaps the line under the cursor with the line above it, and moves th CUSTOM_COMMAND_SIG(move_line_down) CUSTOM_DOC("Swaps the line under the cursor with the line below it, and moves the cursor down with it.") { - View_Summary view = get_active_view(app, AccessOpen); - if (view.exists){ - i32 next_line = view.cursor.line + 1; + View_ID view = 0; + get_active_view(app, AccessOpen, &view); + if (view != 0){ + i32 cursor_pos = 0; + view_get_cursor_pos(app, view, &cursor_pos); + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_pos(cursor_pos), &cursor); + i32 next_line = cursor.line + 1; Full_Cursor new_cursor = {}; - if (view_compute_cursor(app, &view, seek_line_char(next_line, 1), &new_cursor)){ + if (view_compute_cursor(app, view, seek_line_char(next_line, 1), &new_cursor)){ if (new_cursor.line == next_line){ - view_set_cursor(app, &view, seek_pos(new_cursor.pos), true); + view_set_cursor(app, view, seek_pos(new_cursor.pos), true); move_line_up(app); move_down_textual(app); } @@ -1428,21 +1516,23 @@ CUSTOM_DOC("Swaps the line under the cursor with the line below it, and moves th CUSTOM_COMMAND_SIG(duplicate_line) CUSTOM_DOC("Create a copy of the line on which the cursor sits.") { - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer_id = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer_id); - + view_get_buffer(app, view, AccessOpen, &buffer_id); + i32 cursor_pos = 0; + view_get_cursor_pos(app, view, &cursor_pos); + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_pos(cursor_pos), &cursor); Partition *part = &global_part; - Temp_Memory temp = begin_temp_memory(part); String line_string = {}; char *before_line = push_array(part, char, 1); - if (read_line(app, part, buffer_id, view.cursor.line, &line_string)){ + if (read_line(app, part, buffer_id, cursor.line, &line_string)){ *before_line = '\n'; line_string.str = before_line; line_string.size += 1; - - i32 pos = buffer_get_line_end(app, buffer_id, view.cursor.line); + i32 pos = buffer_get_line_end(app, buffer_id, cursor.line); buffer_replace_range(app, buffer_id, make_range(pos), line_string); } end_temp_memory(temp); @@ -1451,15 +1541,21 @@ CUSTOM_DOC("Create a copy of the line on which the cursor sits.") CUSTOM_COMMAND_SIG(delete_line) CUSTOM_DOC("Delete the line the on which the cursor sits.") { - View_Summary view = get_active_view(app, AccessOpen); + View_ID view = 0; + get_active_view(app, AccessOpen, &view); Buffer_ID buffer_id = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer_id); + view_get_buffer(app, view, AccessOpen, &buffer_id); + + i32 cursor_pos = 0; + view_get_cursor_pos(app, view, &cursor_pos); + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_pos(cursor_pos), &cursor); Partition *part = &global_part; Temp_Memory temp = begin_temp_memory(part); - i32 start = buffer_get_line_start(app, buffer_id, view.cursor.line); - i32 end = buffer_get_line_end(app, buffer_id, view.cursor.line) + 1; + i32 start = buffer_get_line_start(app, buffer_id, cursor.line); + i32 end = buffer_get_line_end(app, buffer_id, cursor.line) + 1; i32 buffer_size = 0; buffer_get_size(app, buffer_id, &buffer_size); if (end > buffer_size){ @@ -1472,8 +1568,7 @@ CUSTOM_DOC("Delete the line the on which the cursor sits.") } } - String zero = {}; - buffer_replace_range(app, buffer_id, make_range(start, end), zero); + buffer_replace_range(app, buffer_id, make_range(start, end), make_lit_string("")); end_temp_memory(temp); } @@ -1535,97 +1630,116 @@ get_cpp_matching_file(Application_Links *app, Buffer_ID buffer, Buffer_ID *buffe CUSTOM_COMMAND_SIG(open_file_in_quotes) CUSTOM_DOC("Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer_id = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer_id); - if (!buffer_exists(app, buffer_id)){ - return; - } - - Arena *arena = context_get_arena(app); - Temp_Memory_Arena temp = begin_temp_memory(arena); - - i32 pos = view.cursor.pos; - i32 start = 0; - i32 end = 0; - buffer_seek_delimiter_forward(app, buffer_id, pos, '"', &end); - buffer_seek_delimiter_backward(app, buffer_id, pos, '"', &start); - ++start; - - i32 quoted_name_size = end - start; - char *quoted_name = push_array(arena, char, quoted_name_size); - if (buffer_read_range(app, buffer_id, start, end, quoted_name)){ - String file_name = {}; - buffer_get_file_name(app, buffer_id, 0, &file_name.memory_size); - file_name.memory_size += quoted_name_size + 1; - file_name.str = push_array(arena, char, file_name.memory_size); - buffer_get_file_name(app, buffer_id, &file_name, 0); - remove_last_folder(&file_name); - append(&file_name, make_string(quoted_name, quoted_name_size)); - terminate_with_null(&file_name); + view_get_buffer(app, view, AccessProtected, &buffer_id); + if (buffer_exists(app, buffer_id)){ + Arena *arena = context_get_arena(app); + Temp_Memory_Arena temp = begin_temp_memory(arena); - get_next_view_looped_primary_panels(app, &view, AccessAll); - if (view.exists){ - if (view_open_file(app, &view, file_name.str, file_name.size, true)){ - set_active_view(app, &view); + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); + + i32 start = 0; + i32 end = 0; + buffer_seek_delimiter_forward(app, buffer_id, pos, '"', &end); + buffer_seek_delimiter_backward(app, buffer_id, pos, '"', &start); + ++start; + + i32 quoted_name_size = end - start; + char *quoted_name = push_array(arena, char, quoted_name_size); + if (buffer_read_range(app, buffer_id, start, end, quoted_name)){ + String file_name = {}; + buffer_get_file_name(app, buffer_id, 0, &file_name.memory_size); + file_name.memory_size += quoted_name_size + 1; + file_name.str = push_array(arena, char, file_name.memory_size); + buffer_get_file_name(app, buffer_id, &file_name, 0); + remove_last_folder(&file_name); + append(&file_name, make_string(quoted_name, quoted_name_size)); + terminate_with_null(&file_name); + + get_next_view_looped_primary_panels(app, view, AccessAll); + if (view != 0){ + if (view_open_file(app, view, file_name.str, file_name.size, true)){ + view_set_active(app, view); + } } } + + end_temp_memory(temp); } - - end_temp_memory(temp); } CUSTOM_COMMAND_SIG(open_matching_file_cpp) CUSTOM_DOC("If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.") { - View_Summary view = get_active_view(app, AccessAll); + View_ID view = 0; + get_active_view(app, AccessAll, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessAll, &buffer); + view_get_buffer(app, view, AccessAll, &buffer); Buffer_ID new_buffer = 0; if (get_cpp_matching_file(app, buffer, &new_buffer)){ - get_next_view_looped_primary_panels(app, &view, AccessAll); - view_set_buffer(app, &view, new_buffer, 0); - set_active_view(app, &view); + get_next_view_looped_primary_panels(app, view, AccessAll); + view_set_buffer(app, view, new_buffer, 0); + view_set_active(app, view); } } CUSTOM_COMMAND_SIG(view_buffer_other_panel) CUSTOM_DOC("Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.") { - View_Summary view = get_active_view(app, AccessAll); - i32 buffer_id = view.buffer_id; + View_ID view = 0; + get_active_view(app, AccessAll, &view); + Buffer_ID buffer = 0; + view_get_buffer(app, view, AccessAll, &buffer); + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); change_active_panel(app); - view = get_active_view(app, AccessAll); - view_set_buffer(app, &view, buffer_id, 0); + get_active_view(app, AccessAll, &view); + view_set_buffer(app, view, buffer, 0); + view_set_cursor(app, view, seek_pos(pos), true); } CUSTOM_COMMAND_SIG(swap_buffers_between_panels) CUSTOM_DOC("Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.") { - View_Summary view1 = get_active_view(app, AccessAll); + View_ID view1 = 0; + get_active_view(app, AccessAll, &view1); change_active_panel(app); - View_Summary view2 = get_active_view(app, AccessAll); + View_ID view2 = 0; + get_active_view(app, AccessAll, &view2); - if (view1.view_id != view2.view_id){ - i32 buffer_id1 = view1.buffer_id; - i32 buffer_id2 = view2.buffer_id; - if (buffer_id1 != buffer_id2){ - view_set_buffer(app, &view1, buffer_id2, 0); - view_set_buffer(app, &view2, buffer_id1, 0); + if (view1 != view2){ + Buffer_ID buffer1 = 0; + Buffer_ID buffer2 = 0; + view_get_buffer(app, view1, AccessAll, &buffer1); + view_get_buffer(app, view2, AccessAll, &buffer2); + if (buffer1 != buffer2){ + view_set_buffer(app, view1, buffer2, 0); + view_set_buffer(app, view2, buffer1, 0); } else{ - Full_Cursor v1_c = view1.cursor; - Full_Cursor v1_m = view1.mark; - GUI_Scroll_Vars v1_r = view1.scroll_vars; - Full_Cursor v2_c = view2.cursor; - Full_Cursor v2_m = view2.mark; - GUI_Scroll_Vars v2_r = view2.scroll_vars; - view_set_cursor(app, &view1, seek_pos(v2_c.pos), true); - view_set_mark (app, &view1, seek_pos(v2_m.pos)); - view_set_scroll(app, &view1, v2_r); - view_set_cursor(app, &view2, seek_pos(v1_c.pos), true); - view_set_mark (app, &view2, seek_pos(v1_m.pos)); - view_set_scroll(app, &view2, v1_r); + i32 p1 = 0; + i32 m1 = 0; + i32 p2 = 0; + i32 m2 = 0; + GUI_Scroll_Vars sc1 = {}; + GUI_Scroll_Vars sc2 = {}; + + view_get_cursor_pos(app, view1, &p1); + view_get_mark_pos(app, view1, &m1); + view_get_scroll_vars(app, view1, &sc1); + view_get_cursor_pos(app, view2, &p2); + view_get_mark_pos(app, view2, &m2); + view_get_scroll_vars(app, view2, &sc2); + + view_set_cursor(app, view1, seek_pos(p2), true); + view_set_mark (app, view1, seek_pos(m2)); + view_set_scroll(app, view1, sc2); + view_set_cursor(app, view2, seek_pos(p1), true); + view_set_mark (app, view2, seek_pos(m1)); + view_set_scroll(app, view2, sc1); } } } @@ -1635,16 +1749,20 @@ CUSTOM_DOC("Set the other non-active panel to view the buffer that the active pa CUSTOM_COMMAND_SIG(kill_buffer) CUSTOM_DOC("Kills the current buffer.") { - View_Summary view = get_active_view(app, AccessProtected); - kill_buffer(app, buffer_identifier(view.buffer_id), view.view_id, 0); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); + Buffer_ID buffer = 0; + view_get_buffer(app, view, AccessProtected, &buffer); + kill_buffer(app, buffer_identifier(buffer), view, 0); } CUSTOM_COMMAND_SIG(save) CUSTOM_DOC("Saves the current buffer.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer); + view_get_buffer(app, view, AccessProtected, &buffer); Arena *scratch = context_get_arena(app); Temp_Memory_Arena temp = begin_temp_memory(scratch); String file_name = buffer_push_file_name(app, buffer, scratch); @@ -1655,9 +1773,10 @@ CUSTOM_DOC("Saves the current buffer.") CUSTOM_COMMAND_SIG(reopen) CUSTOM_DOC("Reopen the current buffer from the hard drive.") { - View_Summary view = get_active_view(app, AccessProtected); + View_ID view = 0; + get_active_view(app, AccessProtected, &view); Buffer_ID buffer = 0; - view_get_buffer(app, view.view_id, AccessProtected, &buffer); + view_get_buffer(app, view, AccessProtected, &buffer); buffer_reopen(app, buffer, 0, 0); } @@ -1719,14 +1838,16 @@ record_get_new_cursor_position_redo(Application_Links *app, Buffer_ID buffer_id, CUSTOM_COMMAND_SIG(undo_this_buffer) CUSTOM_DOC("Advances backwards through the undo history of the current buffer.") { - View_Summary view = get_active_view(app, AccessOpen); - Buffer_ID buffer_id = view.buffer_id; + View_ID view = 0; + get_active_view(app, AccessOpen, &view); + Buffer_ID buffer = 0; + view_get_buffer(app, view, AccessOpen, &buffer); History_Record_Index current = 0; - buffer_history_get_current_state_index(app, buffer_id, ¤t); + buffer_history_get_current_state_index(app, buffer, ¤t); if (current > 0){ - i32 new_position = record_get_new_cursor_position_undo(app, buffer_id, current); - buffer_history_set_current_state_index(app, buffer_id, current - 1); - view_set_cursor(app, view.view_id, seek_pos(new_position), true); + i32 new_position = record_get_new_cursor_position_undo(app, buffer, current); + buffer_history_set_current_state_index(app, buffer, current - 1); + view_set_cursor(app, view, seek_pos(new_position), true); } } @@ -1734,16 +1855,18 @@ CUSTOM_DOC("Advances backwards through the undo history of the current buffer.") CUSTOM_COMMAND_SIG(redo_this_buffer) CUSTOM_DOC("Advances forwards through the undo history of the current buffer.") { - View_Summary view = get_active_view(app, AccessOpen); - Buffer_ID buffer_id = view.buffer_id; + View_ID view = 0; + get_active_view(app, AccessOpen, &view); + Buffer_ID buffer = 0; + view_get_buffer(app, view, AccessOpen, &buffer); History_Record_Index current = 0; History_Record_Index max_index = 0; - buffer_history_get_current_state_index(app, buffer_id, ¤t); - buffer_history_get_max_record_index(app, buffer_id, &max_index); + buffer_history_get_current_state_index(app, buffer, ¤t); + buffer_history_get_max_record_index(app, buffer, &max_index); if (current < max_index){ - i32 new_position = record_get_new_cursor_position_redo(app, buffer_id, current + 1); - buffer_history_set_current_state_index(app, buffer_id, current + 1); - view_set_cursor(app, view.view_id, seek_pos(new_position), true); + i32 new_position = record_get_new_cursor_position_redo(app, buffer, current + 1); + buffer_history_set_current_state_index(app, buffer, current + 1); + view_set_cursor(app, view, seek_pos(new_position), true); } } diff --git a/4coder_generated/command_metadata.h b/4coder_generated/command_metadata.h index 7bc0ce4c..465f0929 100644 --- a/4coder_generated/command_metadata.h +++ b/4coder_generated/command_metadata.h @@ -259,43 +259,43 @@ static Command_Metadata fcoder_metacmd_table[234] = { { PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 624 }, { PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 637 }, { PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 612 }, -{ PROC_LINKS(backspace_char, 0), "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 104 }, +{ PROC_LINKS(backspace_char, 0), "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 109 }, { PROC_LINKS(backspace_word, 0), "backspace_word", 14, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1241 }, -{ PROC_LINKS(basic_change_active_panel, 0), "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\\4coder_base_commands.cpp", 36, 516 }, +{ PROC_LINKS(basic_change_active_panel, 0), "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\\4coder_base_commands.cpp", 36, 573 }, { PROC_LINKS(build_in_build_panel, 0), "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 180 }, { PROC_LINKS(build_search, 0), "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 146 }, -{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 156 }, +{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 170 }, { PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 236 }, { PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 246 }, { PROC_LINKS(change_to_build_panel, 0), "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 202 }, -{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 447 }, -{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 215 }, -{ PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 201 }, -{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "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\\4coder_base_commands.cpp", 36, 229 }, -{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 245 }, +{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 503 }, +{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 232 }, +{ PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 213 }, +{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "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\\4coder_base_commands.cpp", 36, 249 }, +{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 268 }, { PROC_LINKS(close_all_code, 0), "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1062 }, { PROC_LINKS(close_build_panel, 0), "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 196 }, -{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 524 }, +{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 582 }, { PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 28, 1047 }, { PROC_LINKS(comment_line, 0), "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 143 }, { PROC_LINKS(comment_line_toggle, 0), "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 171 }, { PROC_LINKS(copy, 0), "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 26 }, -{ PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 134 }, +{ PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 144 }, { PROC_LINKS(cut, 0), "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 37 }, -{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 621 }, -{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 597 }, -{ PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 84 }, +{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 690 }, +{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 664 }, +{ PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 87 }, { PROC_LINKS(delete_current_scope, 0), "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 493 }, -{ PROC_LINKS(delete_file_query, 0), "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\\4coder_base_commands.cpp", 36, 1197 }, -{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1451 }, -{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 144 }, +{ PROC_LINKS(delete_file_query, 0), "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\\4coder_base_commands.cpp", 36, 1271 }, +{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1541 }, +{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 157 }, { PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1247 }, -{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1428 }, -{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 675 }, -{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 684 }, +{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1516 }, +{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 749 }, +{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 759 }, { PROC_LINKS(execute_any_cli, 0), "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "w:\\4ed\\code\\4coder_system_command.cpp", 37, 23 }, { PROC_LINKS(execute_previous_cli, 0), "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "w:\\4ed\\code\\4coder_system_command.cpp", 37, 7 }, -{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 693 }, +{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 769 }, { PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1155 }, { PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1164 }, { PROC_LINKS(goto_first_jump_direct, 0), "goto_first_jump_direct", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 83 }, @@ -305,7 +305,7 @@ static Command_Metadata fcoder_metacmd_table[234] = { { PROC_LINKS(goto_jump_at_cursor_same_panel_direct, 0), "goto_jump_at_cursor_same_panel_direct", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list..", 168, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 29 }, { PROC_LINKS(goto_jump_at_cursor_same_panel_sticky, 0), "goto_jump_at_cursor_same_panel_sticky", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 374 }, { PROC_LINKS(goto_jump_at_cursor_sticky, 0), "goto_jump_at_cursor_sticky", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 346 }, -{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 701 }, +{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 777 }, { PROC_LINKS(goto_next_jump_direct, 0), "goto_next_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 47 }, { PROC_LINKS(goto_next_jump_no_skips_direct, 0), "goto_next_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 65 }, { PROC_LINKS(goto_next_jump_no_skips_sticky, 0), "goto_next_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 509 }, @@ -314,19 +314,19 @@ static Command_Metadata fcoder_metacmd_table[234] = { { PROC_LINKS(goto_prev_jump_no_skips_direct, 0), "goto_prev_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 74 }, { PROC_LINKS(goto_prev_jump_no_skips_sticky, 0), "goto_prev_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 529 }, { PROC_LINKS(goto_prev_jump_sticky, 0), "goto_prev_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 495 }, -{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 554 }, -{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 540 }, +{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 616 }, +{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 600 }, { PROC_LINKS(if0_off, 0), "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 84 }, -{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 608 }, -{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 586 }, +{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 676 }, +{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 652 }, { PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\4coder_lists.cpp", 28, 816 }, { PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\4coder_lists.cpp", 28, 929 }, { PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\4coder_lists.cpp", 28, 962 }, { PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\4coder_lists.cpp", 28, 890 }, { PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\4coder_lists.cpp", 28, 796 }, -{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1635 }, +{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1749 }, { PROC_LINKS(kill_rect, 0), "kill_rect", 9, "Delete characters in a rectangular region. Range testing is done by unwrapped-xy coordinates.", 93, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 50 }, -{ PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 172 }, +{ PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 188 }, { PROC_LINKS(list_all_functions_all_buffers, 0), "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "w:\\4ed\\code\\4coder_function_list.cpp", 36, 345 }, { PROC_LINKS(list_all_functions_all_buffers_lister, 0), "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "w:\\4ed\\code\\4coder_function_list.cpp", 36, 351 }, { PROC_LINKS(list_all_functions_current_buffer, 0), "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "w:\\4ed\\code\\4coder_function_list.cpp", 36, 320 }, @@ -359,24 +359,24 @@ static Command_Metadata fcoder_metacmd_table[234] = { { PROC_LINKS(lister__write_character__file_path, 0), "lister__write_character__file_path", 34, "A lister mode command that inserts a character into the text field of a file system list.", 89, "w:\\4ed\\code\\4coder_lists.cpp", 28, 207 }, { PROC_LINKS(lister__write_character__fixed_list, 0), "lister__write_character__fixed_list", 35, "A lister mode command that handles input for the fixed sure to kill list.", 73, "w:\\4ed\\code\\4coder_lists.cpp", 28, 273 }, { PROC_LINKS(load_project, 0), "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1085 }, -{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1319 }, +{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1396 }, { PROC_LINKS(miblo_decrement_basic, 0), "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 113 }, { PROC_LINKS(miblo_decrement_time_stamp, 0), "miblo_decrement_time_stamp", 26, "Decrement a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 391 }, { PROC_LINKS(miblo_decrement_time_stamp_minute, 0), "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 403 }, { PROC_LINKS(miblo_increment_basic, 0), "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 97 }, { PROC_LINKS(miblo_increment_time_stamp, 0), "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 385 }, { PROC_LINKS(miblo_increment_time_stamp_minute, 0), "miblo_increment_time_stamp_minute", 33, "Increment a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 397 }, -{ PROC_LINKS(mouse_wheel_change_face_size, 0), "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\\4coder_base_commands.cpp", 36, 634 }, -{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 259 }, -{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 325 }, -{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 337 }, -{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 343 }, -{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 374 }, -{ PROC_LINKS(move_line_down, 0), "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\\4coder_base_commands.cpp", 36, 1411 }, -{ PROC_LINKS(move_line_up, 0), "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\\4coder_base_commands.cpp", 36, 1352 }, -{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 384 }, -{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 319 }, -{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 331 }, +{ PROC_LINKS(mouse_wheel_change_face_size, 0), "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\\4coder_base_commands.cpp", 36, 704 }, +{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 285 }, +{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 367 }, +{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 379 }, +{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 385 }, +{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 419 }, +{ PROC_LINKS(move_line_down, 0), "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\\4coder_base_commands.cpp", 36, 1494 }, +{ PROC_LINKS(move_line_up, 0), "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\\4coder_base_commands.cpp", 36, 1429 }, +{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 433 }, +{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 361 }, +{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 373 }, { PROC_LINKS(multi_line_edit, 0), "multi_line_edit", 15, "Begin multi-line mode. In multi-line mode characters are inserted at every line between the mark and cursor. All characters are inserted at the same character offset into the line. This mode uses line_char coordinates.", 221, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 136 }, { PROC_LINKS(newline_or_goto_position_direct, 0), "newline_or_goto_position_direct", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 100 }, { PROC_LINKS(newline_or_goto_position_same_panel_direct, 0), "newline_or_goto_position_same_panel_direct", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 114 }, @@ -384,16 +384,16 @@ static Command_Metadata fcoder_metacmd_table[234] = { { PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 585 }, { PROC_LINKS(open_all_code, 0), "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1069 }, { PROC_LINKS(open_all_code_recursive, 0), "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1076 }, -{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1535 }, -{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1939 }, +{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1630 }, +{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 2062 }, { PROC_LINKS(open_long_braces, 0), "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 60 }, { PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 76 }, { PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 68 }, -{ PROC_LINKS(open_matching_file_cpp, 0), "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\\4coder_base_commands.cpp", 36, 1578 }, +{ PROC_LINKS(open_matching_file_cpp, 0), "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\\4coder_base_commands.cpp", 36, 1674 }, { PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 265 }, { PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 256 }, -{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 363 }, -{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 354 }, +{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 408 }, +{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 399 }, { PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 50 }, { PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 142 }, { PROC_LINKS(paste_next, 0), "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 91 }, @@ -402,25 +402,25 @@ static Command_Metadata fcoder_metacmd_table[234] = { { PROC_LINKS(project_command_lister, 0), "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1527 }, { PROC_LINKS(project_fkey_command, 0), "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1092 }, { PROC_LINKS(project_go_to_root_directory, 0), "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1115 }, -{ PROC_LINKS(query_replace, 0), "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\\4coder_base_commands.cpp", 36, 1085 }, -{ PROC_LINKS(query_replace_identifier, 0), "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\\4coder_base_commands.cpp", 36, 1104 }, -{ PROC_LINKS(query_replace_selection, 0), "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\\4coder_base_commands.cpp", 36, 1121 }, -{ PROC_LINKS(redo, 0), "redo", 4, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1829 }, -{ PROC_LINKS(redo_this_buffer, 0), "redo_this_buffer", 16, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1734 }, +{ PROC_LINKS(query_replace, 0), "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\\4coder_base_commands.cpp", 36, 1156 }, +{ PROC_LINKS(query_replace_identifier, 0), "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\\4coder_base_commands.cpp", 36, 1178 }, +{ PROC_LINKS(query_replace_selection, 0), "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\\4coder_base_commands.cpp", 36, 1197 }, +{ PROC_LINKS(redo, 0), "redo", 4, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1952 }, +{ PROC_LINKS(redo_this_buffer, 0), "redo_this_buffer", 16, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1855 }, { PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 386 }, -{ PROC_LINKS(rename_file_query, 0), "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\\4coder_base_commands.cpp", 36, 1269 }, +{ PROC_LINKS(rename_file_query, 0), "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\\4coder_base_commands.cpp", 36, 1345 }, { PROC_LINKS(rename_parameter, 0), "rename_parameter", 16, "If the cursor is found to be on the name of a function parameter in the signature of a function definition, all occurences within the scope of the function will be replaced with a new provided string.", 200, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 425 }, -{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1655 }, +{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1773 }, { PROC_LINKS(replace_all_occurrences, 0), "replace_all_occurrences", 23, "Queries the user for two strings, and replaces all occurrences of the first string with the second string in all open buffers.", 126, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 823 }, -{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 959 }, -{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 930 }, -{ PROC_LINKS(reverse_search_identifier, 0), "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\\4coder_base_commands.cpp", 36, 948 }, -{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1642 }, -{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1171 }, -{ PROC_LINKS(save_to_query, 0), "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\\4coder_base_commands.cpp", 36, 1224 }, +{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1038 }, +{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1003 }, +{ PROC_LINKS(reverse_search_identifier, 0), "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\\4coder_base_commands.cpp", 36, 1024 }, +{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1759 }, +{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1245 }, +{ PROC_LINKS(save_to_query, 0), "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\\4coder_base_commands.cpp", 36, 1299 }, { PROC_LINKS(scope_absorb_down, 0), "scope_absorb_down", 17, "If a scope is currently selected, and a statement or block statement is present below the current scope, the statement is moved into the scope.", 143, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 734 }, -{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 923 }, -{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 937 }, +{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 996 }, +{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1010 }, { PROC_LINKS(seek_alphanumeric_left, 0), "seek_alphanumeric_left", 22, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1221 }, { PROC_LINKS(seek_alphanumeric_or_camel_left, 0), "seek_alphanumeric_or_camel_left", 31, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1233 }, { PROC_LINKS(seek_alphanumeric_or_camel_right, 0), "seek_alphanumeric_or_camel_right", 32, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1227 }, @@ -439,55 +439,55 @@ static Command_Metadata fcoder_metacmd_table[234] = { { PROC_LINKS(seek_whitespace_right, 0), "seek_whitespace_right", 21, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1179 }, { PROC_LINKS(seek_whitespace_up, 0), "seek_whitespace_up", 18, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1041 }, { PROC_LINKS(seek_whitespace_up_end_line, 0), "seek_whitespace_up_end_line", 27, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1125 }, -{ PROC_LINKS(select_all, 0), "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\\4coder_base_commands.cpp", 36, 394 }, +{ PROC_LINKS(select_all, 0), "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\\4coder_base_commands.cpp", 36, 447 }, { PROC_LINKS(select_next_scope_absolute, 0), "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 357 }, { PROC_LINKS(select_prev_scope_absolute, 0), "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 379 }, { PROC_LINKS(select_surrounding_scope, 0), "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 339 }, { PROC_LINKS(set_bindings_choose, 0), "set_bindings_choose", 19, "Remap keybindings using the 'choose' mapping rule.", 50, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 47 }, { PROC_LINKS(set_bindings_default, 0), "set_bindings_default", 20, "Remap keybindings using the 'default' mapping rule.", 51, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 61 }, { PROC_LINKS(set_bindings_mac_default, 0), "set_bindings_mac_default", 24, "Remap keybindings using the 'mac-default' mapping rule.", 55, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 75 }, -{ PROC_LINKS(set_mark, 0), "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 126 }, +{ PROC_LINKS(set_mark, 0), "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 133 }, { PROC_LINKS(set_mode_to_notepad_like, 0), "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 354 }, { PROC_LINKS(set_mode_to_original, 0), "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 348 }, { PROC_LINKS(setup_build_bat, 0), "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1500 }, { PROC_LINKS(setup_build_bat_and_sh, 0), "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1512 }, { PROC_LINKS(setup_build_sh, 0), "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1506 }, { PROC_LINKS(setup_new_project, 0), "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1493 }, -{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 547 }, -{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 533 }, +{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 608 }, +{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 592 }, { PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1253 }, { PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1259 }, { PROC_LINKS(snippet_lister, 0), "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 260 }, { PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 330 }, -{ PROC_LINKS(swap_buffers_between_panels, 0), "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\\4coder_base_commands.cpp", 36, 1602 }, -{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 428 }, -{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 409 }, -{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 561 }, -{ PROC_LINKS(toggle_fps_meter, 0), "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 580 }, +{ PROC_LINKS(swap_buffers_between_panels, 0), "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\\4coder_base_commands.cpp", 36, 1704 }, +{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 483 }, +{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 463 }, +{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 624 }, +{ PROC_LINKS(toggle_fps_meter, 0), "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 646 }, { PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 378 }, { PROC_LINKS(toggle_highlight_enclosing_scopes, 0), "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 366 }, { PROC_LINKS(toggle_highlight_line_at_cursor, 0), "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 360 }, -{ PROC_LINKS(toggle_line_numbers, 0), "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 669 }, -{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 570 }, +{ PROC_LINKS(toggle_line_numbers, 0), "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 743 }, +{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 634 }, { PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 342 }, { PROC_LINKS(toggle_paren_matching_helper, 0), "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 372 }, -{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 662 }, -{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 651 }, +{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 733 }, +{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 721 }, { PROC_LINKS(uncomment_line, 0), "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 157 }, -{ PROC_LINKS(undo, 0), "undo", 4, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1750 }, -{ PROC_LINKS(undo_this_buffer, 0), "undo_this_buffer", 16, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1719 }, -{ PROC_LINKS(view_buffer_other_panel, 0), "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\\4coder_base_commands.cpp", 36, 1592 }, +{ PROC_LINKS(undo, 0), "undo", 4, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1873 }, +{ PROC_LINKS(undo_this_buffer, 0), "undo_this_buffer", 16, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1838 }, +{ PROC_LINKS(view_buffer_other_panel, 0), "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\\4coder_base_commands.cpp", 36, 1689 }, { PROC_LINKS(view_jump_list_with_lister, 0), "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "w:\\4ed\\code\\4coder_jump_lister.cpp", 34, 104 }, { PROC_LINKS(word_complete, 0), "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "w:\\4ed\\code\\4coder_search.cpp", 29, 889 }, { PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 649 }, { PROC_LINKS(write_block, 0), "write_block", 11, "At the cursor, insert a block comment.", 38, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 108 }, -{ PROC_LINKS(write_character, 0), "write_character", 15, "Inserts whatever character was used to trigger this command.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 68 }, +{ PROC_LINKS(write_character, 0), "write_character", 15, "Inserts whatever character was used to trigger this command.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 71 }, { PROC_LINKS(write_explicit_enum_flags, 0), "write_explicit_enum_flags", 25, "If the cursor is found to be on the '{' of an enum definition, the values of the enum will be filled in to give each a unique power of 2 value, starting from 1. Existing values are overwritten.", 194, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 749 }, { PROC_LINKS(write_explicit_enum_values, 0), "write_explicit_enum_values", 26, "If the cursor is found to be on the '{' of an enum definition, the values of the enum will be filled in sequentially starting from zero. Existing values are overwritten.", 170, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 743 }, { PROC_LINKS(write_hack, 0), "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 96 }, { PROC_LINKS(write_note, 0), "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 102 }, { PROC_LINKS(write_todo, 0), "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 90 }, -{ PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 77 }, +{ PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 80 }, { PROC_LINKS(write_zero_struct, 0), "write_zero_struct", 17, "At the cursor, insert a ' = {};'.", 33, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 114 }, }; static int32_t fcoder_metacmd_ID_allow_mouse = 0; diff --git a/4coder_helper.cpp b/4coder_helper.cpp index cebb6787..0a4ad0d1 100644 --- a/4coder_helper.cpp +++ b/4coder_helper.cpp @@ -593,10 +593,10 @@ buffer_identifier_to_id(Application_Links *app, Buffer_Identifier identifier){ } static b32 -view_open_file(Application_Links *app, View_Summary *view, char *filename, i32 filename_len, b32 never_new){ +view_open_file(Application_Links *app, View_ID view, char *filename, i32 filename_len, b32 never_new){ b32 result = false; if (view != 0){ - Buffer_ID buffer = {}; + Buffer_ID buffer = 0; if (open_file(app, &buffer, filename, filename_len, false, never_new)){ view_set_buffer(app, view, buffer, 0); result = true; @@ -681,9 +681,8 @@ refresh_view(Application_Links *app, View_Summary *view){ *view = get_view(app, view->view_id, AccessAll); } -// TODO(allen): Setup buffer seeking to do character_pos and get View_Summary out of this parameter list. static i32 -character_pos_to_pos(Application_Links *app, View_Summary *view, i32 character_pos){ +character_pos_to_pos(Application_Links *app, View_ID view, i32 character_pos){ i32 result = 0; Full_Cursor cursor = {}; if (view_compute_cursor(app, view, seek_character_pos(character_pos), &cursor)){ @@ -692,22 +691,22 @@ character_pos_to_pos(Application_Links *app, View_Summary *view, i32 character_p return(result); } -static float -get_view_y(View_Summary *view){ - float y = view->cursor.wrapped_y; - if (view->unwrapped_lines){ - y = view->cursor.unwrapped_y; - } - return(y); +static f32 +get_view_y(Application_Links *app, View_ID view){ + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_pos(pos), &cursor); + return(cursor.wrapped_y); } -static float -get_view_x(View_Summary *view){ - float x = view->cursor.wrapped_x; - if (view->unwrapped_lines){ - x = view->cursor.unwrapped_x; - } - return(x); +static f32 +get_view_x(Application_Links *app, View_ID view){ + i32 pos = 0; + view_get_cursor_pos(app, view, &pos); + Full_Cursor cursor = {}; + view_compute_cursor(app, view, seek_pos(pos), &cursor); + return(cursor.wrapped_x); } static Range @@ -1556,13 +1555,13 @@ begin_notepad_mode(Application_Links *app){ //////////////////////////////// static b32 -view_set_split_proportion(Application_Links *app, View_Summary *view, float t){ +view_set_split_proportion(Application_Links *app, View_Summary *view, f32 t){ return(view_set_split(app, view, ViewSplitKind_Ratio, t)); } static b32 view_set_split_pixel_size(Application_Links *app, View_Summary *view, i32 t){ - return(view_set_split(app, view, ViewSplitKind_FixedPixels, (float)t)); + return(view_set_split(app, view, ViewSplitKind_FixedPixels, (f32)t)); } //////////////////////////////// @@ -1715,12 +1714,12 @@ buffer_has_name_with_star(Application_Links *app, Buffer_ID buffer){ //////////////////////////////// -static float +static f32 get_dpi_scaling_value(Application_Links *app) { // TODO(casey): Allen, this should return the multiplier for the display relative to whatever 4coder // gets tuned to. - float result = 2.0f; + f32 result = 2.0f; return(result); }