Fix scroll/cursor linking (need more generic version though); cleanup access system; remove some unecessary enum types

This commit is contained in:
Allen Webster 2019-10-17 19:54:02 -07:00
parent e3c4caf076
commit 8d4626f27c
34 changed files with 759 additions and 787 deletions

View File

@ -439,8 +439,6 @@ App_Init_Sig(app_init){
// NOTE(allen): miscellaneous init
hot_directory_init(arena, &models->hot_directory, current_directory);
child_process_container_init(models->tctx->allocator, &models->child_processes);
models->user_up_key = KeyCode_Up;
models->user_down_key = KeyCode_Down;
models->period_wakeup_timer = system_wake_up_timer_create();
}

View File

@ -10,8 +10,8 @@
// TOP
function b32
access_test(u32 lock_flags, u32 access_flags){
return((lock_flags & ~access_flags) == 0);
access_test(Access_Flag object_flags, Access_Flag access_flags){
return((object_flags & access_flags) == access_flags);
}
function b32
@ -49,8 +49,7 @@ is_running_coroutine(Application_Links *app){
}
api(custom) function b32
global_set_setting(Application_Links *app, Global_Setting_ID setting, i64 value)
{
global_set_setting(Application_Links *app, Global_Setting_ID setting, i64 value){
Models *models = (Models*)app->cmd_context;
b32 result = true;
switch (setting){
@ -1116,15 +1115,16 @@ view_get_panel(Application_Links *app, View_ID view_id){
}
api(custom) function View_ID
panel_get_view(Application_Links *app, Panel_ID panel_id){
panel_get_view(Application_Links *app, Panel_ID panel_id, Access_Flag access){
Models *models = (Models*)app->cmd_context;
Panel *panel = imp_get_panel(models, panel_id);
View_ID result = 0;
if (api_check_panel(panel)){
if (panel->kind == PanelKind_Final){
View *view = panel->view;
Assert(view != 0);
result = view_get_id(&models->live_set, view);
if (api_check_view(view, access)){
result = view_get_id(&models->live_set, view);
}
}
}
return(result);
@ -1157,17 +1157,20 @@ panel_is_leaf(Application_Links *app, Panel_ID panel_id){
}
api(custom) function b32
panel_split(Application_Links *app, Panel_ID panel_id, Panel_Split_Orientation orientation){
panel_split(Application_Links *app, Panel_ID panel_id, Dimension split_dim){
Models *models = (Models*)app->cmd_context;
Layout *layout = &models->layout;
b32 result = false;
Panel *panel = imp_get_panel(models, panel_id);
if (api_check_panel(panel)){
Panel *new_panel = 0;
if (layout_split_panel(layout, panel, (orientation == PanelSplit_LeftAndRight), &new_panel)){
if (layout_split_panel(layout, panel, (split_dim == Dimension_X),
&new_panel)){
Live_Views *live_set = &models->live_set;
View *new_view = live_set_alloc_view(&models->lifetime_allocator, live_set, new_panel);
view_init(models, new_view, models->scratch_buffer, models->view_event_handler);
View *new_view = live_set_alloc_view(&models->lifetime_allocator,
live_set, new_panel);
view_init(models, new_view, models->scratch_buffer,
models->view_event_handler);
result = true;
}
}
@ -1175,7 +1178,8 @@ panel_split(Application_Links *app, Panel_ID panel_id, Panel_Split_Orientation o
}
api(custom) function b32
panel_set_split(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind, float t){
panel_set_split(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind,
f32 t){
Models *models = (Models*)app->cmd_context;
Layout *layout = &models->layout;
b32 result = false;
@ -1236,7 +1240,7 @@ panel_get_parent(Application_Links *app, Panel_ID panel_id){
}
api(custom) function Panel_ID
panel_get_child(Application_Links *app, Panel_ID panel_id, Panel_Child which_child){
panel_get_child(Application_Links *app, Panel_ID panel_id, Side which_child){
Models *models = (Models*)app->cmd_context;
Layout *layout = &models->layout;
Panel *panel = imp_get_panel(models, panel_id);
@ -1245,11 +1249,11 @@ panel_get_child(Application_Links *app, Panel_ID panel_id, Panel_Child which_chi
if (panel->kind == PanelKind_Intermediate){
Panel *child = 0;
switch (which_child){
case PanelChild_Min:
case Side_Min:
{
child = panel->tl_panel;
}break;
case PanelChild_Max:
case Side_Max:
{
child = panel->br_panel;
}break;
@ -1587,7 +1591,7 @@ view_current_context(Application_Links *app, View_ID view_id){
View *view = imp_get_view(models, view_id);
View_Context result = {};
if (api_check_view(view)){
result = view_current_context(models, view);
result = view_current_context(view);
}
return(result);
}
@ -1599,7 +1603,7 @@ view_current_context_hook_memory(Application_Links *app, View_ID view_id,
View *view = imp_get_view(models, view_id);
Data result = {};
if (api_check_view(view)){
View_Context_Node *ctx = view_current_context_node(models, view);
View_Context_Node *ctx = view_current_context_node(view);
if (ctx != 0){
switch (hook_id){
case HookID_DeltaRule:
@ -2586,16 +2590,6 @@ set_hot_directory(Application_Links *app, String_Const_u8 string)
return(true);
}
api(custom) function void
set_gui_up_down_keys(Application_Links *app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier)
{
Models *models = (Models*)app->cmd_context;
models->user_up_key = up_key;
models->user_up_key_modifier = up_key_modifier;
models->user_down_key = down_key;
models->user_down_key_modifier = down_key_modifier;
}
api(custom) function void
send_exit_signal(Application_Links *app)
{

View File

@ -88,12 +88,6 @@ struct Models{
b32 keep_playing;
// TODO(allen): do(eliminate user_*_key* nonsense from the core)
Key_Code user_up_key;
Key_Code user_down_key;
Key_Modifier user_up_key_modifier;
Key_Modifier user_down_key_modifier;
b32 has_new_title;
char *title_space;
i32 title_capacity;

View File

@ -56,11 +56,11 @@ file_get_face(Models *models, Editing_File *file){
return(font_set_face_from_id(&models->font_set, file->settings.face_id));
}
internal u32
internal Access_Flag
file_get_access_flags(Editing_File *file){
u32 flags = 0;
if (file->settings.read_only){
flags |= AccessProtected;
Access_Flag flags = Access_Read|Access_Visible;
if (!file->settings.read_only){
flags |= Access_Write;
}
return(flags);
}

View File

@ -77,14 +77,14 @@ view_get_map(View *view){
return(view->file->settings.base_map_id);
}
internal u32
internal Access_Flag
view_get_access_flags(View *view){
u32 result = AccessOpen;
Access_Flag result = file_get_access_flags(view->file);
View_Context_Node *node = view->ctx;
if (node != 0 && node->ctx.hides_buffer){
result |= AccessHidden;
b32 hides_buffer = (node != 0 && node->ctx.hides_buffer);
if (hides_buffer){
RemFlag(result, Access_Visible);
}
result |= file_get_access_flags(view->file);
return(result);
}
@ -281,31 +281,6 @@ view_compute_cursor(View *view, Buffer_Seek seek){
////////////////////////////////
internal Interval_f32
view_acceptable_y(f32 view_height, f32 line_height){
Interval_f32 acceptable_y = {};
if (view_height <= line_height*5.f){
if (view_height < line_height){
acceptable_y.max = view_height;
}
else{
acceptable_y.max = view_height - line_height;
}
}
else{
acceptable_y = If32(line_height*2.f, view_height - line_height*2.f);
}
return(acceptable_y);
}
internal Vec2_f32
view_safety_margin(f32 view_width, f32 acceptable_y_height, f32 line_height, f32 typical_advance){
Vec2_f32 safety = {};
safety.y = min(line_height*5.f, (acceptable_y_height + 1.f)*0.5f);
safety.x = min(view_width*0.5f, typical_advance*8.f);
return(safety);
}
internal b32
view_move_view_to_cursor(Models *models, View *view, Buffer_Scroll *scroll){
Editing_File *file = view->file;
@ -320,23 +295,21 @@ view_move_view_to_cursor(Models *models, View *view, Buffer_Scroll *scroll){
f32 line_height = face->line_height;
f32 typical_advance = face->typical_advance;
Interval_f32 acceptable_y = view_acceptable_y(view_dim.y, line_height);
Vec2_f32 safety = view_safety_margin(view_dim.x, range_size(acceptable_y), line_height, typical_advance);
Vec2_f32 target_p_relative = {};
if (p.y < acceptable_y.min){
target_p_relative.y = p.y - safety.y;
if (p.y < 0.f){
target_p_relative.y = p.y - line_height*1.5f;
}
else if (p.y > acceptable_y.max){
target_p_relative.y = (p.y + safety.y) - view_dim.y;
else if (p.y > view_dim.y){
target_p_relative.y = (p.y + line_height*1.5f) - view_dim.y;
}
if (p.x < 0.f){
target_p_relative.x = p.x - safety.x;
target_p_relative.x = p.x - typical_advance*1.5f;
}
else if (p.x > view_dim.x){
target_p_relative.x = (p.x + safety.x) - view_dim.x;
target_p_relative.x = (p.x + typical_advance*1.5f) - view_dim.x;
}
scroll->target.pixel_shift = target_p_relative;
scroll->target.pixel_shift += target_p_relative;
scroll->target = view_normalize_buffer_point(models, view, scroll->target);
scroll->target.pixel_shift.x = f32_round32(scroll->target.pixel_shift.x);
scroll->target.pixel_shift.y = f32_round32(scroll->target.pixel_shift.y);
@ -355,16 +328,13 @@ view_move_cursor_to_view(Models *models, View *view, Buffer_Scroll scroll, i64 *
p -= scroll.target.pixel_shift;
f32 line_height = face->line_height;
Interval_f32 acceptable_y = view_acceptable_y(view_dim.y, line_height);
Vec2_f32 safety = view_safety_margin(view_dim.x, range_size(acceptable_y),
line_height, face->typical_advance);
b32 adjusted_y = true;
if (p.y < acceptable_y.min){
p.y = acceptable_y.min + safety.y;
if (p.y < 0.f){
p.y = line_height*1.5f;
}
else if (p.y > acceptable_y.max){
p.y = acceptable_y.max - safety.y;
else if (p.y > view_dim.y){
p.y = view_dim.y - line_height*1.5f;
}
else{
adjusted_y = false;
@ -470,12 +440,12 @@ view_pop_context(View *view){
}
function View_Context_Node*
view_current_context_node(Models *models, View *view){
view_current_context_node(View *view){
return(view->ctx);
}
function View_Context
view_current_context(Models *models, View *view){
view_current_context(View *view){
View_Context ctx = {};
View_Context_Node *node = view->ctx;
if (node != 0){

View File

@ -356,8 +356,8 @@ auto_indent_buffer(Application_Links *app, Buffer_ID buffer, Range_i64 pos){
CUSTOM_COMMAND_SIG(auto_indent_whole_file)
CUSTOM_DOC("Audo-indents the entire current buffer.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 buffer_size = buffer_get_size(app, buffer);
auto_indent_buffer(app, buffer, Ii64(0, buffer_size));
}
@ -365,8 +365,8 @@ CUSTOM_DOC("Audo-indents the entire current buffer.")
CUSTOM_COMMAND_SIG(auto_indent_line_at_cursor)
CUSTOM_DOC("Auto-indents the line on which the cursor sits.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
auto_indent_buffer(app, buffer, Ii64(pos));
move_past_lead_whitespace(app, view, buffer);
@ -375,8 +375,8 @@ CUSTOM_DOC("Auto-indents the line on which the cursor sits.")
CUSTOM_COMMAND_SIG(auto_indent_range)
CUSTOM_DOC("Auto-indents the range between the cursor and the mark.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
auto_indent_buffer(app, buffer, range);
move_past_lead_whitespace(app, view, buffer);
@ -403,8 +403,8 @@ CUSTOM_DOC("Inserts text and auto-indents the line on which the cursor sits if a
}
}
if (do_auto_indent){
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 pos = {};
pos.min = view_get_cursor_pos(app, view);
write_text_input(app);

View File

@ -8,13 +8,13 @@ moving the cursor, which work even without the default 4coder framework.
function void
write_character_parameter(Application_Links *app, String_Const_u8 insert){
if (insert.str != 0 && insert.size > 0){
View_ID view = get_active_view(app, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
if_view_has_highlighted_range_delete_range(app, view);
i64 pos = view_get_cursor_pos(app, view);
pos = view_get_character_legal_pos_from_pos(app, view, pos);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
// NOTE(allen): consecutive inserts merge logic
History_Record_Index first_index = buffer_history_get_current_state_index(app, buffer);
@ -78,9 +78,9 @@ CUSTOM_DOC("Inserts an underscore.")
CUSTOM_COMMAND_SIG(delete_char)
CUSTOM_DOC("Deletes the character to the right of the cursor.")
{
View_ID view = get_active_view(app, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
if (!if_view_has_highlighted_range_delete_range(app, view)){
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 start = view_get_cursor_pos(app, view);
i64 buffer_size = buffer_get_size(app, buffer);
if (0 <= start && start < buffer_size){
@ -95,9 +95,9 @@ 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_ID view = get_active_view(app, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
if (!if_view_has_highlighted_range_delete_range(app, view)){
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 end = view_get_cursor_pos(app, view);
i64 buffer_size = buffer_get_size(app, buffer);
if (0 < end && end <= buffer_size){
@ -114,7 +114,7 @@ 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_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
view_set_mark(app, view, seek_pos(pos));
view_set_cursor_and_preferred_x(app, view, seek_pos(pos));
@ -123,7 +123,7 @@ CUSTOM_DOC("Sets the mark to the current position of the cursor.")
CUSTOM_COMMAND_SIG(cursor_mark_swap)
CUSTOM_DOC("Swaps the position of the cursor and the mark.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
i64 cursor = view_get_cursor_pos(app, view);
i64 mark = view_get_mark_pos(app, view);
view_set_cursor_and_preferred_x(app, view, seek_pos(mark));
@ -133,16 +133,16 @@ CUSTOM_DOC("Swaps the position of the cursor and the mark.")
CUSTOM_COMMAND_SIG(delete_range)
CUSTOM_DOC("Deletes the text in the range between the cursor and the mark.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
buffer_replace_range(app, buffer, range, string_u8_empty);
}
function void
current_view_boundary_delete(Application_Links *app, Scan_Direction direction, Boundary_Function_List funcs){
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = {};
range.first = view_get_cursor_pos(app, view);
range.one_past_last = scan(app, funcs, buffer, direction, range.first);
@ -171,8 +171,8 @@ CUSTOM_DOC("Delete characters between the cursor position and the first alphanum
function void
current_view_snipe_delete(Application_Links *app, Scan_Direction direction, Boundary_Function_List funcs){
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
Range_i64 range = get_snipe_range(app, funcs, buffer, pos, direction);
buffer_replace_range(app, buffer, range, string_u8_litexpr(""));
@ -199,7 +199,7 @@ CUSTOM_DOC("Delete a single, whole token on or to the right of the cursor and po
CUSTOM_COMMAND_SIG(center_view)
CUSTOM_DOC("Centers the view vertically on the line on which the cursor sits.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Rect_f32 region = view_get_buffer_region(app, view);
i64 pos = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
@ -213,7 +213,7 @@ CUSTOM_DOC("Centers the view vertically on the line on which the cursor sits.")
CUSTOM_COMMAND_SIG(left_adjust_view)
CUSTOM_DOC("Sets the left size of the view near the x position of the cursor.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
Vec2_f32 p = view_relative_xy_of_pos(app, view, cursor.line, pos);
@ -225,7 +225,7 @@ CUSTOM_DOC("Sets the left size of the view near the x position of the cursor.")
CUSTOM_COMMAND_SIG(click_set_cursor_and_mark)
CUSTOM_DOC("Sets the cursor position and mark to the mouse position.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Mouse_State mouse = get_mouse_state(app);
i64 pos = view_pos_from_xy(app, view, V2(mouse.p));
view_set_cursor_and_preferred_x(app, view, seek_pos(pos));
@ -235,7 +235,7 @@ CUSTOM_DOC("Sets the cursor position and mark to the mouse position.")
CUSTOM_COMMAND_SIG(click_set_cursor)
CUSTOM_DOC("Sets the cursor position to the mouse position.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Mouse_State mouse = get_mouse_state(app);
i64 pos = view_pos_from_xy(app, view, V2(mouse.p));
view_set_cursor_and_preferred_x(app, view, seek_pos(pos));
@ -245,7 +245,7 @@ CUSTOM_DOC("Sets the cursor position to the mouse position.")
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_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Mouse_State mouse = get_mouse_state(app);
if (mouse.l){
i64 pos = view_pos_from_xy(app, view, V2(mouse.p));
@ -257,7 +257,7 @@ CUSTOM_DOC("If the mouse left button is pressed, sets the cursor position to the
CUSTOM_COMMAND_SIG(click_set_mark)
CUSTOM_DOC("Sets the mark position to the mouse position.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Mouse_State mouse = get_mouse_state(app);
i64 pos = view_pos_from_xy(app, view, V2(mouse.p));
view_set_mark(app, view, seek_pos(pos));
@ -267,7 +267,7 @@ CUSTOM_DOC("Sets the mark position to the mouse position.")
CUSTOM_COMMAND_SIG(mouse_wheel_scroll)
CUSTOM_DOC("Reads the scroll wheel value from the mouse state and scrolls accordingly.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Mouse_State mouse = get_mouse_state(app);
if (mouse.wheel != 0){
Buffer_Scroll scroll = view_get_buffer_scroll(app, view);
@ -292,13 +292,13 @@ move_vertical_pixels(Application_Links *app, View_ID view, f32 pixels){
internal void
move_vertical_pixels(Application_Links *app, f32 pixels){
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
move_vertical_pixels(app, view, pixels);
}
internal void
move_vertical_lines(Application_Links *app, View_ID view, f32 lines){
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
Face_ID face_id = get_face_id(app, buffer);
Face_Metrics metrics = get_face_metrics(app, face_id);
@ -308,7 +308,7 @@ move_vertical_lines(Application_Links *app, View_ID view, f32 lines){
internal void
move_vertical_lines(Application_Links *app, f32 lines){
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
move_vertical_lines(app, view, lines);
}
@ -345,7 +345,7 @@ 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_ID view = get_active_view(app, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
i64 next_line = cursor.line + 1;
@ -355,7 +355,7 @@ CUSTOM_DOC("Moves down to the next line of actual text, regardless of line wrapp
CUSTOM_COMMAND_SIG(page_up)
CUSTOM_DOC("Scrolls the view up one view height and moves the cursor up one view height.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
f32 page_jump = get_page_jump(app, view);
move_vertical_pixels(app, -page_jump);
}
@ -363,15 +363,15 @@ CUSTOM_DOC("Scrolls the view up one view height and moves the cursor up one view
CUSTOM_COMMAND_SIG(page_down)
CUSTOM_DOC("Scrolls the view down one view height and moves the cursor down one view height.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
f32 page_jump = get_page_jump(app, view);
move_vertical_pixels(app, page_jump);
}
internal void
seek_blank_line(Application_Links *app, Scan_Direction direction, Position_Within_Line position){
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
i64 new_pos = get_pos_of_blank_line_grouped(app, buffer, direction, pos);
switch (position){
@ -429,7 +429,7 @@ CUSTOM_DOC("Seeks the cursor down to the next blank line and places it at the en
CUSTOM_COMMAND_SIG(move_left)
CUSTOM_DOC("Moves the cursor one character to the left.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
i64 character = view_relative_character_from_pos(app, view, cursor.line, pos);
@ -441,7 +441,7 @@ CUSTOM_DOC("Moves the cursor one character to the left.")
CUSTOM_COMMAND_SIG(move_right)
CUSTOM_DOC("Moves the cursor one character to the right.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
i64 character = view_relative_character_from_pos(app, view, cursor.line, pos);
@ -452,8 +452,8 @@ CUSTOM_DOC("Moves the cursor one character to the right.")
function void
current_view_scan_move(Application_Links *app, Scan_Direction direction, Boundary_Function_List funcs){
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
i64 cursor_pos = view_get_cursor_pos(app, view);
i64 pos = scan(app, funcs, buffer, direction, cursor_pos);
view_set_cursor_and_preferred_x(app, view, seek_pos(pos));
@ -545,8 +545,8 @@ CUSTOM_DOC("Seek left for boundary between alphanumeric characters or camel case
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_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
i32 buffer_size = (i32)buffer_get_size(app, buffer);
view_set_cursor_and_preferred_x(app, view, seek_pos(0));
view_set_mark(app, view, seek_pos(buffer_size));
@ -558,8 +558,8 @@ 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_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
Scratch_Block scratch(app);
String_Const_u8 string = push_buffer_range(app, scratch, buffer, range);
@ -571,8 +571,8 @@ CUSTOM_DOC("Converts all ascii text in the range between the cursor and the mark
CUSTOM_COMMAND_SIG(to_lowercase)
CUSTOM_DOC("Converts all ascii text in the range between the cursor and the mark to lowercase.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
Scratch_Block scratch(app);
String_Const_u8 string = push_buffer_range(app, scratch, buffer, range);
@ -584,8 +584,8 @@ CUSTOM_DOC("Converts all ascii text in the range between the cursor and the mark
CUSTOM_COMMAND_SIG(clean_all_lines)
CUSTOM_DOC("Removes trailing whitespace from all lines in the current buffer.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Scratch_Block scratch(app);
Batch_Edit *batch_first = 0;
@ -618,15 +618,15 @@ 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_ID view = get_active_view(app, AccessAll);
get_next_view_looped_all_panels(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
get_next_view_looped_all_panels(app, view, Access_Always);
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_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
view_close(app, view);
}
@ -635,35 +635,35 @@ 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_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
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_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
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_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
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_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
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_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
b64 value = false;
view_get_setting(app, view, ViewSetting_ShowFileBar, &value);
view_set_setting(app, view, ViewSetting_ShowFileBar, !value);
@ -678,8 +678,8 @@ CUSTOM_DOC("Toggles the visibility of the FPS performance meter")
CUSTOM_COMMAND_SIG(increase_face_size)
CUSTOM_DOC("Increase the size of the face used by the current buffer.")
{
View_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Face_ID face_id = get_face_id(app, buffer);
Face_Description description = get_face_description(app, face_id);
++description.parameters.pt_size;
@ -689,8 +689,8 @@ 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_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Face_ID face_id = get_face_id(app, buffer);
Face_Description description = get_face_description(app, face_id);
--description.parameters.pt_size;
@ -717,8 +717,8 @@ 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_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
(void)buffer;
NotImplemented;
}
@ -726,7 +726,7 @@ 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_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
b64 show_whitespace = false;
view_get_setting(app, view, ViewSetting_ShowWhitespace, &show_whitespace);
view_set_setting(app, view, ViewSetting_ShowWhitespace, !show_whitespace);
@ -757,7 +757,7 @@ CUSTOM_DOC("Queries the user for a number, and jumps the cursor to the correspon
bar.string_capacity = sizeof(string_space);
if (query_user_number(app, &bar)){
i32 line_number = (i32)string_to_integer(bar.string, 10);
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
view_set_cursor_and_preferred_x(app, view, seek_line_col(line_number, 0));
}
}
@ -774,8 +774,8 @@ isearch__update_highlight(Application_Links *app, View_ID view, Range_i64 range)
function void
isearch(Application_Links *app, Scan_Direction start_scan, i64 first_pos,
String_Const_u8 query_init){
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
if (!buffer_exists(app, buffer)){
return;
}
@ -951,22 +951,22 @@ isearch(Application_Links *app, Scan_Direction start_scan, i64 first_pos,
function void
isearch(Application_Links *app, Scan_Direction start_scan, String_Const_u8 query_init){
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);;
isearch(app, start_scan, pos, query_init);
}
function void
isearch(Application_Links *app, Scan_Direction start_scan){
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);;
isearch(app, start_scan, pos, SCu8());
}
function void
isearch_identifier(Application_Links *app, Scan_Direction scan){
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer_id = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer_id = view_get_buffer(app, view, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
Scratch_Block scratch(app);
Range_i64 range = enclose_pos_alpha_numeric_underscore(app, buffer_id, pos);
@ -1042,8 +1042,8 @@ replace_in_range_query_user(Application_Links *app, Buffer_ID buffer, Range_i64
CUSTOM_COMMAND_SIG(replace_in_range)
CUSTOM_DOC("Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
replace_in_range_query_user(app, buffer, range);
}
@ -1051,8 +1051,8 @@ CUSTOM_DOC("Queries the user for a needle and string. Replaces all occurences of
CUSTOM_COMMAND_SIG(replace_in_buffer)
CUSTOM_DOC("Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = buffer_range(app, buffer);
replace_in_range_query_user(app, buffer, range);
}
@ -1065,9 +1065,9 @@ CUSTOM_DOC("Queries the user for a needle and string. Replaces all occurences of
Scratch_Block scratch(app);
Query_Bar_Group group(app);
String_Pair pair = query_user_replace_pair(app, scratch);
for (Buffer_ID buffer = get_buffer_next(app, 0, AccessOpen);
for (Buffer_ID buffer = get_buffer_next(app, 0, Access_ReadWriteVisible);
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessOpen)){
buffer = get_buffer_next(app, buffer, Access_ReadWriteVisible)){
Range_i64 range = buffer_range(app, buffer);
replace_in_range(app, buffer, range, pair.a, pair.b);
}
@ -1135,8 +1135,8 @@ query_replace_parameter(Application_Links *app, String_Const_u8 replace_str, i64
String_Const_u8 r = replace.string;
String_Const_u8 w = with.string;
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
i64 pos = start_pos;
Query_Bar bar = {};
@ -1150,8 +1150,8 @@ query_replace_parameter(Application_Links *app, String_Const_u8 replace_str, i64
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_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
if (buffer != 0){
Query_Bar_Group group(app);
Query_Bar replace = {};
@ -1171,8 +1171,8 @@ 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_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
if (buffer != 0){
Scratch_Block scratch(app);
i64 pos = view_get_cursor_pos(app, view);
@ -1187,8 +1187,8 @@ 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_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
if (buffer != 0){
Scratch_Block scratch(app);
Range_i64 range = get_view_range(app, view);
@ -1204,9 +1204,9 @@ CUSTOM_DOC("Queries the user for a string, and incrementally replace every occur
function void
save_all_dirty_buffers_with_postfix(Application_Links *app, String_Const_u8 postfix){
Scratch_Block scratch(app);
for (Buffer_ID buffer = get_buffer_next(app, 0, AccessOpen);
for (Buffer_ID buffer = get_buffer_next(app, 0, Access_ReadWriteVisible);
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessOpen)){
buffer = get_buffer_next(app, buffer, Access_ReadWriteVisible)){
Dirty_State dirty = buffer_get_dirty_state(app, buffer);
if (dirty == DirtyState_UnsavedChanges){
Temp_Memory temp = begin_temp(scratch);
@ -1247,8 +1247,8 @@ delete_file_base(Application_Links *app, String_Const_u8 file_name, Buffer_ID bu
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_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Scratch_Block scratch(app);
String_Const_u8 file_name = push_buffer_file_name(app, scratch, buffer);
if (file_name.size > 0){
@ -1291,8 +1291,8 @@ 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_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Scratch_Block scratch(app);
Query_Bar_Group group(app);
@ -1324,8 +1324,8 @@ 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_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Scratch_Block scratch(app);
@ -1385,8 +1385,8 @@ CUSTOM_DOC("Queries the user for a name and creates a new directory with the giv
internal void
current_view_move_line(Application_Links *app, Scan_Direction direction){
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
i64 line_number = get_line_number_from_pos(app, buffer, pos);
pos = move_line(app, buffer, line_number, direction);
@ -1408,8 +1408,8 @@ 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_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
i64 line = get_line_number_from_pos(app, buffer, pos);
Scratch_Block scratch(app);
@ -1422,8 +1422,8 @@ 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_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
i64 line = get_line_number_from_pos(app, buffer, pos);
Range_i64 range = get_line_pos_range(app, buffer, line);
@ -1487,8 +1487,8 @@ 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_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
if (buffer_exists(app, buffer)){
Scratch_Block scratch(app);
@ -1507,7 +1507,7 @@ CUSTOM_DOC("Reads a filename from surrounding '\"' characters and attempts to op
String_Const_u8 new_file_name = push_u8_stringf(scratch, "%.*s/%.*s", string_expand(path), string_expand(quoted_name));
view = get_next_view_looped_primary_panels(app, view, AccessAll);
view = get_next_view_looped_primary_panels(app, view, Access_Always);
if (view != 0){
if (view_open_file(app, view, new_file_name, true)){
view_set_active(app, view);
@ -1519,11 +1519,11 @@ CUSTOM_DOC("Reads a filename from surrounding '\"' characters and attempts to op
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_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Buffer_ID new_buffer = 0;
if (get_cpp_matching_file(app, buffer, &new_buffer)){
view = get_next_view_looped_primary_panels(app, view, AccessAll);
view = get_next_view_looped_primary_panels(app, view, Access_Always);
view_set_buffer(app, view, new_buffer, 0);
view_set_active(app, view);
}
@ -1532,11 +1532,11 @@ CUSTOM_DOC("If the current file is a *.cpp or *.h, attempts to open the correspo
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_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
i64 pos = view_get_cursor_pos(app, view);
change_active_panel(app);
view = get_active_view(app, AccessAll);
view = get_active_view(app, Access_Always);
view_set_buffer(app, view, buffer, 0);
view_set_cursor_and_preferred_x(app, view, seek_pos(pos));
}
@ -1544,13 +1544,13 @@ CUSTOM_DOC("Set the other non-active panel to view the buffer that the active pa
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_ID view1 = get_active_view(app, AccessProtected);
View_ID view1 = get_active_view(app, Access_ReadVisible);
change_active_panel(app);
View_ID view2 = get_active_view(app, AccessProtected);
View_ID view2 = get_active_view(app, Access_ReadVisible);
if (view1 != view2){
Buffer_ID buffer1 = view_get_buffer(app, view1, AccessAll);
Buffer_ID buffer2 = view_get_buffer(app, view2, AccessAll);
Buffer_ID buffer1 = view_get_buffer(app, view1, Access_Always);
Buffer_ID buffer2 = view_get_buffer(app, view2, Access_Always);
if (buffer1 != buffer2){
view_set_buffer(app, view1, buffer2, 0);
view_set_buffer(app, view2, buffer1, 0);
@ -1578,16 +1578,16 @@ 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_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
try_buffer_kill(app, buffer, view, 0);
}
CUSTOM_COMMAND_SIG(save)
CUSTOM_DOC("Saves the current buffer.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
Scratch_Block scratch(app);
String_Const_u8 file_name = push_buffer_file_name(app, scratch, buffer);
buffer_save(app, buffer, file_name, 0);
@ -1596,8 +1596,8 @@ CUSTOM_DOC("Saves the current buffer.")
CUSTOM_COMMAND_SIG(reopen)
CUSTOM_DOC("Reopen the current buffer from the hard drive.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
buffer_reopen(app, buffer, 0);
}
@ -1608,7 +1608,7 @@ CUSTOM_COMMAND_SIG(multi_paste){
i32 count = clipboard_count(app, 0);
if (count > 0){
View_ID view = get_active_view(app, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Managed_Scope scope = view_get_managed_scope(app, view);
Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type);
@ -1623,7 +1623,7 @@ CUSTOM_COMMAND_SIG(multi_paste){
String_Const_u8 insert_string = push_u8_stringf(scratch, "\n%.*s", string_expand(string));
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
buffer_replace_range(app, buffer, Ii64(range.max), insert_string);
view_set_mark(app, view, seek_pos(range.max + 1));
@ -1646,7 +1646,7 @@ multi_paste_range(Application_Links *app, View_ID view, Range_i64 range, i32 pas
Range_i64 finish_range = range;
if (paste_count >= 1){
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
if (buffer != 0){
i64 total_size = 0;
for (i32 paste_index = 0; paste_index < paste_count; ++paste_index){
@ -1699,7 +1699,7 @@ multi_paste_range(Application_Links *app, View_ID view, Range_i64 range, i32 pas
function void
multi_paste_interactive_up_down(Application_Links *app, i32 paste_count, i32 clip_count){
View_ID view = get_active_view(app, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
b32 old_to_new = true;
Range_i64 range = multi_paste_range(app, view, Ii64(pos), paste_count, old_to_new);
@ -1741,7 +1741,7 @@ multi_paste_interactive_up_down(Application_Links *app, i32 paste_count, i32 cli
}
if (in.abort){
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
buffer_replace_range(app, buffer, range, SCu8(""));
}
}
@ -1825,8 +1825,8 @@ record_get_new_cursor_position_redo(Application_Links *app, Buffer_ID buffer_id,
CUSTOM_COMMAND_SIG(undo)
CUSTOM_DOC("Advances backwards through the undo history of the current buffer.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
History_Record_Index current = buffer_history_get_current_state_index(app, buffer);
if (current > 0){
i32 new_position = record_get_new_cursor_position_undo(app, buffer, current);
@ -1838,8 +1838,8 @@ CUSTOM_DOC("Advances backwards through the undo history of the current buffer.")
CUSTOM_COMMAND_SIG(redo)
CUSTOM_DOC("Advances forwards through the undo history of the current buffer.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
History_Record_Index current = buffer_history_get_current_state_index(app, buffer);
History_Record_Index max_index = buffer_history_get_max_record_index(app, buffer);
if (current < max_index){
@ -1859,9 +1859,9 @@ CUSTOM_DOC("Advances backward through the undo history in the buffer containing
i32 match_count = 0;
{
for (Buffer_ID buffer = get_buffer_next(app, 0, AccessAll);
for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always);
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessAll)){
buffer = get_buffer_next(app, buffer, Access_Always)){
History_Record_Index index = buffer_history_get_current_state_index(app, buffer);
if (index > 0){
Record_Info record = buffer_history_get_record_info(app, buffer, index);
@ -1886,7 +1886,7 @@ CUSTOM_DOC("Advances backward through the undo history in the buffer containing
if (highest_edit_number != -1){
for (Buffer_ID buffer = first_buffer_match;
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessAll)){
buffer = get_buffer_next(app, buffer, Access_Always)){
b32 did_match = false;
i32 new_edit_position = 0;
for (;;){
@ -1931,9 +1931,9 @@ CUSTOM_DOC("Advances forward through the undo history in the buffer containing t
i32 match_count = 0;
{
for (Buffer_ID buffer = get_buffer_next(app, 0, AccessAll);
for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always);
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessAll)){
buffer = get_buffer_next(app, buffer, Access_Always)){
History_Record_Index max_index = buffer_history_get_max_record_index(app, buffer);
History_Record_Index index = buffer_history_get_current_state_index(app, buffer);
if (index < max_index){
@ -1959,7 +1959,7 @@ CUSTOM_DOC("Advances forward through the undo history in the buffer containing t
if (lowest_edit_number != -1){
for (Buffer_ID buffer = first_buffer_match;
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessAll)){
buffer = get_buffer_next(app, buffer, Access_Always)){
b32 did_match = false;
i32 new_edit_position = 0;
History_Record_Index max_index = buffer_history_get_max_record_index(app, buffer);

View File

@ -128,8 +128,8 @@ standard_search_and_build(Application_Links *app, View_ID view, Buffer_ID active
CUSTOM_COMMAND_SIG(build_search)
CUSTOM_DOC("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*.")
{
View_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
standard_search_and_build(app, view, buffer);
block_zero_struct(&prev_location);
lock_jump_buffer(app, string_u8_litexpr("*compilation*"));
@ -137,7 +137,7 @@ CUSTOM_DOC("Looks for a build.bat, build.sh, or makefile in the current and pare
static Buffer_ID
get_comp_buffer(Application_Links *app){
return(get_buffer_by_name(app, string_u8_litexpr("*compilation*"), AccessAll));
return(get_buffer_by_name(app, string_u8_litexpr("*compilation*"), Access_Always));
}
static View_ID
@ -163,8 +163,8 @@ set_fancy_compilation_buffer_font(Application_Links *app){
CUSTOM_COMMAND_SIG(build_in_build_panel)
CUSTOM_DOC("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.")
{
View_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
View_ID build_view = get_or_open_build_panel(app);

View File

@ -12,7 +12,7 @@ CUSTOM_DOC("If the command execute_any_cli has already been used, this will exec
String_Const_u8 hot_directory = SCu8(hot_directory_space);
if (out_buffer.size > 0 && cmd.size > 0 && hot_directory.size > 0){
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_Identifier id = buffer_identifier(out_buffer);
exec_system_command(app, view, id, hot_directory, cmd, CLI_OverlapWithConflict|CLI_CursorAtEnd|CLI_SendEndSignal);
lock_jump_buffer(app, out_buffer);

View File

@ -19,8 +19,8 @@ clipboard_post_buffer_range(Application_Links *app, i32 clipboard_index, Buffer_
CUSTOM_COMMAND_SIG(copy)
CUSTOM_DOC("Copy the text in the range from the cursor to the mark onto the clipboard.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
Range_i64 range = get_view_range(app, view);
clipboard_post_buffer_range(app, 0, buffer, range);
}
@ -28,8 +28,8 @@ CUSTOM_DOC("Copy the text in the range from the cursor to the mark onto the clip
CUSTOM_COMMAND_SIG(cut)
CUSTOM_DOC("Cut the text in the range from the cursor to the mark onto the clipboard.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
if (clipboard_post_buffer_range(app, 0, buffer, range)){
buffer_replace_range(app, buffer, range, string_u8_empty);
@ -41,7 +41,7 @@ CUSTOM_DOC("At the cursor, insert the text at the top of the clipboard.")
{
i32 count = clipboard_count(app, 0);
if (count > 0){
View_ID view = get_active_view(app, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
if_view_has_highlighted_range_delete_range(app, view);
Managed_Scope scope = view_get_managed_scope(app, view);
@ -54,7 +54,7 @@ CUSTOM_DOC("At the cursor, insert the text at the top of the clipboard.")
String_Const_u8 string = push_clipboard_index(app, scratch, 0, *paste_index);
if (string.size > 0){
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
buffer_replace_range(app, buffer, Ii64(pos), string);
@ -77,7 +77,7 @@ CUSTOM_DOC("If the previous command was paste or paste_next, replaces the paste
i32 count = clipboard_count(app, 0);
if (count > 0){
View_ID view = get_active_view(app, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Managed_Scope scope = view_get_managed_scope(app, view);
no_mark_snap_to_cursor(app, scope);
@ -92,7 +92,7 @@ CUSTOM_DOC("If the previous command was paste or paste_next, replaces the paste
String_Const_u8 string = push_clipboard_index(app, scratch, 0, paste_index);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
i64 pos = range.min;

View File

@ -13,8 +13,8 @@ write_string(Application_Links *app, View_ID view, Buffer_ID buffer, String_Cons
static void
write_string(Application_Links *app, String_Const_u8 string){
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
write_string(app, view, buffer, string);
}
@ -34,8 +34,8 @@ write_named_comment_string(Application_Links *app, char *type_string){
static void
long_braces(Application_Links *app, char *text, i32 size){
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
buffer_replace_range(app, buffer, Ii64(pos), SCu8(text, size));
view_set_cursor_and_preferred_x(app, view, seek_pos(pos + 2));
@ -125,8 +125,8 @@ c_line_comment_starts_at_position(Application_Links *app, Buffer_ID buffer, i64
CUSTOM_COMMAND_SIG(comment_line)
CUSTOM_DOC("Insert '//' at the beginning of the line after leading whitespace.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = get_start_of_line_at_cursor(app, view, buffer);
b32 alread_has_comment = c_line_comment_starts_at_position(app, buffer, pos);
if (!alread_has_comment){
@ -137,8 +137,8 @@ CUSTOM_DOC("Insert '//' at the beginning of the line after leading whitespace.")
CUSTOM_COMMAND_SIG(uncomment_line)
CUSTOM_DOC("If present, delete '//' at the beginning of the line after leading whitespace.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = get_start_of_line_at_cursor(app, view, buffer);
b32 alread_has_comment = c_line_comment_starts_at_position(app, buffer, pos);
if (alread_has_comment){
@ -149,8 +149,8 @@ CUSTOM_DOC("If present, delete '//' at the beginning of the line after leading w
CUSTOM_COMMAND_SIG(comment_line_toggle)
CUSTOM_DOC("Turns uncommented lines into commented lines and vice versa for comments starting with '//'.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = get_start_of_line_at_cursor(app, view, buffer);
b32 alread_has_comment = c_line_comment_starts_at_position(app, buffer, pos);
if (alread_has_comment){
@ -202,7 +202,7 @@ activate_snippet(Application_Links *app, View_ID view, Lister *lister, String_Co
if (0 <= index && index < snippets.count){
Snippet snippet = snippets.snippets[index];
lister_default(app, view, lister, ListerActivation_Finished);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
buffer_replace_range(app, buffer, Ii64(pos), SCu8(snippet.text));
view_set_cursor_and_preferred_x(app, view, seek_pos(pos + snippet.cursor_offset));
@ -216,7 +216,7 @@ activate_snippet(Application_Links *app, View_ID view, Lister *lister, String_Co
static void
snippet_lister__parameterized(Application_Links *app, Snippet_Array snippet_array){
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Scratch_Block scratch(app, Scratch_Share);
i32 option_count = snippet_array.count;
Lister_Option *options = push_array(scratch, Lister_Option, option_count);

View File

@ -38,7 +38,7 @@ function Buffer_ID
get_locked_jump_buffer(Application_Links *app){
Buffer_ID result = 0;
if (locked_buffer.size > 0){
result = get_buffer_by_name(app, locked_buffer, AccessAll);
result = get_buffer_by_name(app, locked_buffer, Access_Always);
}
if (result == 0){
unlock_jump_buffer();
@ -88,7 +88,7 @@ static View_ID
open_footer_panel(Application_Links *app, View_ID view){
View_ID special_view = open_view(app, view, ViewSplit_Bottom);
new_view_settings(app, special_view);
Buffer_ID buffer = view_get_buffer(app, special_view, AccessAll);
Buffer_ID buffer = view_get_buffer(app, special_view, Access_Always);
Face_ID face_id = get_face_id(app, buffer);
Face_Metrics metrics = get_face_metrics(app, face_id);
view_set_split_pixel_size(app, special_view, (i32)(metrics.line_height*20.f));
@ -107,7 +107,7 @@ close_build_footer_panel(Application_Links *app){
static View_ID
open_build_footer_panel(Application_Links *app){
if (build_footer_panel_view_id == 0){
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
build_footer_panel_view_id = open_footer_panel(app, view);
view_set_active(app, view);
}
@ -159,10 +159,10 @@ view_buffer_set(Application_Links *app, Buffer_ID *buffers, i32 *positions, i32
View_ID view_id;
};
View_ID active_view_id = get_active_view(app, AccessAll);
View_ID active_view_id = get_active_view(app, Access_Always);
View_ID first_view_id = active_view_id;
if (view_get_is_passive(app, active_view_id)){
first_view_id = get_next_view_looped_primary_panels(app, active_view_id, AccessAll);
first_view_id = get_next_view_looped_primary_panels(app, active_view_id, Access_Always);
}
View_ID view_id = first_view_id;
@ -176,7 +176,7 @@ view_buffer_set(Application_Links *app, Buffer_ID *buffers, i32 *positions, i32
primary_view_last->view_id = view_id;
available_view_count += 1;
for (;;){
view_id = get_next_view_looped_primary_panels(app, view_id, AccessAll);
view_id = get_next_view_looped_primary_panels(app, view_id, Access_Always);
if (view_id == first_view_id){
break;
}
@ -203,8 +203,8 @@ view_buffer_set(Application_Links *app, Buffer_ID *buffers, i32 *positions, i32
CUSTOM_COMMAND_SIG(change_active_panel)
CUSTOM_DOC("Change the currently active panel, moving to the panel with the next highest view_id.")
{
View_ID view = get_active_view(app, AccessAll);
view = get_next_view_looped_primary_panels(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
view = get_next_view_looped_primary_panels(app, view, Access_Always);
if (view != 0){
view_set_active(app, view);
}
@ -213,8 +213,8 @@ CUSTOM_DOC("Change the currently active panel, moving to the panel with the next
CUSTOM_COMMAND_SIG(change_active_panel_backwards)
CUSTOM_DOC("Change the currently active panel, moving to the panel with the next lowest view_id.")
{
View_ID view = get_active_view(app, AccessAll);
view = get_prev_view_looped_primary_panels(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
view = get_prev_view_looped_primary_panels(app, view, Access_Always);
if (view != 0){
view_set_active(app, view);
}
@ -223,20 +223,20 @@ CUSTOM_DOC("Change the currently active panel, moving to the panel with the next
CUSTOM_COMMAND_SIG(open_panel_vsplit)
CUSTOM_DOC("Create a new panel by vertically splitting the active panel.")
{
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
View_ID new_view = open_view(app, view, ViewSplit_Right);
new_view_settings(app, new_view);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
view_set_buffer(app, new_view, buffer, 0);
}
CUSTOM_COMMAND_SIG(open_panel_hsplit)
CUSTOM_DOC("Create a new panel by horizontally splitting the active panel.")
{
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
View_ID new_view = open_view(app, view, ViewSplit_Bottom);
new_view_settings(app, new_view);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
view_set_buffer(app, new_view, buffer, 0);
}
@ -246,7 +246,7 @@ CUSTOM_DOC("Create a new panel by horizontally splitting the active panel.")
static Buffer_ID
create_or_switch_to_buffer_and_clear_by_name(Application_Links *app, String_Const_u8 name_string, View_ID default_target_view){
Buffer_ID search_buffer = get_buffer_by_name(app, name_string, AccessAll);
Buffer_ID search_buffer = get_buffer_by_name(app, name_string, Access_Always);
if (search_buffer != 0){
buffer_set_setting(app, search_buffer, BufferSetting_ReadOnly, true);
@ -434,13 +434,13 @@ default_4coder_side_by_side_panels(Application_Links *app,
Buffer_ID right_id = buffer_identifier_to_id(app, right);
// Left Panel
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
new_view_settings(app, view);
view_set_buffer(app, view, left_id, 0);
// Right Panel
open_panel_vsplit(app);
View_ID right_view = get_active_view(app, AccessAll);
View_ID right_view = get_active_view(app, Access_Always);
view_set_buffer(app, right_view, right_id, 0);
// Restore Active to Left
@ -476,7 +476,7 @@ default_4coder_side_by_side_panels(Application_Links *app){
static void
default_4coder_one_panel(Application_Links *app, Buffer_Identifier buffer){
Buffer_ID id = buffer_identifier_to_id(app, buffer);
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
new_view_settings(app, view);
view_set_buffer(app, view, id, 0);
}

View File

@ -26,9 +26,9 @@ CUSTOM_DOC("Default command for responding to a try-exit event")
b32 do_exit = true;
if (!allow_immediate_close_without_checking_for_changes){
b32 has_unsaved_changes = false;
for (Buffer_ID buffer = get_buffer_next(app, 0, AccessAll);
for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always);
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessAll)){
buffer = get_buffer_next(app, buffer, Access_Always)){
Dirty_State dirty = buffer_get_dirty_state(app, buffer);
if (HasFlag(dirty, DirtyState_UnsavedChanges)){
has_unsaved_changes = true;
@ -36,7 +36,7 @@ CUSTOM_DOC("Default command for responding to a try-exit event")
}
}
if (has_unsaved_changes){
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
do_exit = do_gui_sure_to_close_4coder(app, view);
}
}
@ -69,9 +69,9 @@ CUSTOM_DOC("Input consumption loop for default view behavior")
continue;
}
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Managed_Scope buffer_scope = buffer_get_managed_scope(app, buffer);
Command_Map_ID *map_id_ptr =
scope_attachment(app, buffer_scope, buffer_map_id, Command_Map_ID);
@ -94,9 +94,9 @@ CUSTOM_DOC("Input consumption loop for default view behavior")
Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type);
*next_rewrite = Rewrite_None;
if (fcoder_mode == FCoderMode_NotepadLike){
for (View_ID view_it = get_view_next(app, 0, AccessAll);
for (View_ID view_it = get_view_next(app, 0, Access_Always);
view_it != 0;
view_it = get_view_next(app, view_it, AccessAll)){
view_it = get_view_next(app, view_it, Access_Always)){
Managed_Scope scope_it = view_get_managed_scope(app, view_it);
b32 *snap_mark_to_cursor = scope_attachment(app, scope_it, view_snap_mark_to_cursor, b32);
*snap_mark_to_cursor = true;
@ -112,9 +112,9 @@ CUSTOM_DOC("Input consumption loop for default view behavior")
Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type);
*rewrite = *next_rewrite;
if (fcoder_mode == FCoderMode_NotepadLike){
for (View_ID view_it = get_view_next(app, 0, AccessAll);
for (View_ID view_it = get_view_next(app, 0, Access_Always);
view_it != 0;
view_it = get_view_next(app, view_it, AccessAll)){
view_it = get_view_next(app, view_it, Access_Always)){
Managed_Scope scope_it = view_get_managed_scope(app, view_it);
b32 *snap_mark_to_cursor = scope_attachment(app, scope_it, view_snap_mark_to_cursor, b32);
if (*snap_mark_to_cursor){
@ -193,7 +193,7 @@ MODIFY_COLOR_TABLE_SIG(default_modify_color_table){
function Rect_f32
default_buffer_region(Application_Links *app, View_ID view_id, Rect_f32 region){
Buffer_ID buffer = view_get_buffer(app, view_id, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view_id, Access_Always);
Face_ID face_id = get_face_id(app, buffer);
Face_Metrics metrics = get_face_metrics(app, face_id);
f32 line_height = metrics.line_height;
@ -269,7 +269,7 @@ default_render_buffer(Application_Links *app, View_ID view_id, b32 is_active_vie
if (global_config.use_error_highlight || global_config.use_jump_highlight){
// NOTE(allen): Error highlight
String_Const_u8 name = string_u8_litexpr("*compilation*");
Buffer_ID compilation_buffer = get_buffer_by_name(app, name, AccessAll);
Buffer_ID compilation_buffer = get_buffer_by_name(app, name, Access_Always);
if (global_config.use_error_highlight){
draw_jump_highlights(app, buffer, text_layout_id, compilation_buffer, Stag_Highlight_Junk);
}
@ -321,13 +321,13 @@ default_render_buffer(Application_Links *app, View_ID view_id, b32 is_active_vie
function void
default_render_caller(Application_Links *app, Frame_Info frame_info, View_ID view_id){
View_ID active_view = get_active_view(app, AccessAll);
View_ID active_view = get_active_view(app, Access_Always);
b32 is_active_view = (active_view == view_id);
Rect_f32 region = draw_background_and_margin(app, view_id, is_active_view);
Rect_f32 prev_clip = draw_set_clip(app, region);
Buffer_ID buffer = view_get_buffer(app, view_id, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view_id, Access_Always);
Face_ID face_id = get_face_id(app, buffer);
Face_Metrics face_metrics = get_face_metrics(app, face_id);
f32 line_height = face_metrics.line_height;

View File

@ -173,7 +173,7 @@ draw_background_and_margin(Application_Links *app, View_ID view, b32 is_active_v
function Rect_f32
draw_background_and_margin(Application_Links *app, View_ID view){
View_ID active_view = get_active_view(app, AccessAll);
View_ID active_view = get_active_view(app, Access_Always);
b32 is_active_view = (active_view == view);
return(draw_background_and_margin(app, view, is_active_view));
}

View File

@ -80,8 +80,8 @@ rewrite_lines_to_lf(Application_Links *app, Buffer_ID buffer){
CUSTOM_COMMAND_SIG(set_eol_mode_to_crlf)
CUSTOM_DOC("Puts the buffer in crlf line ending mode.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Managed_Scope scope = buffer_get_managed_scope(app, buffer);
Line_Ending_Kind *eol_setting = scope_attachment(app, scope, buffer_eol_setting,
Line_Ending_Kind);
@ -91,8 +91,8 @@ CUSTOM_DOC("Puts the buffer in crlf line ending mode.")
CUSTOM_COMMAND_SIG(set_eol_mode_to_lf)
CUSTOM_DOC("Puts the buffer in lf line ending mode.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Managed_Scope scope = buffer_get_managed_scope(app, buffer);
Line_Ending_Kind *eol_setting = scope_attachment(app, scope, buffer_eol_setting,
Line_Ending_Kind);
@ -102,8 +102,8 @@ CUSTOM_DOC("Puts the buffer in lf line ending mode.")
CUSTOM_COMMAND_SIG(set_eol_mode_to_binary)
CUSTOM_DOC("Puts the buffer in bin line ending mode.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Managed_Scope scope = buffer_get_managed_scope(app, buffer);
Line_Ending_Kind *eol_setting = scope_attachment(app, scope, buffer_eol_setting,
Line_Ending_Kind);
@ -113,8 +113,8 @@ CUSTOM_DOC("Puts the buffer in bin line ending mode.")
CUSTOM_COMMAND_SIG(set_eol_mode_from_contents)
CUSTOM_DOC("Sets the buffer's line ending mode to match the contents of the buffer.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Line_Ending_Kind setting = guess_line_ending_kind_from_buffer_contents(app, buffer);
Managed_Scope scope = buffer_get_managed_scope(app, buffer);
Line_Ending_Kind *eol_setting = scope_attachment(app, scope, buffer_eol_setting,

View File

@ -207,7 +207,7 @@ static void
list_all_functions(Application_Links *app, Buffer_ID optional_target_buffer){
// TODO(allen): Use create or switch to buffer and clear here?
String_Const_u8 decls_name = string_u8_litexpr("*decls*");
Buffer_ID decls_buffer = get_buffer_by_name(app, decls_name, AccessAll);
Buffer_ID decls_buffer = get_buffer_by_name(app, decls_name, Access_Always);
if (!buffer_exists(app, decls_buffer)){
decls_buffer = create_buffer(app, decls_name, BufferCreate_AlwaysNew);
buffer_set_setting(app, decls_buffer, BufferSetting_Unimportant, true);
@ -228,9 +228,9 @@ list_all_functions(Application_Links *app, Buffer_ID optional_target_buffer){
Cursor insertion_cursor = make_cursor(push_array(scratch, u8, KB(256)), KB(256));
Buffer_Insertion out = begin_buffer_insertion_at_buffered(app, decls_buffer, 0, &insertion_cursor);
for (Buffer_ID buffer_it = get_buffer_next(app, 0, AccessAll);
for (Buffer_ID buffer_it = get_buffer_next(app, 0, Access_Always);
buffer_it != 0;
buffer_it = get_buffer_next(app, buffer_it, AccessAll)){
buffer_it = get_buffer_next(app, buffer_it, Access_Always)){
Buffer_ID buffer = buffer_it;
if (optional_target_buffer != 0){
buffer = optional_target_buffer;
@ -258,7 +258,7 @@ list_all_functions(Application_Links *app, Buffer_ID optional_target_buffer){
end_buffer_insertion(&out);
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
view_set_buffer(app, view, decls_buffer, 0);
lock_jump_buffer(app, decls_name);
@ -267,8 +267,8 @@ list_all_functions(Application_Links *app, Buffer_ID optional_target_buffer){
CUSTOM_COMMAND_SIG(list_all_functions_current_buffer)
CUSTOM_DOC("Creates a jump list of lines of the current buffer that appear to define or declare functions.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
if (buffer != 0){
list_all_functions(app, buffer);
}
@ -277,11 +277,11 @@ CUSTOM_DOC("Creates a jump list of lines of the current buffer that appear to de
CUSTOM_COMMAND_SIG(list_all_functions_current_buffer_lister)
CUSTOM_DOC("Creates a lister of locations that look like function definitions and declarations in the buffer.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
if (buffer != 0){
list_all_functions(app, buffer);
view = get_active_view(app, AccessAll);
view = get_active_view(app, Access_Always);
open_jump_lister(app, &global_heap, view, buffer, JumpListerActivation_OpenInUIView, 0);
}
}
@ -296,8 +296,8 @@ CUSTOM_COMMAND_SIG(list_all_functions_all_buffers_lister)
CUSTOM_DOC("Creates a lister of locations that look like function definitions and declarations all buffers.")
{
list_all_functions(app, 0);
View_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
open_jump_lister(app, &global_heap, view, buffer, JumpListerActivation_OpenInUIView, 0);
}

View File

@ -145,7 +145,7 @@ buffer_seek_character_class_change_0_1(Application_Links *app, Buffer_ID buffer,
internal i64
view_pos_from_xy(Application_Links *app, View_ID view, Vec2_f32 p){
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
Rect_f32 region = view_get_buffer_region(app, view);
f32 width = rect_width(region);
Face_ID face_id = get_face_id(app, buffer);
@ -912,13 +912,13 @@ push_whole_buffer(Application_Links *app, Arena *arena, Buffer_ID buffer){
internal String_Const_u8
push_view_range_string(Application_Links *app, Arena *arena, View_ID view){
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
return(push_buffer_range(app, arena, buffer, get_view_range(app, view)));
}
internal String_Const_u8
push_view_range_string(Application_Links *app, Arena *arena){
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
return(push_view_range_string(app, arena, view));
}
@ -1042,7 +1042,7 @@ move_past_lead_whitespace(Application_Links *app, View_ID view, Buffer_ID buffer
internal void
move_past_lead_whitespace(Application_Links *app, View_ID view){
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
move_past_lead_whitespace(app, view, buffer);
}
@ -1250,9 +1250,9 @@ clear_buffer(Application_Links *app, Buffer_ID buffer){
internal String_Match_List
find_all_matches_all_buffers(Application_Links *app, Arena *arena, String_Const_u8_Array match_patterns, String_Match_Flag must_have_flags, String_Match_Flag must_not_have_flags){
String_Match_List all_matches = {};
for (Buffer_ID buffer = get_buffer_next(app, 0, AccessAll);
for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always);
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessAll)){
buffer = get_buffer_next(app, buffer, Access_Always)){
String_Match_List buffer_matches = {};
for (i32 i = 0; i < match_patterns.count; i += 1){
Range_i64 range = buffer_range(app, buffer);
@ -1329,7 +1329,7 @@ backspace_utf8(String_Const_u8 string){
Query_Bar_Group::Query_Bar_Group(Application_Links *app){
this->app = app;
this->view = get_active_view(app, AccessAll);
this->view = get_active_view(app, Access_Always);
}
Query_Bar_Group::Query_Bar_Group(Application_Links *app, View_ID view){
@ -1457,9 +1457,9 @@ buffer_identifier_to_id(Application_Links *app, Buffer_Identifier identifier){
}
else{
String_Const_u8 name = SCu8(identifier.name, identifier.name_len);
id = get_buffer_by_name(app, name, AccessAll);
id = get_buffer_by_name(app, name, Access_Always);
if (id == 0){
id = get_buffer_by_file_name(app, name, AccessAll);
id = get_buffer_by_file_name(app, name, Access_Always);
}
}
return(id);
@ -1470,7 +1470,7 @@ buffer_identifier_to_id_create_out_buffer(Application_Links *app, Buffer_Identif
Buffer_ID result = 0;
if (buffer_id.name != 0 && buffer_id.name_len > 0){
String_Const_u8 buffer_name = SCu8(buffer_id.name, buffer_id.name_len);
Buffer_ID buffer_attach_id = get_buffer_by_name(app, buffer_name, AccessAll);
Buffer_ID buffer_attach_id = get_buffer_by_name(app, buffer_name, Access_Always);
if (buffer_attach_id != 0){
result = buffer_attach_id;
}
@ -1493,8 +1493,8 @@ buffer_identifier_to_id_create_out_buffer(Application_Links *app, Buffer_Identif
function void
place_begin_and_end_on_own_lines(Application_Links *app, char *begin, char *end){
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
Range_i64 lines = get_line_range_from_pos_range(app, buffer, range);
@ -1548,18 +1548,39 @@ place_begin_and_end_on_own_lines(Application_Links *app, char *begin, char *end)
////////////////////////////////
function Face_ID
get_view_face_id(Application_Links *app, View_ID view){
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
return(get_face_id(app, buffer));
}
function Face_Metrics
get_view_face_metrics(Application_Links *app, View_ID view){
Face_ID face = get_view_face_id(app, view);
return(get_face_metrics(app, face));
}
function f32
get_view_line_height(Application_Links *app, View_ID view){
Face_Metrics metrics = get_view_face_metrics(app, view);
return(metrics.line_height);
}
internal View_ID
open_view(Application_Links *app, View_ID view_location, View_Split_Position position){
View_ID result = 0;
if (view_location != 0 && view_exists(app, view_location)){
Panel_ID panel_id = view_get_panel(app, view_location);
if (panel_id != 0){
b32 vertical = (position == ViewSplit_Left || position == ViewSplit_Right);
if (panel_split(app, panel_id, vertical?PanelSplit_LeftAndRight:PanelSplit_TopAndBottom)){
Panel_Child child = (position == ViewSplit_Left || position == ViewSplit_Top)?PanelChild_Min:PanelChild_Max;
Panel_ID new_panel_id = panel_get_child(app, panel_id, child);
Dimension split = (position == ViewSplit_Left ||
position == ViewSplit_Right)?Dimension_X:Dimension_Y;
Side side = (position == ViewSplit_Left ||
position == ViewSplit_Top)?Side_Min:Side_Max;
if (panel_split(app, panel_id, split)){
Panel_ID new_panel_id = panel_get_child(app, panel_id, side);
if (new_panel_id != 0){
View_ID new_view_id = panel_get_view(app, new_panel_id);
View_ID new_view_id = panel_get_view(app, new_panel_id,
Access_Always);
if (new_view_id != 0){
result = new_view_id;
}
@ -1574,10 +1595,10 @@ internal View_ID
get_first_view_with_buffer(Application_Links *app, Buffer_ID buffer_id){
View_ID result = {};
if (buffer_id != 0){
for (View_ID test = get_view_next(app, 0, AccessAll);
for (View_ID test = get_view_next(app, 0, Access_Always);
test != 0;
test = get_view_next(app, test, AccessAll)){
Buffer_ID test_buffer = view_get_buffer(app, test, AccessAll);
test = get_view_next(app, test, Access_Always)){
Buffer_ID test_buffer = view_get_buffer(app, test, Access_Always);
if (test_buffer == buffer_id){
result = test;
break;
@ -1590,7 +1611,7 @@ get_first_view_with_buffer(Application_Links *app, Buffer_ID buffer_id){
internal b32
open_file(Application_Links *app, Buffer_ID *buffer_out, String_Const_u8 file_name, b32 background, b32 never_new){
b32 result = false;
Buffer_ID buffer = get_buffer_by_name(app, file_name, AccessProtected);
Buffer_ID buffer = get_buffer_by_name(app, file_name, Access_ReadVisible);
b32 exists = buffer_exists(app, buffer);
if (!exists){
Buffer_Create_Flag flags = 0;
@ -1640,7 +1661,7 @@ internal void
view_set_highlight_range(Application_Links *app, View_ID view, Range_i64 range){
view_disable_highlight_range(app, view);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Managed_Scope scope = view_get_managed_scope(app, view);
Managed_Object *highlight = scope_attachment(app, scope, view_highlight_range, Managed_Object);
*highlight = alloc_buffer_markers_on_buffer(app, buffer, 2, &scope);
@ -1669,9 +1690,10 @@ view_look_at_region(Application_Links *app, View_ID view, i64 major_pos, i64 min
f32 skirt_height = view_height*.1f;
Interval_f32 acceptable_y = If32(skirt_height, view_height*.9f);
f32 target_height = view_line_y_difference(app, view, bottom.line, top.line);
f32 target_height = view_line_y_difference(app, view, bottom.line + 1, top.line);
if (target_height > view_height){
f32 line_height = get_view_line_height(app, view);
if (target_height + 2*line_height > view_height){
i64 major_line = bottom.line;
if (range.min == major_pos){
major_line = top.line;
@ -1689,7 +1711,7 @@ view_look_at_region(Application_Links *app, View_ID view, i64 major_pos, i64 min
if (top_p.y < acceptable_y.min){
scroll.target.line_number = top.line;
scroll.target.pixel_shift.y = -skirt_height;
view_set_buffer_scroll(app, view, scroll, SetBufferScroll_SnapCursorIntoView);
view_set_buffer_scroll(app, view, scroll, SetBufferScroll_NoCursorChange);
}
else{
Vec2_f32 bot_p = view_relative_xy_of_pos(app, view, scroll.position.line_number, range.max);
@ -1697,7 +1719,7 @@ view_look_at_region(Application_Links *app, View_ID view, i64 major_pos, i64 min
if (bot_p.y > acceptable_y.max){
scroll.target.line_number = bottom.line;
scroll.target.pixel_shift.y = skirt_height - view_height;
view_set_buffer_scroll(app, view, scroll, SetBufferScroll_SnapCursorIntoView);
view_set_buffer_scroll(app, view, scroll, SetBufferScroll_NoCursorChange);
}
}
}
@ -1705,6 +1727,11 @@ view_look_at_region(Application_Links *app, View_ID view, i64 major_pos, i64 min
}
}
function void
view_look_at_region(Application_Links *app, View_ID view, Range_i64 range){
view_look_at_region(app, view, range.min, range.max);
}
////////////////////////////////
internal View_ID
@ -1782,8 +1809,8 @@ push_token_or_word_under_pos(Application_Links *app, Arena *arena, Buffer_ID buf
internal String_Const_u8
push_token_or_word_under_active_cursor(Application_Links *app, Arena *arena){
View_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
i64 pos = view_get_cursor_pos(app, view);
return(push_token_or_word_under_pos(app, arena, buffer, pos));
}
@ -1989,7 +2016,7 @@ if_view_has_highlighted_range_delete_range(Application_Links *app, View_ID view_
b32 result = false;
if (view_has_highlighted_range(app, view_id)){
Range_i64 range = get_view_range(app, view_id);
Buffer_ID buffer = view_get_buffer(app, view_id, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view_id, Access_ReadWriteVisible);
buffer_replace_range(app, buffer, range, string_u8_litexpr(""));
result = true;
}
@ -1999,9 +2026,9 @@ if_view_has_highlighted_range_delete_range(Application_Links *app, View_ID view_
internal void
begin_notepad_mode(Application_Links *app){
fcoder_mode = FCoderMode_NotepadLike;
for (View_ID view = get_view_next(app, 0, AccessAll);
for (View_ID view = get_view_next(app, 0, Access_Always);
view != 0;
view = get_view_next(app, view, AccessAll)){
view = get_view_next(app, view, Access_Always)){
i64 pos = view_get_cursor_pos(app, view);
view_set_mark(app, view, seek_pos(pos));
}
@ -2011,8 +2038,8 @@ begin_notepad_mode(Application_Links *app){
internal void
seek_pos_of_textual_line(Application_Links *app, Side side){
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
i64 new_pos = get_line_side_pos_from_pos(app, buffer, pos, side);
view_set_cursor_and_preferred_x(app, view, seek_pos(new_pos));
@ -2021,7 +2048,7 @@ seek_pos_of_textual_line(Application_Links *app, Side side){
internal void
seek_pos_of_visual_line(Application_Links *app, Side side){
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
Vec2_f32 p = view_relative_xy_of_pos(app, view, cursor.line, pos);
@ -2058,7 +2085,7 @@ CUSTOM_DOC("Seeks the cursor to the end of the visual line.")
CUSTOM_COMMAND_SIG(goto_beginning_of_file)
CUSTOM_DOC("Sets the cursor to the beginning of the file.")
{
View_ID view = get_active_view(app, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
view_set_cursor_and_preferred_x(app, view, seek_pos(0));
no_mark_snap_to_cursor_if_shift(app, view);
}
@ -2066,8 +2093,8 @@ CUSTOM_DOC("Sets the cursor to the beginning of the file.")
CUSTOM_COMMAND_SIG(goto_end_of_file)
CUSTOM_DOC("Sets the cursor to the end of the file.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer_id = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer_id = view_get_buffer(app, view, Access_ReadVisible);
i32 size = (i32)buffer_get_size(app, buffer_id);
view_set_cursor_and_preferred_x(app, view, seek_pos(size));
no_mark_snap_to_cursor_if_shift(app, view);
@ -2083,7 +2110,7 @@ view_set_split(Application_Links *app, View_ID view, View_Split_Kind kind, f32 t
if (panel_id != 0){
Panel_ID parent_panel_id = panel_get_parent(app, panel_id);
if (parent_panel_id != 0){
Panel_ID min_child_id = panel_get_child(app, parent_panel_id, PanelChild_Min);
Panel_ID min_child_id = panel_get_child(app, parent_panel_id, Side_Min);
if (min_child_id != 0){
b32 panel_is_min = (min_child_id == panel_id);
Panel_Split_Kind panel_kind = ((kind == ViewSplitKind_Ratio)?

View File

@ -31,8 +31,8 @@ begin_buffer_insertion_at_buffered(Application_Links *app, Buffer_ID buffer_id,
static Buffer_Insertion
begin_buffer_insertion(Application_Links *app){
View_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
i64 cursor_pos = view_get_cursor_pos(app, view);
Buffer_Insertion result = begin_buffer_insertion_at(app, buffer, cursor_pos);
return(result);

View File

@ -36,14 +36,16 @@ activate_jump(Application_Links *app,
case JumpListerActivation_OpenInNextViewKeepUI:
{
target_view = view;
target_view = get_next_view_looped_primary_panels(app, target_view, AccessAll);
target_view = get_next_view_looped_primary_panels(app, target_view,
Access_Always);
result_code = ListerActivation_Continue;
}break;
case JumpListerActivation_OpenInNextViewCloseUI:
{
target_view = view;
target_view = get_next_view_looped_primary_panels(app, target_view, AccessAll);
target_view = get_next_view_looped_primary_panels(app, target_view,
Access_Always);
result_code = ListerActivation_Finished;
}break;
}
@ -102,8 +104,8 @@ open_jump_lister(Application_Links *app, Heap *heap, View_ID ui_view, Buffer_ID
CUSTOM_COMMAND_SIG(view_jump_list_with_lister)
CUSTOM_DOC("When executed on a buffer with jumps, creates a persistent lister for all the jumps")
{
View_ID view = get_active_view(app, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
open_jump_lister(app, &global_heap, view, buffer, JumpListerActivation_OpenInNextViewKeepUI, 0);
}

View File

@ -348,8 +348,8 @@ CUSTOM_DOC("If the cursor is found to be on a jump location, parses the jump loc
{
Heap *heap = &global_heap;
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
Marker_List *list = get_or_make_list_for_buffer(app, heap, buffer);
i64 pos = view_get_cursor_pos(app, view);
@ -362,7 +362,7 @@ CUSTOM_DOC("If the cursor is found to be on a jump location, parses the jump loc
if (get_jump_from_list(app, list, list_index, &location)){
if (get_jump_buffer(app, &buffer, &location)){
change_active_panel(app);
View_ID target_view = get_active_view(app, AccessAll);
View_ID target_view = get_active_view(app, Access_Always);
switch_to_existing_view(app, target_view, buffer);
jump_to_location(app, target_view, buffer, location);
}
@ -375,8 +375,8 @@ CUSTOM_DOC("If the cursor is found to be on a jump location, parses the jump loc
{
Heap *heap = &global_heap;
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
Marker_List *list = get_or_make_list_for_buffer(app, heap, buffer);
@ -399,10 +399,10 @@ internal void
goto_jump_in_order(Application_Links *app, Marker_List *list, View_ID jump_view, ID_Pos_Jump_Location location){
Buffer_ID buffer = {};
if (get_jump_buffer(app, &buffer, &location)){
View_ID target_view = get_active_view(app, AccessAll);
View_ID target_view = get_active_view(app, Access_Always);
if (target_view == jump_view){
change_active_panel(app);
target_view = get_active_view(app, AccessAll);
target_view = get_active_view(app, Access_Always);
}
switch_to_existing_view(app, target_view, buffer);
jump_to_location(app, target_view, buffer, location);
@ -449,7 +449,7 @@ get_locked_jump_state(Application_Links *app, Heap *heap){
Locked_Jump_State result = {};
result.view = get_view_for_locked_jump_buffer(app);
if (result.view != 0){
Buffer_ID buffer = view_get_buffer(app, result.view, AccessAll);
Buffer_ID buffer = view_get_buffer(app, result.view, Access_Always);
result.list = get_or_make_list_for_buffer(app, heap, buffer);
i64 cursor_position = view_get_cursor_pos(app, result.view);
@ -562,10 +562,10 @@ CUSTOM_DOC("If a buffer containing jump locations has been locked in, goes to th
CUSTOM_COMMAND_SIG(if_read_only_goto_position)
CUSTOM_DOC("If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
if (buffer == 0){
buffer = view_get_buffer(app, view, AccessProtected);
buffer = view_get_buffer(app, view, Access_ReadVisible);
if (buffer != 0){
goto_jump_at_cursor(app);
lock_jump_buffer(app, buffer);
@ -579,10 +579,10 @@ CUSTOM_DOC("If the buffer in the active view is writable, inserts a character, o
CUSTOM_COMMAND_SIG(if_read_only_goto_position_same_panel)
CUSTOM_DOC("If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
if (buffer == 0){
buffer = view_get_buffer(app, view, AccessProtected);
buffer = view_get_buffer(app, view, Access_ReadVisible);
if (buffer != 0){
goto_jump_at_cursor_same_panel(app);
lock_jump_buffer(app, buffer);

View File

@ -219,12 +219,12 @@ get_jump_buffer(Application_Links *app, Buffer_ID *buffer, ID_Pos_Jump_Location
static b32
get_jump_buffer(Application_Links *app, Buffer_ID *buffer, ID_Pos_Jump_Location *location){
return(get_jump_buffer(app, buffer, location, AccessAll));
return(get_jump_buffer(app, buffer, location, Access_Always));
}
static View_ID
switch_to_existing_view(Application_Links *app, View_ID view, Buffer_ID buffer){
Buffer_ID current_buffer = view_get_buffer(app, view, AccessAll);
Buffer_ID current_buffer = view_get_buffer(app, view, Access_Always);
if (view != 0 || current_buffer != buffer){
View_ID existing_view = get_first_view_with_buffer(app, buffer);
if (existing_view != 0){
@ -236,7 +236,7 @@ switch_to_existing_view(Application_Links *app, View_ID view, Buffer_ID buffer){
static void
set_view_to_location(Application_Links *app, View_ID view, Buffer_ID buffer, Buffer_Seek seek){
Buffer_ID current_buffer = view_get_buffer(app, view, AccessAll);
Buffer_ID current_buffer = view_get_buffer(app, view, Access_Always);
if (current_buffer != buffer){
view_set_buffer(app, view, buffer, 0);
}
@ -293,7 +293,7 @@ seek_next_jump_in_buffer(Application_Links *app, Arena *arena,
static ID_Line_Column_Jump_Location
convert_name_based_to_id_based(Application_Links *app, Name_Line_Column_Location loc){
ID_Line_Column_Jump_Location result = {};
Buffer_ID buffer = get_buffer_by_name(app, loc.file, AccessAll);
Buffer_ID buffer = get_buffer_by_name(app, loc.file, Access_Always);
if (buffer != 0){
result.buffer_id = buffer;
result.line = loc.line;
@ -307,7 +307,7 @@ seek_next_jump_in_view(Application_Links *app, Arena *arena, View_ID view, i32 s
i64 cursor_position = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(cursor_position));
i64 line = cursor.line;
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Parsed_Jump jump = seek_next_jump_in_buffer(app, arena, buffer, line + direction, skip_sub_errors, direction, &line);
if (jump.success){
*line_out = line;
@ -370,10 +370,10 @@ seek_jump_(Application_Links *app, b32 skip_repeats, b32 skip_sub_errors, i32 di
if (advance_cursor_in_jump_view(app, view, skip_repeats, skip_sub_errors, direction, &location)){
Buffer_ID buffer = {};
if (get_jump_buffer(app, &buffer, &location)){
View_ID target_view = get_active_view(app, AccessAll);
View_ID target_view = get_active_view(app, Access_Always);
if (target_view == view){
change_active_panel(app);
target_view = get_active_view(app, AccessAll);
target_view = get_active_view(app, Access_Always);
}
switch_to_existing_view(app, target_view, buffer);
jump_to_location(app, target_view, buffer, location);

View File

@ -164,7 +164,7 @@ lister_render(Application_Links *app, Frame_Info frame_info, View_ID view){
showing_file_bar &&
!global_config.hide_file_bar_in_ui){
Rect_f32_Pair pair = layout_file_bar_on_top(region, line_height);
Buffer_ID buffer = view_get_buffer(app, view, AccessAll);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
draw_file_bar(app, view, buffer, face_id, pair.min);
region = pair.max;
}
@ -725,7 +725,7 @@ lister_add_item(Lister *lister, String_Const_u8 string, String_Const_u8 status,
function void
lister__write_string__default(Application_Links *app){
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Lister *lister = view_get_lister(view);
if (lister != 0){
User_Input in = get_current_input(app);
@ -742,7 +742,7 @@ lister__write_string__default(Application_Links *app){
function void
lister__backspace_text_field__default(Application_Links *app){
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Lister *lister = view_get_lister(view);
if (lister != 0){
lister->text_field.string = backspace_utf8(lister->text_field.string);

View File

@ -7,7 +7,7 @@ such as open file, switch buffer, or kill buffer.
function void
lister__write_character__file_path(Application_Links *app){
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Lister *lister = view_get_lister(view);
if (lister != 0){
User_Input in = get_current_input(app);
@ -30,7 +30,7 @@ lister__write_character__file_path(Application_Links *app){
function void
lister__backspace_text_field__file_path(Application_Links *app){
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Lister *lister = view_get_lister(view);
if (lister != 0){
if (lister->text_field.size > 0){
@ -68,7 +68,7 @@ lister__backspace_text_field__file_path(Application_Links *app){
function Lister_Activation_Code
lister__key_stroke__fixed_list(Application_Links *app){
Lister_Activation_Code result = ListerActivation_Continue;
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Lister *lister = view_get_lister(view);
if (lister != 0){
User_Input in = get_current_input(app);
@ -223,10 +223,10 @@ generate_all_buffers_list(Application_Links *app, Lister *lister){
// List currently viewed buffers
{
for (View_ID view = get_view_next(app, 0, AccessAll);
for (View_ID view = get_view_next(app, 0, Access_Always);
view != 0;
view = get_view_next(app, view, AccessAll)){
Buffer_ID new_buffer_id = view_get_buffer(app, view, AccessAll);
view = get_view_next(app, view, Access_Always)){
Buffer_ID new_buffer_id = view_get_buffer(app, view, Access_Always);
for (i32 i = 0; i < currently_viewed_buffer_count; i += 1){
if (new_buffer_id == buffers_currently_being_viewed[i]){
goto skip0;
@ -239,9 +239,9 @@ generate_all_buffers_list(Application_Links *app, Lister *lister){
// Regular Buffers
{
for (Buffer_ID buffer = get_buffer_next(app, 0, AccessAll);
for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always);
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessAll)){
buffer = get_buffer_next(app, buffer, Access_Always)){
for (i32 i = 0; i < currently_viewed_buffer_count; i += 1){
if (buffer == buffers_currently_being_viewed[i]){
goto skip1;
@ -255,9 +255,9 @@ generate_all_buffers_list(Application_Links *app, Lister *lister){
}
// Buffers Starting with *
{
for (Buffer_ID buffer = get_buffer_next(app, 0, AccessAll);
for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always);
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessAll)){
buffer = get_buffer_next(app, buffer, Access_Always)){
for (i32 i = 0; i < currently_viewed_buffer_count; i += 1){
if (buffer == buffers_currently_being_viewed[i]){
goto skip2;
@ -324,7 +324,7 @@ generate_hot_directory_file_list(Application_Links *app, Lister *lister){
string_list_push(lister->arena, &list, hot);
string_list_push_overlap(lister->arena, &list, '/', (**info).file_name);
String_Const_u8 full_file_path = string_list_flatten(lister->arena, list);
buffer = get_buffer_by_file_name(app, full_file_path, AccessAll);
buffer = get_buffer_by_file_name(app, full_file_path, Access_Always);
end_temp(path_temp);
}
@ -487,7 +487,7 @@ activate_switch_buffer(Application_Links *app,
CUSTOM_COMMAND_SIG(interactive_switch_buffer)
CUSTOM_DOC("Interactively switch to an open buffer.")
{
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
run_lister_buffer_list(app, "Switch:", activate_switch_buffer, 0, 0, view);
}
@ -506,7 +506,7 @@ activate_kill_buffer(Application_Links *app,
CUSTOM_COMMAND_SIG(interactive_kill_buffer)
CUSTOM_DOC("Interactively kill an open buffer.")
{
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
run_lister_buffer_list(app, "Kill:", activate_kill_buffer, 0, 0, view);
}
@ -577,7 +577,7 @@ activate_open_or_new(Application_Links *app,
CUSTOM_COMMAND_SIG(interactive_open_or_new)
CUSTOM_DOC("Interactively open a file out of the file system.")
{
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
run_lister_file_system_list(app, "Open:", activate_open_or_new, 0, 0, view);
}
@ -616,7 +616,7 @@ activate_new(Application_Links *app,
CUSTOM_COMMAND_SIG(interactive_new)
CUSTOM_DOC("Interactively creates a new file.")
{
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
run_lister_file_system_list(app, "New:", activate_new, 0, 0, view);
}
@ -649,7 +649,7 @@ activate_open(Application_Links *app,
CUSTOM_COMMAND_SIG(interactive_open)
CUSTOM_DOC("Interactively opens a file.")
{
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
run_lister_file_system_list(app, "Open:", activate_open, 0, 0, view);
}
@ -688,7 +688,7 @@ launch_custom_command_lister(Application_Links *app, i32 *command_ids, i32 comma
}
Scratch_Block scratch(app, Scratch_Share);
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
Lister_Option *options = push_array(scratch, Lister_Option, command_id_count);
for (i32 i = 0; i < command_id_count; i += 1){
i32 j = i;

View File

@ -665,7 +665,7 @@ internal void
log_graph_render(Application_Links *app, Frame_Info frame_info, View_ID view){
if (log_parse.arena != 0){
////////////////////////////////
View_ID active_view = get_active_view(app, AccessAll);
View_ID active_view = get_active_view(app, Access_Always);
b32 is_active_view = (active_view == view);
Rect_f32 view_rect = view_get_screen_rect(app, view);
@ -966,12 +966,13 @@ log_graph__click_jump_to_event_source(Application_Links *app, Vec2_f32 m_p){
Log_Event *event = box_node->event;
log_graph.selected_event = event;
View_ID target_view = get_next_view_looped_primary_panels(app, log_view, AccessProtected);
View_ID target_view = get_next_view_looped_primary_panels(app, log_view,
Access_ReadVisible);
if (target_view != 0){
String_Const_u8 file_name = log_parse__get_string(&log_parse, event->src_file_name);
Buffer_ID target_buffer = get_buffer_by_file_name(app, file_name, AccessAll);
Buffer_ID target_buffer = get_buffer_by_file_name(app, file_name, Access_Always);
if (target_buffer == 0){
target_buffer = get_buffer_by_name(app, file_name, AccessAll);
target_buffer = get_buffer_by_name(app, file_name, Access_Always);
}
if (target_buffer != 0){
set_view_to_location(app, target_view, target_buffer,
@ -989,11 +990,11 @@ log_graph__click_jump_to_event_source(Application_Links *app, Vec2_f32 m_p){
CUSTOM_COMMAND_SIG(show_the_log_graph)
CUSTOM_DOC("Parses *log* and displays the 'log graph' UI")
{
Buffer_ID log_buffer = get_buffer_by_name(app, string_u8_litexpr("*log*"), AccessAll);
Buffer_ID log_buffer = get_buffer_by_name(app, string_u8_litexpr("*log*"), Access_Always);
log_parse_fill(app, log_buffer);
if (log_view == 0){
log_view = get_active_view(app, AccessAll);
log_view = get_active_view(app, Access_Always);
}
View_ID view = log_view;

View File

@ -29,8 +29,8 @@ get_numeric_at_cursor(Application_Links *app, Buffer_ID buffer, i64 pos, Miblo_N
CUSTOM_COMMAND_SIG(miblo_increment_basic)
CUSTOM_DOC("Increment an integer under the cursor by one.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
Miblo_Number_Info number = {};
if (get_numeric_at_cursor(app, buffer, pos, &number)){
@ -44,8 +44,8 @@ CUSTOM_DOC("Increment an integer under the cursor by one.")
CUSTOM_COMMAND_SIG(miblo_decrement_basic)
CUSTOM_DOC("Decrement an integer under the cursor by one.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
Miblo_Number_Info number = {};
if (get_numeric_at_cursor(app, buffer, pos, &number)){
@ -214,8 +214,8 @@ get_timestamp_at_cursor(Application_Links *app, Buffer_ID buffer, i64 pos, Miblo
static void
miblo_time_stamp_alter(Application_Links *app, i32 unit_type, i32 amt){
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
Miblo_Timestamp_Info timestamp = {};

View File

@ -35,9 +35,9 @@ close_all_files_with_extension(Application_Links *app, String_Const_u8_Array ext
i32 buffers_to_close_count = 0;
do_repeat = false;
for (Buffer_ID buffer = get_buffer_next(app, 0, AccessAll);
for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always);
buffer != 0;
buffer = get_buffer_next(app, buffer, AccessAll)){
buffer = get_buffer_next(app, buffer, Access_Always)){
b32 is_match = true;
if (extension_array.count > 0){
@ -847,7 +847,7 @@ exec_project_command(Application_Links *app, Project_Command *command){
Buffer_ID buffer = buffer_identifier_to_id(app, buffer_id);
view = get_first_view_with_buffer(app, buffer);
if (view == 0){
view = get_active_view(app, AccessAll);
view = get_active_view(app, Access_Always);
}
}
@ -1341,7 +1341,7 @@ CUSTOM_DOC("Open a lister of all commands in the currently loaded project.")
if (current_project.loaded){
Scratch_Block scratch(app, Scratch_Share);
View_ID view = get_active_view(app, AccessAll);
View_ID view = get_active_view(app, Access_Always);
i32 option_count = current_project.command_array.count;
Lister_Option *options = push_array(scratch, Lister_Option, option_count);
for (i32 i = 0;

View File

@ -7,8 +7,8 @@
CUSTOM_COMMAND_SIG(select_surrounding_scope)
CUSTOM_DOC("Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
Range_i64 range = {};
if (find_surrounding_nest(app, buffer, pos, FindNest_Scope, &range)){
@ -32,8 +32,8 @@ select_next_scope_after_pos(Application_Links *app, View_ID view, Buffer_ID buff
CUSTOM_COMMAND_SIG(select_next_scope_absolute)
CUSTOM_DOC("Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
select_next_scope_after_pos(app, view, buffer, pos);
}
@ -41,8 +41,8 @@ CUSTOM_DOC("Finds the first scope started by '{' after the cursor and puts the c
CUSTOM_COMMAND_SIG(select_next_scope_after_current)
CUSTOM_DOC("Finds the first scope started by '{' after the mark and puts the cursor and mark on the '{' and '}'. This command is meant to be used after a scope is already selected so that it will have the effect of selecting the next scope after the current scope.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
i64 pos = view_get_mark_pos(app, view);
select_next_scope_after_pos(app, view, buffer, pos);
}
@ -50,8 +50,8 @@ CUSTOM_DOC("Finds the first scope started by '{' after the mark and puts the cur
CUSTOM_COMMAND_SIG(select_prev_scope_absolute)
CUSTOM_DOC("Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.")
{
View_ID view = get_active_view(app, AccessProtected);
Buffer_ID buffer = view_get_buffer(app, view, AccessProtected);
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
i64 pos = view_get_cursor_pos(app, view);
Find_Nest_Flag flags = FindNest_Scope;
Range_i64 range = {};
@ -73,8 +73,8 @@ CUSTOM_DOC("Wraps the code contained in the range between cursor and mark with a
CUSTOM_COMMAND_SIG(delete_current_scope)
CUSTOM_DOC("Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
if (buffer_get_char(app, buffer, range.min) == '{' &&

View File

@ -122,7 +122,7 @@ query_user_list_definition_needle(Application_Links *app, Arena *arena){
internal void
list_all_locations__generic(Application_Links *app, String_Const_u8_Array needle, List_All_Locations_Flag flags){
if (needle.count > 0){
View_ID target_view = get_next_view_after_active(app, AccessAll);
View_ID target_view = get_next_view_after_active(app, Access_Always);
String_Match_Flag must_have_flags = 0;
String_Match_Flag must_not_have_flags = 0;
if (HasFlag(flags, ListAllLocationsFlag_CaseSensitive)){
@ -378,8 +378,8 @@ get_word_complete_list(Application_Links *app, Arena *arena, String_Const_u8 nee
CUSTOM_COMMAND_SIG(word_complete)
CUSTOM_DOC("Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.")
{
View_ID view = get_active_view(app, AccessOpen);
Buffer_ID buffer = view_get_buffer(app, view, AccessOpen);
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
if (buffer != 0){
Managed_Scope scope = view_get_managed_scope(app, view);

View File

@ -145,11 +145,17 @@ ENUM(i32, Buffer_Reopen_Result){
BufferReopenResult_Failed = 1,
};
ENUM(u32, Access_Flag){
AccessOpen = 0x0,
AccessProtected = 0x1,
AccessHidden = 0x2,
AccessAll = 0xFF
typedef u32 Access_Flag;
enum{
Access_Write = 0x1,
Access_Read = 0x2,
Access_Visible = 0x4,
};
enum{
Access_Always = 0,
Access_ReadWrite = Access_Write|Access_Read,
Access_ReadVisible = Access_Read|Access_Visible,
Access_ReadWriteVisible = Access_Write|Access_Read|Access_Visible,
};
ENUM(u32, Dirty_State){
@ -189,16 +195,6 @@ ENUM(i32, Panel_Split_Kind){
PanelSplitKind_FixedPixels_Max = 3,
};
ENUM(i32, Panel_Split_Orientation){
PanelSplit_LeftAndRight = 0,
PanelSplit_TopAndBottom = 1,
};
ENUM(i32, Panel_Child){
PanelChild_Min = 0,
PanelChild_Max = 1,
};
TYPEDEF u8 Key_Modifier;
STRUCT Mouse_State{

View File

@ -229,12 +229,12 @@ i32 line_number;
};
static Command_Metadata fcoder_metacmd_table[207] = {
{ PROC_LINKS(default_view_input_handler, 0), "default_view_input_handler", 26, "Input consumption loop for default view behavior", 48, "w:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 56 },
{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2034 },
{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2040 },
{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2046 },
{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2052 },
{ 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\\custom\\4coder_helper.cpp", 36, 2058 },
{ 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\\custom\\4coder_helper.cpp", 36, 2066 },
{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2061 },
{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2067 },
{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2073 },
{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2079 },
{ 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\\custom\\4coder_helper.cpp", 36, 2085 },
{ 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\\custom\\4coder_helper.cpp", 36, 2093 },
{ 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\\custom\\4coder_default_framework.cpp", 47, 203 },
{ 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\\custom\\4coder_default_framework.cpp", 47, 213 },
{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 223 },
@ -379,8 +379,8 @@ static Command_Metadata fcoder_metacmd_table[207] = {
{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 540 },
{ PROC_LINKS(if_read_only_goto_position, 0), "if_read_only_goto_position", 26, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 562 },
{ PROC_LINKS(if_read_only_goto_position_same_panel, 0), "if_read_only_goto_position_same_panel", 37, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 579 },
{ 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\\custom\\4coder_jump_lister.cpp", 41, 102 },
{ PROC_LINKS(show_the_log_graph, 0), "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 989 },
{ 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\\custom\\4coder_jump_lister.cpp", 41, 104 },
{ PROC_LINKS(show_the_log_graph, 0), "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 990 },
{ 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\\custom\\4coder_clipboard.cpp", 39, 19 },
{ 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\\custom\\4coder_clipboard.cpp", 39, 28 },
{ PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 39 },

View File

@ -150,7 +150,6 @@ vtable->get_theme_colors = get_theme_colors;
vtable->finalize_color = finalize_color;
vtable->push_hot_directory = push_hot_directory;
vtable->set_hot_directory = set_hot_directory;
vtable->set_gui_up_down_keys = set_gui_up_down_keys;
vtable->send_exit_signal = send_exit_signal;
vtable->set_window_title = set_window_title;
vtable->draw_string_oriented = draw_string_oriented;
@ -324,7 +323,6 @@ get_theme_colors = vtable->get_theme_colors;
finalize_color = vtable->finalize_color;
push_hot_directory = vtable->push_hot_directory;
set_hot_directory = vtable->set_hot_directory;
set_gui_up_down_keys = vtable->set_gui_up_down_keys;
send_exit_signal = vtable->send_exit_signal;
set_window_title = vtable->set_window_title;
draw_string_oriented = vtable->draw_string_oriented;

View File

@ -62,14 +62,14 @@
#define custom_view_set_preferred_x_sig() b32 custom_view_set_preferred_x(Application_Links* app, View_ID view_id, f32 x)
#define custom_view_get_screen_rect_sig() Rect_f32 custom_view_get_screen_rect(Application_Links* app, View_ID view_id)
#define custom_view_get_panel_sig() Panel_ID custom_view_get_panel(Application_Links* app, View_ID view_id)
#define custom_panel_get_view_sig() View_ID custom_panel_get_view(Application_Links* app, Panel_ID panel_id)
#define custom_panel_get_view_sig() View_ID custom_panel_get_view(Application_Links* app, Panel_ID panel_id, Access_Flag access)
#define custom_panel_is_split_sig() b32 custom_panel_is_split(Application_Links* app, Panel_ID panel_id)
#define custom_panel_is_leaf_sig() b32 custom_panel_is_leaf(Application_Links* app, Panel_ID panel_id)
#define custom_panel_split_sig() b32 custom_panel_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Orientation orientation)
#define custom_panel_set_split_sig() b32 custom_panel_set_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t)
#define custom_panel_split_sig() b32 custom_panel_split(Application_Links* app, Panel_ID panel_id, Dimension split_dim)
#define custom_panel_set_split_sig() b32 custom_panel_set_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, f32 t)
#define custom_panel_swap_children_sig() b32 custom_panel_swap_children(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t)
#define custom_panel_get_parent_sig() Panel_ID custom_panel_get_parent(Application_Links* app, Panel_ID panel_id)
#define custom_panel_get_child_sig() Panel_ID custom_panel_get_child(Application_Links* app, Panel_ID panel_id, Panel_Child which_child)
#define custom_panel_get_child_sig() Panel_ID custom_panel_get_child(Application_Links* app, Panel_ID panel_id, Side which_child)
#define custom_panel_get_max_sig() Panel_ID custom_panel_get_max(Application_Links* app, Panel_ID panel_id)
#define custom_panel_get_margin_sig() Rect_i32 custom_panel_get_margin(Application_Links* app, Panel_ID panel_id)
#define custom_view_close_sig() b32 custom_view_close(Application_Links* app, View_ID view_id)
@ -148,7 +148,6 @@
#define custom_finalize_color_sig() argb_color custom_finalize_color(Application_Links* app, int_color color)
#define custom_push_hot_directory_sig() String_Const_u8 custom_push_hot_directory(Application_Links* app, Arena* arena)
#define custom_set_hot_directory_sig() b32 custom_set_hot_directory(Application_Links* app, String_Const_u8 string)
#define custom_set_gui_up_down_keys_sig() void custom_set_gui_up_down_keys(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier)
#define custom_send_exit_signal_sig() void custom_send_exit_signal(Application_Links* app)
#define custom_set_window_title_sig() b32 custom_set_window_title(Application_Links* app, String_Const_u8 title)
#define custom_draw_string_oriented_sig() Vec2 custom_draw_string_oriented(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta)
@ -232,14 +231,14 @@ typedef f32 custom_view_get_preferred_x_type(Application_Links* app, View_ID vie
typedef b32 custom_view_set_preferred_x_type(Application_Links* app, View_ID view_id, f32 x);
typedef Rect_f32 custom_view_get_screen_rect_type(Application_Links* app, View_ID view_id);
typedef Panel_ID custom_view_get_panel_type(Application_Links* app, View_ID view_id);
typedef View_ID custom_panel_get_view_type(Application_Links* app, Panel_ID panel_id);
typedef View_ID custom_panel_get_view_type(Application_Links* app, Panel_ID panel_id, Access_Flag access);
typedef b32 custom_panel_is_split_type(Application_Links* app, Panel_ID panel_id);
typedef b32 custom_panel_is_leaf_type(Application_Links* app, Panel_ID panel_id);
typedef b32 custom_panel_split_type(Application_Links* app, Panel_ID panel_id, Panel_Split_Orientation orientation);
typedef b32 custom_panel_set_split_type(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t);
typedef b32 custom_panel_split_type(Application_Links* app, Panel_ID panel_id, Dimension split_dim);
typedef b32 custom_panel_set_split_type(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, f32 t);
typedef b32 custom_panel_swap_children_type(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t);
typedef Panel_ID custom_panel_get_parent_type(Application_Links* app, Panel_ID panel_id);
typedef Panel_ID custom_panel_get_child_type(Application_Links* app, Panel_ID panel_id, Panel_Child which_child);
typedef Panel_ID custom_panel_get_child_type(Application_Links* app, Panel_ID panel_id, Side which_child);
typedef Panel_ID custom_panel_get_max_type(Application_Links* app, Panel_ID panel_id);
typedef Rect_i32 custom_panel_get_margin_type(Application_Links* app, Panel_ID panel_id);
typedef b32 custom_view_close_type(Application_Links* app, View_ID view_id);
@ -318,7 +317,6 @@ typedef void custom_get_theme_colors_type(Application_Links* app, Theme_Color* c
typedef argb_color custom_finalize_color_type(Application_Links* app, int_color color);
typedef String_Const_u8 custom_push_hot_directory_type(Application_Links* app, Arena* arena);
typedef b32 custom_set_hot_directory_type(Application_Links* app, String_Const_u8 string);
typedef void custom_set_gui_up_down_keys_type(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier);
typedef void custom_send_exit_signal_type(Application_Links* app);
typedef b32 custom_set_window_title_type(Application_Links* app, String_Const_u8 title);
typedef Vec2 custom_draw_string_oriented_type(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta);
@ -489,7 +487,6 @@ custom_get_theme_colors_type *get_theme_colors;
custom_finalize_color_type *finalize_color;
custom_push_hot_directory_type *push_hot_directory;
custom_set_hot_directory_type *set_hot_directory;
custom_set_gui_up_down_keys_type *set_gui_up_down_keys;
custom_send_exit_signal_type *send_exit_signal;
custom_set_window_title_type *set_window_title;
custom_draw_string_oriented_type *draw_string_oriented;
@ -575,14 +572,14 @@ internal f32 view_get_preferred_x(Application_Links* app, View_ID view_id);
internal b32 view_set_preferred_x(Application_Links* app, View_ID view_id, f32 x);
internal Rect_f32 view_get_screen_rect(Application_Links* app, View_ID view_id);
internal Panel_ID view_get_panel(Application_Links* app, View_ID view_id);
internal View_ID panel_get_view(Application_Links* app, Panel_ID panel_id);
internal View_ID panel_get_view(Application_Links* app, Panel_ID panel_id, Access_Flag access);
internal b32 panel_is_split(Application_Links* app, Panel_ID panel_id);
internal b32 panel_is_leaf(Application_Links* app, Panel_ID panel_id);
internal b32 panel_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Orientation orientation);
internal b32 panel_set_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t);
internal b32 panel_split(Application_Links* app, Panel_ID panel_id, Dimension split_dim);
internal b32 panel_set_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, f32 t);
internal b32 panel_swap_children(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t);
internal Panel_ID panel_get_parent(Application_Links* app, Panel_ID panel_id);
internal Panel_ID panel_get_child(Application_Links* app, Panel_ID panel_id, Panel_Child which_child);
internal Panel_ID panel_get_child(Application_Links* app, Panel_ID panel_id, Side which_child);
internal Panel_ID panel_get_max(Application_Links* app, Panel_ID panel_id);
internal Rect_i32 panel_get_margin(Application_Links* app, Panel_ID panel_id);
internal b32 view_close(Application_Links* app, View_ID view_id);
@ -661,7 +658,6 @@ internal void get_theme_colors(Application_Links* app, Theme_Color* colors, i32
internal argb_color finalize_color(Application_Links* app, int_color color);
internal String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena);
internal b32 set_hot_directory(Application_Links* app, String_Const_u8 string);
internal void set_gui_up_down_keys(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier);
internal void send_exit_signal(Application_Links* app);
internal b32 set_window_title(Application_Links* app, String_Const_u8 title);
internal Vec2 draw_string_oriented(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta);
@ -833,7 +829,6 @@ global custom_get_theme_colors_type *get_theme_colors = 0;
global custom_finalize_color_type *finalize_color = 0;
global custom_push_hot_directory_type *push_hot_directory = 0;
global custom_set_hot_directory_type *set_hot_directory = 0;
global custom_set_gui_up_down_keys_type *set_gui_up_down_keys = 0;
global custom_send_exit_signal_type *send_exit_signal = 0;
global custom_set_window_title_type *set_window_title = 0;
global custom_draw_string_oriented_type *draw_string_oriented = 0;

View File

@ -62,14 +62,14 @@ api(custom) function f32 view_get_preferred_x(Application_Links* app, View_ID vi
api(custom) function b32 view_set_preferred_x(Application_Links* app, View_ID view_id, f32 x);
api(custom) function Rect_f32 view_get_screen_rect(Application_Links* app, View_ID view_id);
api(custom) function Panel_ID view_get_panel(Application_Links* app, View_ID view_id);
api(custom) function View_ID panel_get_view(Application_Links* app, Panel_ID panel_id);
api(custom) function View_ID panel_get_view(Application_Links* app, Panel_ID panel_id, Access_Flag access);
api(custom) function b32 panel_is_split(Application_Links* app, Panel_ID panel_id);
api(custom) function b32 panel_is_leaf(Application_Links* app, Panel_ID panel_id);
api(custom) function b32 panel_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Orientation orientation);
api(custom) function b32 panel_set_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t);
api(custom) function b32 panel_split(Application_Links* app, Panel_ID panel_id, Dimension split_dim);
api(custom) function b32 panel_set_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, f32 t);
api(custom) function b32 panel_swap_children(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t);
api(custom) function Panel_ID panel_get_parent(Application_Links* app, Panel_ID panel_id);
api(custom) function Panel_ID panel_get_child(Application_Links* app, Panel_ID panel_id, Panel_Child which_child);
api(custom) function Panel_ID panel_get_child(Application_Links* app, Panel_ID panel_id, Side which_child);
api(custom) function Panel_ID panel_get_max(Application_Links* app, Panel_ID panel_id);
api(custom) function Rect_i32 panel_get_margin(Application_Links* app, Panel_ID panel_id);
api(custom) function b32 view_close(Application_Links* app, View_ID view_id);
@ -148,7 +148,6 @@ api(custom) function void get_theme_colors(Application_Links* app, Theme_Color*
api(custom) function argb_color finalize_color(Application_Links* app, int_color color);
api(custom) function String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena);
api(custom) function b32 set_hot_directory(Application_Links* app, String_Const_u8 string);
api(custom) function void set_gui_up_down_keys(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier);
api(custom) function void send_exit_signal(Application_Links* app);
api(custom) function b32 set_window_title(Application_Links* app, String_Const_u8 title);
api(custom) function Vec2 draw_string_oriented(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta);

View File

@ -43,449 +43,447 @@ lexeme_table_lookup(u64 *hash_array, String_Const_u8 *key_array,
}
#endif
u64 main_keys_hash_array[122] = {
0x0000000000000000,0x07c5f278d1101ced,0x0000000000000000,0xa62bbbf7713fa62b,
0x0000000000000000,0x0000000000000000,0x189f5b933bf3b933,0xf6c02fd104e622d3,
0xa62bbbf7441048b5,0x31a9b2ff15ce8563,0x68df7003b1bc4821,0x0000000000000000,
0x0000000000000000,0xa62bbbf77f52a37b,0x189f5af5a15e570b,0x68df7003b1b8eceb,
0x0000000000000000,0x0000000000000000,0x189f5b0ad4cbeaa3,0x3af1c28e1ddb0783,
0x2d14d64d82dd3be3,0xa62bbbf5e2f33afd,0x0000000000000000,0xf6c02fd108f91d9b,
0xaf010cb51e08bbc1,0x0000000000000000,0x3192f97fcdee24d3,0x07c5f278d1101f69,
0x189f5af6a7a7ffbd,0x0000000000000000,0x189f5af5bf5767f3,0x3afed33e86adea2d,
0x0000000000000000,0xa62bbbf5e1ec09ad,0x0000000000000000,0x0000000000000000,
0x522ba3fd0f3be8c3,0x0000000000000000,0xf6c02fd104e53add,0xf6c02fd10bdeaa6f,
0x07c5df2eff098d77,0x0000000000000000,0x0000000000000000,0x3afecff9e1ae52e5,
0xf6c02fd10bb24563,0xf6c02fd104eca76b,0x0000000000000000,0x3afed5063319a1eb,
0x68df7003b1bde949,0x189f5af5d4b84fbf,0x07c5d15a314f7723,0x189f5b08d4370559,
0x0000000000000000,0x0000000000000000,0xf6c02fd10baf4dcb,0x0000000000000000,
0x0000000000000000,0x189f5b56738b1265,0x0000000000000000,0x0000000000000000,
0xa62bbbf5e0247cbf,0x3afa82656d98a37b,0xa62bbbf75fa88419,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x189f5b933833cf69,0x0000000000000000,
0xa62bbbf767d15da9,0x0000000000000000,0x19183219f06dcb63,0x68df7003b1bc2429,
0x3afec2d0663f612d,0x0000000000000000,0x0000000000000000,0x3afecf3b77007d35,
0x189f5b0ad46a3da1,0x0000000000000000,0x53cf9ef61495b3e3,0x3af6389d0658983d,
0x0000000000000000,0x0000000000000000,0x07c5df6155313bd1,0x0000000000000000,
0x0000000000000000,0xaf010cb51e08a4a3,0xf6c02fd108fab82b,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x258bb962715d5363,0x189f5af5db0cf073,
0x07c5df26bfde9b65,0xa62bbbf5d67aee5b,0x189f5b566a0beef9,0x0000000000000000,
0x3afedd01e3000695,0x0000000000000000,0x0000000000000000,0xf6c02fd10bb000ad,
0x0000000000000000,0x0000000000000000,0x68df7003b1bde535,0x0000000000000000,
0x0000000000000000,0x189f5af5d7a3840d,0xa62bbbf7710434fb,0x0000000000000000,
0x3af23ba28357b2a3,0x07c5c0b2c6388e35,0x189f5b08dfc6e6b9,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0xf6c02fd10b9d4cbb,
0x60e2b96351c30769,0x0000000000000000,
u64 main_keys_hash_array[121] = {
0xf9b82a9bc92c5f33,0xb6436fbc362998db,0x0000000000000000,0xfba6da6846b00cd1,
0xe34f6ca007b5b81d,0x8a1aa0c1cbf05e73,0x8fd4a100ba640fcd,0x0000000000000000,
0x2ce3ee58579b1a55,0x22656326fd2b4911,0x0000000000000000,0xf9b8223032c3ecd1,
0x8fd4a100a91f262d,0xa88ecc26a7f77b99,0xb6436cf8c4fa5e81,0x0000000000000000,
0x0000000000000000,0x8fd4a100a9643df1,0x0000000000000000,0x8fd4a100a9603db3,
0x0000000000000000,0xf9b83340fd2e9de3,0x0000000000000000,0xfba6da5cdcae2bd3,
0xb6436fbc3629996b,0xf9b89388bba220d3,0xfba6da684500801f,0xf9a78870e743a847,
0x0000000000000000,0xa88ecc26a7e0d42d,0xa88ecc26a7f23dcd,0xf9b812edb5d97433,
0xa88ecc26a7ef7051,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0xf9b9a571da137975,0xfba6da64e06f0463,
0xfba6da686cfb1c71,0xfba6da681a116c23,0x0000000000000000,0x0000000000000000,
0x11acd6d4ea0a02a1,0x0000000000000000,0x0000000000000000,0x6affad88658048a1,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0x8a1aa0c1cbf1b917,
0x0000000000000000,0x0000000000000000,0xa88ecc26a7a547b1,0x8fd4a100bcf58153,
0x8fd4a100aaefa25f,0x0000000000000000,0xa88ecc26a7e3323d,0x0000000000000000,
0x0000000000000000,0x8fd4a100baee8df7,0xfba6da64d8ddd323,0x0000000000000000,
0x0000000000000000,0xa88ecc26a79f7b99,0xfba6da5cd0b49155,0xa88ecc26a7f69e9d,
0xfba6da67185db213,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0xfba6da69c6296b5b,0x8fd4a100b7ff4c8d,0x0000000000000000,
0xf9b83de0de17f603,0x0000000000000000,0x6ca6c603c047daa1,0x0000000000000000,
0x0000000000000000,0x3308377a8b225aa1,0x0000000000000000,0x8a1aa0c1cbf163a9,
0x0000000000000000,0x0000000000000000,0xb6436c68778fc797,0xfba6da675a1126e5,
0xa88ecc26a7ee0e0b,0x8fd4a100ae608e9d,0x0000000000000000,0x2ce3ee58579b1d7f,
0x0000000000000000,0x8fd4a103511baa33,0xfba6da6882ea3055,0x0000000000000000,
0xb6436c2911b7425d,0x0000000000000000,0x6ebc09e02b8457d3,0xf9b830388e251d3d,
0xa88ecc26a7a5110b,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0xb6436cf7d2df0e63,0xb6436f1fe4e8fbb3,0x22664a1c2bc81d01,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0xfba6da686e9a3cc1,
0x8a1aa0c1cbf00147,0x0000000000000000,0xf9b894d86adff051,0x8a1aa0c1cbf09e37,
0xfba6da686e7280bb,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0x0000000000000000,
};
u8 main_keys_key_array_1[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,};
u8 main_keys_key_array_3[] = {0x66,0x61,0x6c,0x73,0x65,};
u8 main_keys_key_array_6[] = {0x65,0x78,0x74,0x65,0x72,0x6e,};
u8 main_keys_key_array_7[] = {0x63,0x61,0x73,0x65,};
u8 main_keys_key_array_8[] = {0x77,0x68,0x69,0x6c,0x65,};
u8 main_keys_key_array_9[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,};
u8 main_keys_key_array_10[] = {0x6e,0x65,0x77,};
u8 main_keys_key_array_13[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 main_keys_key_array_14[] = {0x74,0x79,0x70,0x65,0x69,0x64,};
u8 main_keys_key_array_15[] = {0x61,0x73,0x6d,};
u8 main_keys_key_array_18[] = {0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 main_keys_key_array_19[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,};
u8 main_keys_key_array_20[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_21[] = {0x62,0x72,0x65,0x61,0x6b,};
u8 main_keys_key_array_23[] = {0x65,0x6e,0x75,0x6d,};
u8 main_keys_key_array_24[] = {0x69,0x66,};
u8 main_keys_key_array_26[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,};
u8 main_keys_key_array_27[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,};
u8 main_keys_key_array_28[] = {0x70,0x75,0x62,0x6c,0x69,0x63,};
u8 main_keys_key_array_30[] = {0x72,0x65,0x74,0x75,0x72,0x6e,};
u8 main_keys_key_array_31[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,};
u8 main_keys_key_array_33[] = {0x63,0x6c,0x61,0x73,0x73,};
u8 main_keys_key_array_36[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,};
u8 main_keys_key_array_38[] = {0x63,0x68,0x61,0x72,};
u8 main_keys_key_array_39[] = {0x67,0x6f,0x74,0x6f,};
u8 main_keys_key_array_40[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,};
u8 main_keys_key_array_43[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,};
u8 main_keys_key_array_44[] = {0x74,0x72,0x75,0x65,};
u8 main_keys_key_array_45[] = {0x62,0x6f,0x6f,0x6c,};
u8 main_keys_key_array_47[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,};
u8 main_keys_key_array_48[] = {0x69,0x6e,0x74,};
u8 main_keys_key_array_49[] = {0x73,0x77,0x69,0x74,0x63,0x68,};
u8 main_keys_key_array_50[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,};
u8 main_keys_key_array_51[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,};
u8 main_keys_key_array_54[] = {0x76,0x6f,0x69,0x64,};
u8 main_keys_key_array_57[] = {0x64,0x65,0x6c,0x65,0x74,0x65,};
u8 main_keys_key_array_60[] = {0x63,0x61,0x74,0x63,0x68,};
u8 main_keys_key_array_61[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,};
u8 main_keys_key_array_62[] = {0x75,0x6e,0x69,0x6f,0x6e,};
u8 main_keys_key_array_66[] = {0x65,0x78,0x70,0x6f,0x72,0x74,};
u8 main_keys_key_array_68[] = {0x73,0x68,0x6f,0x72,0x74,};
u8 main_keys_key_array_70[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_71[] = {0x74,0x72,0x79,};
u8 main_keys_key_array_72[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,};
u8 main_keys_key_array_75[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,};
u8 main_keys_key_array_76[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,};
u8 main_keys_key_array_78[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_79[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,};
u8 main_keys_key_array_82[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,};
u8 main_keys_key_array_85[] = {0x64,0x6f,};
u8 main_keys_key_array_86[] = {0x65,0x6c,0x73,0x65,};
u8 main_keys_key_array_90[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_91[] = {0x73,0x74,0x72,0x75,0x63,0x74,};
u8 main_keys_key_array_92[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,};
u8 main_keys_key_array_93[] = {0x63,0x6f,0x6e,0x73,0x74,};
u8 main_keys_key_array_94[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,};
u8 main_keys_key_array_96[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,};
u8 main_keys_key_array_99[] = {0x74,0x68,0x69,0x73,};
u8 main_keys_key_array_102[] = {0x66,0x6f,0x72,};
u8 main_keys_key_array_105[] = {0x73,0x74,0x61,0x74,0x69,0x63,};
u8 main_keys_key_array_106[] = {0x66,0x6c,0x6f,0x61,0x74,};
u8 main_keys_key_array_108[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 main_keys_key_array_109[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,};
u8 main_keys_key_array_110[] = {0x66,0x72,0x69,0x65,0x6e,0x64,};
u8 main_keys_key_array_119[] = {0x6c,0x6f,0x6e,0x67,};
u8 main_keys_key_array_120[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,};
String_Const_u8 main_keys_key_array[122] = {
{0, 0},
u8 main_keys_key_array_0[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,};
u8 main_keys_key_array_1[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,};
u8 main_keys_key_array_3[] = {0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 main_keys_key_array_4[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,};
u8 main_keys_key_array_5[] = {0x69,0x6e,0x74,};
u8 main_keys_key_array_6[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 main_keys_key_array_8[] = {0x64,0x6f,};
u8 main_keys_key_array_9[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,};
u8 main_keys_key_array_11[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 main_keys_key_array_12[] = {0x63,0x6f,0x6e,0x73,0x74,};
u8 main_keys_key_array_13[] = {0x65,0x6e,0x75,0x6d,};
u8 main_keys_key_array_14[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,};
u8 main_keys_key_array_17[] = {0x63,0x61,0x74,0x63,0x68,};
u8 main_keys_key_array_19[] = {0x63,0x6c,0x61,0x73,0x73,};
u8 main_keys_key_array_21[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,};
u8 main_keys_key_array_23[] = {0x65,0x78,0x70,0x6f,0x72,0x74,};
u8 main_keys_key_array_24[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,};
u8 main_keys_key_array_25[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,};
u8 main_keys_key_array_26[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,};
u8 main_keys_key_array_27[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,};
u8 main_keys_key_array_29[] = {0x67,0x6f,0x74,0x6f,};
u8 main_keys_key_array_30[] = {0x6c,0x6f,0x6e,0x67,};
u8 main_keys_key_array_31[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,};
u8 main_keys_key_array_32[] = {0x74,0x72,0x75,0x65,};
u8 main_keys_key_array_38[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,};
u8 main_keys_key_array_39[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,};
u8 main_keys_key_array_40[] = {0x73,0x77,0x69,0x74,0x63,0x68,};
u8 main_keys_key_array_41[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,};
u8 main_keys_key_array_44[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_47[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_51[] = {0x66,0x6f,0x72,};
u8 main_keys_key_array_54[] = {0x63,0x61,0x73,0x65,};
u8 main_keys_key_array_55[] = {0x73,0x68,0x6f,0x72,0x74,};
u8 main_keys_key_array_56[] = {0x62,0x72,0x65,0x61,0x6b,};
u8 main_keys_key_array_58[] = {0x76,0x6f,0x69,0x64,};
u8 main_keys_key_array_61[] = {0x75,0x6e,0x69,0x6f,0x6e,};
u8 main_keys_key_array_62[] = {0x64,0x65,0x6c,0x65,0x74,0x65,};
u8 main_keys_key_array_65[] = {0x62,0x6f,0x6f,0x6c,};
u8 main_keys_key_array_66[] = {0x65,0x78,0x74,0x65,0x72,0x6e,};
u8 main_keys_key_array_67[] = {0x65,0x6c,0x73,0x65,};
u8 main_keys_key_array_68[] = {0x66,0x72,0x69,0x65,0x6e,0x64,};
u8 main_keys_key_array_73[] = {0x70,0x75,0x62,0x6c,0x69,0x63,};
u8 main_keys_key_array_74[] = {0x66,0x6c,0x6f,0x61,0x74,};
u8 main_keys_key_array_76[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,};
u8 main_keys_key_array_78[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_81[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_83[] = {0x61,0x73,0x6d,};
u8 main_keys_key_array_86[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,};
u8 main_keys_key_array_87[] = {0x74,0x79,0x70,0x65,0x69,0x64,};
u8 main_keys_key_array_88[] = {0x74,0x68,0x69,0x73,};
u8 main_keys_key_array_89[] = {0x66,0x61,0x6c,0x73,0x65,};
u8 main_keys_key_array_91[] = {0x69,0x66,};
u8 main_keys_key_array_93[] = {0x77,0x68,0x69,0x6c,0x65,};
u8 main_keys_key_array_94[] = {0x72,0x65,0x74,0x75,0x72,0x6e,};
u8 main_keys_key_array_96[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,};
u8 main_keys_key_array_98[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,};
u8 main_keys_key_array_99[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,};
u8 main_keys_key_array_100[] = {0x63,0x68,0x61,0x72,};
u8 main_keys_key_array_105[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,};
u8 main_keys_key_array_106[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,};
u8 main_keys_key_array_107[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,};
u8 main_keys_key_array_111[] = {0x73,0x74,0x72,0x75,0x63,0x74,};
u8 main_keys_key_array_112[] = {0x6e,0x65,0x77,};
u8 main_keys_key_array_114[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,};
u8 main_keys_key_array_115[] = {0x74,0x72,0x79,};
u8 main_keys_key_array_116[] = {0x73,0x74,0x61,0x74,0x69,0x63,};
String_Const_u8 main_keys_key_array[121] = {
{main_keys_key_array_0, 8},
{main_keys_key_array_1, 7},
{0, 0},
{main_keys_key_array_3, 5},
{main_keys_key_array_3, 6},
{main_keys_key_array_4, 12},
{main_keys_key_array_5, 3},
{main_keys_key_array_6, 5},
{0, 0},
{0, 0},
{main_keys_key_array_6, 6},
{main_keys_key_array_7, 4},
{main_keys_key_array_8, 5},
{main_keys_key_array_8, 2},
{main_keys_key_array_9, 9},
{main_keys_key_array_10, 3},
{0, 0},
{main_keys_key_array_11, 8},
{main_keys_key_array_12, 5},
{main_keys_key_array_13, 4},
{main_keys_key_array_14, 7},
{0, 0},
{0, 0},
{main_keys_key_array_13, 5},
{main_keys_key_array_14, 6},
{main_keys_key_array_15, 3},
{main_keys_key_array_17, 5},
{0, 0},
{main_keys_key_array_19, 5},
{0, 0},
{main_keys_key_array_18, 6},
{main_keys_key_array_19, 8},
{main_keys_key_array_20, 10},
{main_keys_key_array_21, 5},
{main_keys_key_array_21, 8},
{0, 0},
{main_keys_key_array_23, 4},
{main_keys_key_array_24, 2},
{main_keys_key_array_23, 6},
{main_keys_key_array_24, 7},
{main_keys_key_array_25, 8},
{main_keys_key_array_26, 6},
{main_keys_key_array_27, 8},
{0, 0},
{main_keys_key_array_26, 9},
{main_keys_key_array_27, 7},
{main_keys_key_array_28, 6},
{0, 0},
{main_keys_key_array_30, 6},
{main_keys_key_array_29, 4},
{main_keys_key_array_30, 4},
{main_keys_key_array_31, 8},
{0, 0},
{main_keys_key_array_33, 5},
{main_keys_key_array_32, 4},
{0, 0},
{0, 0},
{main_keys_key_array_36, 12},
{0, 0},
{main_keys_key_array_38, 4},
{main_keys_key_array_39, 4},
{main_keys_key_array_40, 7},
{0, 0},
{0, 0},
{main_keys_key_array_43, 8},
{main_keys_key_array_44, 4},
{main_keys_key_array_45, 4},
{0, 0},
{main_keys_key_array_47, 8},
{main_keys_key_array_48, 3},
{main_keys_key_array_49, 6},
{main_keys_key_array_50, 7},
{main_keys_key_array_51, 6},
{main_keys_key_array_38, 8},
{main_keys_key_array_39, 6},
{main_keys_key_array_40, 6},
{main_keys_key_array_41, 6},
{0, 0},
{0, 0},
{main_keys_key_array_44, 10},
{0, 0},
{0, 0},
{main_keys_key_array_47, 12},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_51, 3},
{0, 0},
{0, 0},
{main_keys_key_array_54, 4},
{main_keys_key_array_55, 5},
{main_keys_key_array_56, 5},
{0, 0},
{main_keys_key_array_58, 4},
{0, 0},
{0, 0},
{main_keys_key_array_57, 6},
{0, 0},
{0, 0},
{main_keys_key_array_60, 5},
{main_keys_key_array_61, 8},
{main_keys_key_array_62, 5},
{0, 0},
{main_keys_key_array_61, 5},
{main_keys_key_array_62, 6},
{0, 0},
{0, 0},
{main_keys_key_array_65, 4},
{main_keys_key_array_66, 6},
{0, 0},
{main_keys_key_array_68, 5},
{0, 0},
{main_keys_key_array_70, 12},
{main_keys_key_array_71, 3},
{main_keys_key_array_72, 8},
{0, 0},
{0, 0},
{main_keys_key_array_75, 8},
{main_keys_key_array_76, 6},
{0, 0},
{main_keys_key_array_78, 16},
{main_keys_key_array_79, 8},
{0, 0},
{0, 0},
{main_keys_key_array_82, 7},
{0, 0},
{0, 0},
{main_keys_key_array_85, 2},
{main_keys_key_array_86, 4},
{main_keys_key_array_67, 4},
{main_keys_key_array_68, 6},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_90, 11},
{main_keys_key_array_91, 6},
{main_keys_key_array_92, 7},
{0, 0},
{main_keys_key_array_73, 6},
{main_keys_key_array_74, 5},
{0, 0},
{main_keys_key_array_76, 8},
{0, 0},
{main_keys_key_array_78, 11},
{0, 0},
{0, 0},
{main_keys_key_array_81, 16},
{0, 0},
{main_keys_key_array_83, 3},
{0, 0},
{0, 0},
{main_keys_key_array_86, 7},
{main_keys_key_array_87, 6},
{main_keys_key_array_88, 4},
{main_keys_key_array_89, 5},
{0, 0},
{main_keys_key_array_91, 2},
{0, 0},
{main_keys_key_array_93, 5},
{main_keys_key_array_94, 6},
{0, 0},
{main_keys_key_array_96, 8},
{main_keys_key_array_96, 7},
{0, 0},
{0, 0},
{main_keys_key_array_99, 4},
{0, 0},
{0, 0},
{main_keys_key_array_102, 3},
{0, 0},
{0, 0},
{main_keys_key_array_105, 6},
{main_keys_key_array_106, 5},
{0, 0},
{main_keys_key_array_108, 8},
{main_keys_key_array_109, 7},
{main_keys_key_array_110, 6},
{main_keys_key_array_98, 13},
{main_keys_key_array_99, 8},
{main_keys_key_array_100, 4},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_105, 7},
{main_keys_key_array_106, 7},
{main_keys_key_array_107, 9},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_111, 6},
{main_keys_key_array_112, 3},
{0, 0},
{main_keys_key_array_114, 8},
{main_keys_key_array_115, 3},
{main_keys_key_array_116, 6},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_119, 4},
{main_keys_key_array_120, 13},
{0, 0},
};
Lexeme_Table_Value main_keys_value_array[122] = {
{0, 0},
{4, TokenCppKind_AlignAs},
{0, 0},
{8, TokenCppKind_LiteralFalse},
{0, 0},
{0, 0},
{4, TokenCppKind_Extern},
{4, TokenCppKind_Case},
{4, TokenCppKind_While},
{4, TokenCppKind_Namespace},
{4, TokenCppKind_New},
{0, 0},
{0, 0},
{4, TokenCppKind_Using},
{4, TokenCppKind_TypeID},
{4, TokenCppKind_Asm},
{0, 0},
Lexeme_Table_Value main_keys_value_array[121] = {
{4, TokenCppKind_Volatile},
{4, TokenCppKind_AlignOf},
{0, 0},
{4, TokenCppKind_Signed},
{4, TokenCppKind_Continue},
{4, TokenCppKind_ConstCast},
{4, TokenCppKind_Break},
{0, 0},
{4, TokenCppKind_Enum},
{4, TokenCppKind_If},
{0, 0},
{4, TokenCppKind_Protected},
{4, TokenCppKind_AlignOf},
{4, TokenCppKind_Public},
{0, 0},
{4, TokenCppKind_Return},
{4, TokenCppKind_Register},
{0, 0},
{4, TokenCppKind_Class},
{0, 0},
{0, 0},
{4, TokenCppKind_ThreadLocal},
{4, TokenCppKind_Int},
{4, TokenCppKind_Using},
{0, 0},
{4, TokenCppKind_Char},
{4, TokenCppKind_Goto},
{4, TokenCppKind_Do},
{4, TokenCppKind_Protected},
{0, 0},
{4, TokenCppKind_Unsigned},
{4, TokenCppKind_Const},
{4, TokenCppKind_Enum},
{4, TokenCppKind_NullPtr},
{0, 0},
{0, 0},
{4, TokenCppKind_Template},
{8, TokenCppKind_LiteralTrue},
{4, TokenCppKind_Bool},
{4, TokenCppKind_Catch},
{0, 0},
{4, TokenCppKind_Typename},
{4, TokenCppKind_Int},
{4, TokenCppKind_Class},
{0, 0},
{4, TokenCppKind_Template},
{0, 0},
{4, TokenCppKind_Export},
{4, TokenCppKind_AlignAs},
{4, TokenCppKind_DeclType},
{4, TokenCppKind_SizeOf},
{4, TokenCppKind_Operator},
{0, 0},
{4, TokenCppKind_Goto},
{4, TokenCppKind_Long},
{4, TokenCppKind_NoExcept},
{8, TokenCppKind_LiteralTrue},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Explicit},
{4, TokenCppKind_Double},
{4, TokenCppKind_Switch},
{4, TokenCppKind_Virtual},
{4, TokenCppKind_Inline},
{0, 0},
{0, 0},
{4, TokenCppKind_Void},
{4, TokenCppKind_ConstCast},
{0, 0},
{0, 0},
{4, TokenCppKind_Delete},
{0, 0},
{0, 0},
{4, TokenCppKind_Catch},
{4, TokenCppKind_Explicit},
{4, TokenCppKind_Union},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Export},
{0, 0},
{4, TokenCppKind_Short},
{0, 0},
{4, TokenCppKind_DynamicCast},
{4, TokenCppKind_Try},
{4, TokenCppKind_NoExcept},
{0, 0},
{0, 0},
{4, TokenCppKind_Volatile},
{4, TokenCppKind_SizeOf},
{0, 0},
{4, TokenCppKind_ReinterpretCast},
{4, TokenCppKind_DeclType},
{0, 0},
{0, 0},
{4, TokenCppKind_Typedef},
{0, 0},
{0, 0},
{4, TokenCppKind_Do},
{4, TokenCppKind_Else},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_StaticCast},
{4, TokenCppKind_Struct},
{4, TokenCppKind_Private},
{4, TokenCppKind_Const},
{4, TokenCppKind_Double},
{0, 0},
{4, TokenCppKind_Operator},
{0, 0},
{0, 0},
{4, TokenCppKind_This},
{0, 0},
{0, 0},
{4, TokenCppKind_For},
{0, 0},
{0, 0},
{4, TokenCppKind_Static},
{4, TokenCppKind_Float},
{4, TokenCppKind_Case},
{4, TokenCppKind_Short},
{4, TokenCppKind_Break},
{0, 0},
{4, TokenCppKind_Unsigned},
{4, TokenCppKind_Default},
{4, TokenCppKind_Void},
{0, 0},
{0, 0},
{4, TokenCppKind_Union},
{4, TokenCppKind_Delete},
{0, 0},
{0, 0},
{4, TokenCppKind_Bool},
{4, TokenCppKind_Extern},
{4, TokenCppKind_Else},
{4, TokenCppKind_Friend},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Public},
{4, TokenCppKind_Float},
{0, 0},
{4, TokenCppKind_Register},
{0, 0},
{4, TokenCppKind_StaticCast},
{0, 0},
{0, 0},
{4, TokenCppKind_ReinterpretCast},
{0, 0},
{4, TokenCppKind_Asm},
{0, 0},
{0, 0},
{4, TokenCppKind_Long},
{4, TokenCppKind_Typedef},
{4, TokenCppKind_TypeID},
{4, TokenCppKind_This},
{8, TokenCppKind_LiteralFalse},
{0, 0},
{4, TokenCppKind_If},
{0, 0},
{4, TokenCppKind_While},
{4, TokenCppKind_Return},
{0, 0},
{4, TokenCppKind_Virtual},
{0, 0},
{4, TokenCppKind_StaticAssert},
{4, TokenCppKind_Typename},
{4, TokenCppKind_Char},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Private},
{4, TokenCppKind_Default},
{4, TokenCppKind_Namespace},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Struct},
{4, TokenCppKind_New},
{0, 0},
{4, TokenCppKind_Continue},
{4, TokenCppKind_Try},
{4, TokenCppKind_Static},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
};
i32 main_keys_slot_count = 122;
u64 main_keys_seed = 0x72a08ef8c3b20b14;
i32 main_keys_slot_count = 121;
u64 main_keys_seed = 0x4e71603d6bab78be;
u64 pp_directives_hash_array[25] = {
0xad4540de30c71edd,0x0000000000000000,0x0000000000000000,0x0e18faf5e569c2b1,
0xa64e19bb79cbac21,0x0000000000000000,0xad4540de1b0f0bc9,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0xad4540de18b15083,0xa64e188dd72574bd,
0xffd4966f134594b1,0xffd4966e47d3f229,0x0000000000000000,0x3b12b187afde4529,
0xffd4966e2c27f051,0x0000000000000000,0xad4540d9ef8ab729,0xffd49673f22de19f,
0x0000000000000000,0x0e18faf5e5976a43,0xad4540de12fc7049,0x0e18faf5e5976149,
0x11557879e6f0ea77,0x660a16e8e3deeead,0x6ce110cd12875a1f,0x0000000000000000,
0x05d53bc1ed49019f,0xe0ea3af73f832cff,0x660a16e8e388da77,0x0000000000000000,
0x0000000000000000,0x1155675ee54cd183,0x11557878a3b561f3,0x0000000000000000,
0xe0eb9286644bb223,0x115578679cce8ad9,0x0000000000000000,0x0000000000000000,
0x660a16e8efe01327,0x0000000000000000,0x660a16e8ebbdd277,0x6ce110cd1279b983,
0x6ce110cd128723fd,0x0000000000000000,0x660a16e8ecb496bf,0x0000000000000000,
0x0000000000000000,
};
u8 pp_directives_key_array_0[] = {0x65,0x72,0x72,0x6f,0x72,};
u8 pp_directives_key_array_3[] = {0x6c,0x69,0x6e,0x65,};
u8 pp_directives_key_array_4[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,};
u8 pp_directives_key_array_6[] = {0x69,0x66,0x64,0x65,0x66,};
u8 pp_directives_key_array_10[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 pp_directives_key_array_11[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,};
u8 pp_directives_key_array_12[] = {0x64,0x65,0x66,0x69,0x6e,0x65,};
u8 pp_directives_key_array_13[] = {0x69,0x66,0x6e,0x64,0x65,0x66,};
u8 pp_directives_key_array_15[] = {0x69,0x66,};
u8 pp_directives_key_array_16[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,};
u8 pp_directives_key_array_18[] = {0x65,0x6e,0x64,0x69,0x66,};
u8 pp_directives_key_array_19[] = {0x70,0x72,0x61,0x67,0x6d,0x61,};
u8 pp_directives_key_array_21[] = {0x65,0x6c,0x73,0x65,};
u8 pp_directives_key_array_22[] = {0x75,0x6e,0x64,0x65,0x66,};
u8 pp_directives_key_array_23[] = {0x65,0x6c,0x69,0x66,};
u8 pp_directives_key_array_0[] = {0x69,0x66,0x6e,0x64,0x65,0x66,};
u8 pp_directives_key_array_1[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 pp_directives_key_array_2[] = {0x65,0x6c,0x69,0x66,};
u8 pp_directives_key_array_4[] = {0x69,0x66,};
u8 pp_directives_key_array_5[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,};
u8 pp_directives_key_array_6[] = {0x75,0x6e,0x64,0x65,0x66,};
u8 pp_directives_key_array_9[] = {0x64,0x65,0x66,0x69,0x6e,0x65,};
u8 pp_directives_key_array_10[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,};
u8 pp_directives_key_array_12[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,};
u8 pp_directives_key_array_13[] = {0x70,0x72,0x61,0x67,0x6d,0x61,};
u8 pp_directives_key_array_16[] = {0x65,0x72,0x72,0x6f,0x72,};
u8 pp_directives_key_array_18[] = {0x69,0x66,0x64,0x65,0x66,};
u8 pp_directives_key_array_19[] = {0x6c,0x69,0x6e,0x65,};
u8 pp_directives_key_array_20[] = {0x65,0x6c,0x73,0x65,};
u8 pp_directives_key_array_22[] = {0x65,0x6e,0x64,0x69,0x66,};
String_Const_u8 pp_directives_key_array[25] = {
{pp_directives_key_array_0, 5},
{0, 0},
{0, 0},
{pp_directives_key_array_3, 4},
{pp_directives_key_array_4, 7},
{pp_directives_key_array_0, 6},
{pp_directives_key_array_1, 5},
{pp_directives_key_array_2, 4},
{0, 0},
{pp_directives_key_array_4, 2},
{pp_directives_key_array_5, 7},
{pp_directives_key_array_6, 5},
{0, 0},
{0, 0},
{pp_directives_key_array_9, 6},
{pp_directives_key_array_10, 6},
{0, 0},
{pp_directives_key_array_10, 5},
{pp_directives_key_array_11, 7},
{pp_directives_key_array_12, 6},
{pp_directives_key_array_12, 7},
{pp_directives_key_array_13, 6},
{0, 0},
{pp_directives_key_array_15, 2},
{pp_directives_key_array_16, 6},
{0, 0},
{pp_directives_key_array_16, 5},
{0, 0},
{pp_directives_key_array_18, 5},
{pp_directives_key_array_19, 6},
{pp_directives_key_array_19, 4},
{pp_directives_key_array_20, 4},
{0, 0},
{pp_directives_key_array_21, 4},
{pp_directives_key_array_22, 5},
{pp_directives_key_array_23, 4},
{0, 0},
{0, 0},
};
Lexeme_Table_Value pp_directives_value_array[25] = {
{5, TokenCppKind_PPError},
{0, 0},
{0, 0},
{5, TokenCppKind_PPLine},
{5, TokenCppKind_PPVersion},
{0, 0},
{5, TokenCppKind_PPIfDef},
{0, 0},
{0, 0},
{0, 0},
{5, TokenCppKind_PPUsing},
{5, TokenCppKind_PPInclude},
{5, TokenCppKind_PPDefine},
{5, TokenCppKind_PPIfNDef},
{5, TokenCppKind_PPUsing},
{5, TokenCppKind_PPElIf},
{0, 0},
{5, TokenCppKind_PPIf},
{5, TokenCppKind_PPVersion},
{5, TokenCppKind_PPUndef},
{0, 0},
{0, 0},
{5, TokenCppKind_PPDefine},
{5, TokenCppKind_PPImport},
{0, 0},
{5, TokenCppKind_PPEndIf},
{5, TokenCppKind_PPInclude},
{5, TokenCppKind_PPPragma},
{0, 0},
{0, 0},
{5, TokenCppKind_PPError},
{0, 0},
{5, TokenCppKind_PPIfDef},
{5, TokenCppKind_PPLine},
{5, TokenCppKind_PPElse},
{5, TokenCppKind_PPUndef},
{5, TokenCppKind_PPElIf},
{0, 0},
{5, TokenCppKind_PPEndIf},
{0, 0},
{0, 0},
};
i32 pp_directives_slot_count = 25;
u64 pp_directives_seed = 0x639be38020429ccc;
u64 pp_directives_seed = 0xf30c26e2b8e4ff9e;
u64 pp_keys_hash_array[2] = {
0x03502b4f7f689da7,0x0000000000000000,
0x0000000000000000,0xee296b9aa9ca2a41,
};
u8 pp_keys_key_array_0[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,};
u8 pp_keys_key_array_1[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,};
String_Const_u8 pp_keys_key_array[2] = {
{pp_keys_key_array_0, 7},
{0, 0},
{pp_keys_key_array_1, 7},
};
Lexeme_Table_Value pp_keys_value_array[2] = {
{4, TokenCppKind_PPDefined},
{0, 0},
{4, TokenCppKind_PPDefined},
};
i32 pp_keys_slot_count = 2;
u64 pp_keys_seed = 0xbf1efe4a490d5f30;
u64 pp_keys_seed = 0x83e4bc6eb147cac1;
internal Token_List
lex_full_input_cpp(Arena *arena, String_Const_u8 input){
Token_List list = {};