Merge remote-tracking branch 'origin/master' into linux-update

This commit is contained in:
Alex Baines 2020-02-01 21:29:11 +00:00
commit 1091b9d2d4
115 changed files with 13763 additions and 7981 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
vc120.pdb vc120.pdb
4ed_data.ctm 4ed_data.ctm
.DS_Store .DS_Store
*.dSYM

11
4ed.cpp
View File

@ -201,6 +201,7 @@ App_Read_Command_Line_Sig(app_read_command_line){
App_Init_Sig(app_init){ App_Init_Sig(app_init){
Models *models = (Models*)base_ptr; Models *models = (Models*)base_ptr;
models->keep_playing = true; models->keep_playing = true;
models->hard_exit = false;
models->config_api = api; models->config_api = api;
models->virtual_event_arena = reserve_arena(tctx); models->virtual_event_arena = reserve_arena(tctx);
@ -727,14 +728,10 @@ App_Step_Sig(app_step){
} }
// NOTE(allen): if the exit signal has been sent, run the exit hook. // NOTE(allen): if the exit signal has been sent, run the exit hook.
if (input->trying_to_kill){ if (!models->keep_playing || input->trying_to_kill){
models->keep_playing = false; co_send_core_event(tctx, models, CoreCode_TryExit);
}
if (!models->keep_playing){
if (co_send_core_event(tctx, models, CoreCode_TryExit)){
models->keep_playing = true; models->keep_playing = true;
} }
}
// NOTE(allen): rendering // NOTE(allen): rendering
{ {
@ -806,7 +803,7 @@ App_Step_Sig(app_step){
models->prev_mouse_panel = mouse_panel; models->prev_mouse_panel = mouse_panel;
app_result.lctrl_lalt_is_altgr = models->settings.lctrl_lalt_is_altgr; app_result.lctrl_lalt_is_altgr = models->settings.lctrl_lalt_is_altgr;
app_result.perform_kill = !models->keep_playing; app_result.perform_kill = models->hard_exit;
app_result.animating = models->animate_next_frame; app_result.animating = models->animate_next_frame;
if (models->animate_next_frame){ if (models->animate_next_frame){
// NOTE(allen): Silence the timer, because we're going to do another frame right away anyways. // NOTE(allen): Silence the timer, because we're going to do another frame right away anyways.

View File

@ -453,7 +453,7 @@ buffer_line_y_difference(Application_Links *app, Buffer_ID buffer_id,
i64 line_a, i64 line_b){ i64 line_a, i64 line_b){
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id); Editing_File *file = imp_get_file(models, buffer_id);
f32 result = {}; f32 result = 0.0f;
if (api_check_buffer(file)){ if (api_check_buffer(file)){
Face *face = font_set_face_from_id(&models->font_set, face_id); Face *face = font_set_face_from_id(&models->font_set, face_id);
if (face != 0){ if (face != 0){
@ -521,13 +521,30 @@ buffer_relative_box_of_pos(Application_Links *app, Buffer_ID buffer_id, f32 widt
return(result); return(result);
} }
api(custom) function Rect_f32
buffer_padded_box_of_pos(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos){
Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id);
Rect_f32 result = {};
if (api_check_buffer(file)){
Face *face = font_set_face_from_id(&models->font_set, face_id);
if (face != 0){
Layout_Function *layout_func = file_get_layout_func(file);
result = file_padded_box_of_pos(app->tctx, models, file,
layout_func, width, face,
base_line, pos);
}
}
return(result);
}
api(custom) function i64 api(custom) function i64
buffer_relative_character_from_pos(Application_Links *app, Buffer_ID buffer_id, buffer_relative_character_from_pos(Application_Links *app, Buffer_ID buffer_id,
f32 width, Face_ID face_id, i64 base_line, i64 pos) f32 width, Face_ID face_id, i64 base_line, i64 pos)
{ {
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id); Editing_File *file = imp_get_file(models, buffer_id);
i64 result = {}; i64 result = 0;
if (api_check_buffer(file)){ if (api_check_buffer(file)){
Face *face = font_set_face_from_id(&models->font_set, face_id); Face *face = font_set_face_from_id(&models->font_set, face_id);
if (face != 0){ if (face != 0){
@ -563,7 +580,7 @@ api(custom) function f32
view_line_y_difference(Application_Links *app, View_ID view_id, i64 line_a, i64 line_b){ view_line_y_difference(Application_Links *app, View_ID view_id, i64 line_a, i64 line_b){
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id); View *view = imp_get_view(models, view_id);
f32 result = {}; f32 result = 0.0f;
if (api_check_view(view)){ if (api_check_view(view)){
result = view_line_y_difference(app->tctx, models, view, line_a, line_b); result = view_line_y_difference(app->tctx, models, view, line_a, line_b);
} }
@ -603,11 +620,22 @@ view_relative_box_of_pos(Application_Links *app, View_ID view_id, i64 base_line,
return(result); return(result);
} }
api(custom) function Rect_f32
view_padded_box_of_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){
Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id);
Rect_f32 result = {};
if (api_check_view(view)){
result = view_padded_box_of_pos(app->tctx, models, view, base_line, pos);
}
return(result);
}
api(custom) function i64 api(custom) function i64
view_relative_character_from_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){ view_relative_character_from_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id); View *view = imp_get_view(models, view_id);
i64 result = {}; i64 result = 0;
if (api_check_view(view)){ if (api_check_view(view)){
result = view_relative_character_from_pos(app->tctx, models, view, base_line, pos); result = view_relative_character_from_pos(app->tctx, models, view, base_line, pos);
} }
@ -618,7 +646,7 @@ api(custom) function i64
view_pos_from_relative_character(Application_Links *app, View_ID view_id, i64 base_line, i64 character){ view_pos_from_relative_character(Application_Links *app, View_ID view_id, i64 base_line, i64 character){
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id); View *view = imp_get_view(models, view_id);
i64 result = {}; i64 result = 0;
if (api_check_view(view)){ if (api_check_view(view)){
result = view_pos_from_relative_character(app->tctx, models, view, base_line, character); result = view_pos_from_relative_character(app->tctx, models, view, base_line, character);
} }
@ -702,7 +730,7 @@ api(custom) function Dirty_State
buffer_get_dirty_state(Application_Links *app, Buffer_ID buffer_id){ buffer_get_dirty_state(Application_Links *app, Buffer_ID buffer_id){
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id); Editing_File *file = imp_get_file(models, buffer_id);
Dirty_State result = {}; Dirty_State result = 0;
if (api_check_buffer(file)){ if (api_check_buffer(file)){
result = file->state.dirty; result = file->state.dirty;
} }
@ -771,6 +799,11 @@ buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_I
*value_out = file->settings.unimportant; *value_out = file->settings.unimportant;
}break; }break;
case BufferSetting_Unkillable:
{
*value_out = (file->settings.never_kill || file->settings.unkillable);
}break;
case BufferSetting_ReadOnly: case BufferSetting_ReadOnly:
{ {
*value_out = file->settings.read_only; *value_out = file->settings.read_only;
@ -809,14 +842,14 @@ buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_I
} }
}break; }break;
case BufferSetting_Unkillable:
{
file->settings.unkillable = (value != 0);
}break;
case BufferSetting_ReadOnly: case BufferSetting_ReadOnly:
{ {
if (value){ file->settings.read_only = (value != 0);
file->settings.read_only = true;
}
else{
file->settings.read_only = false;
}
}break; }break;
case BufferSetting_RecordsHistory: case BufferSetting_RecordsHistory:
@ -915,7 +948,7 @@ buffer_kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags)
Editing_File *file = imp_get_file(models, buffer_id); Editing_File *file = imp_get_file(models, buffer_id);
Buffer_Kill_Result result = BufferKillResult_DoesNotExist; Buffer_Kill_Result result = BufferKillResult_DoesNotExist;
if (api_check_buffer(file)){ if (api_check_buffer(file)){
if (!file->settings.never_kill){ if (!file->settings.never_kill && !file->settings.unkillable){
b32 needs_to_save = file_needs_save(file); b32 needs_to_save = file_needs_save(file);
if (!needs_to_save || (flags & BufferKill_AlwaysKill) != 0){ if (!needs_to_save || (flags & BufferKill_AlwaysKill) != 0){
Thread_Context *tctx = app->tctx; Thread_Context *tctx = app->tctx;
@ -1080,7 +1113,7 @@ get_view_prev__inner(Layout *layout, View *view){
} }
} }
else{ else{
Panel *panel = layout_get_first_open_panel(layout); Panel *panel = layout_get_last_open_panel(layout);
view = panel->view; view = panel->view;
} }
return(view); return(view);
@ -1678,23 +1711,6 @@ view_set_buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Se
return(result); return(result);
} }
// TODO(allen): remove this!
api(custom) function b32
view_post_fade(Application_Links *app, View_ID view_id, f32 seconds, Range_i64 range,
ARGB_Color color){
Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id);
b32 result = false;
if (api_check_view(view)){
i64 size = range_size(range);
if (size > 0){
view_post_paste_effect(view, seconds, (i32)range.start, (i32)size, color);
result = true;
}
}
return(result);
}
api(custom) function b32 api(custom) function b32
view_push_context(Application_Links *app, View_ID view_id, View_Context *ctx){ view_push_context(Application_Links *app, View_ID view_id, View_Context *ctx){
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
@ -2733,6 +2749,13 @@ send_exit_signal(Application_Links *app)
models->keep_playing = false; models->keep_playing = false;
} }
api(custom) function void
hard_exit(Application_Links *app)
{
Models *models = (Models*)app->cmd_context;
models->hard_exit = true;
}
api(custom) function void api(custom) function void
set_window_title(Application_Links *app, String_Const_u8 title) set_window_title(Application_Links *app, String_Const_u8 title)
{ {
@ -2796,7 +2819,7 @@ api(custom) function Text_Layout_ID
text_layout_create(Application_Links *app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point){ text_layout_create(Application_Links *app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point){
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id); Editing_File *file = imp_get_file(models, buffer_id);
Text_Layout_ID result = {}; Text_Layout_ID result = 0;
if (api_check_buffer(file)){ if (api_check_buffer(file)){
Thread_Context *tctx = app->tctx; Thread_Context *tctx = app->tctx;
Scratch_Block scratch(tctx); Scratch_Block scratch(tctx);
@ -2994,6 +3017,28 @@ paint_text_color(Application_Links *app, Text_Layout_ID layout_id, Range_i64 ran
} }
} }
api(custom) function void
paint_text_color_blend(Application_Links *app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color, f32 blend){
Models *models = (Models*)app->cmd_context;
Rect_f32 result = {};
Text_Layout *layout = text_layout_get(&models->text_layouts, layout_id);
if (layout != 0){
range.min = clamp_bot(layout->visible_range.min, range.min);
range.max = clamp_top(range.max, layout->visible_range.max);
range.min -= layout->visible_range.min;
range.max -= layout->visible_range.min;
Vec4_f32 color_v4f32 = unpack_color(color);
Vec4_f32 color_pm_v4f32 = color_v4f32*blend;
f32 neg_blend = 1.f - blend;
ARGB_Color *color_ptr = layout->item_colors + range.min;
for (i64 i = range.min; i < range.max; i += 1, color_ptr += 1){
Vec4_f32 color_ptr_v4f32 = unpack_color(*color_ptr);
Vec4_f32 blended_v4f32 = color_ptr_v4f32*neg_blend + color_pm_v4f32;
*color_ptr = pack_color(blended_v4f32);
}
}
}
api(custom) function b32 api(custom) function b32
text_layout_free(Application_Links *app, Text_Layout_ID text_layout_id){ text_layout_free(Application_Links *app, Text_Layout_ID text_layout_id){
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;

View File

@ -105,7 +105,8 @@ struct Models{
Hot_Directory hot_directory; Hot_Directory hot_directory;
b32 keep_playing; b8 keep_playing;
b8 hard_exit;
b32 has_new_title; b32 has_new_title;
char *title_space; char *title_space;

View File

@ -646,53 +646,6 @@ buffer_remeasure_starts(Thread_Context *tctx, Gap_Buffer *buffer, Batch_Edit *ba
} }
} }
#if 0
internal void
buffer_remeasure_starts(Arena *scratch, Gap_Buffer *buffer,
Range_i64 old_line_indexes, i64 line_shift, i64 text_shift){
Temp_Memory temp = begin_temp(scratch);
buffer_starts__ensure_max_size(buffer, buffer->line_start_count + line_shift);
i64 new_line_indexes_opl = old_line_indexes.one_past_last + line_shift;
i64 old_line_start_count = buffer->line_start_count;
i64 *line_start_ptr = buffer->line_starts + old_line_indexes.one_past_last;
for (i64 i = old_line_indexes.one_past_last;
i < old_line_start_count;
i += 1, line_start_ptr += 1){
*line_start_ptr += text_shift;
}
block_copy_dynamic_array(buffer->line_starts + new_line_indexes_opl,
buffer->line_starts + old_line_indexes.one_past_last,
buffer->line_start_count - old_line_indexes.one_past_last);
i64 first_pos = buffer->line_starts[old_line_indexes.first];
i64 write_counter = old_line_indexes.first + 1;
i64 pos = first_pos;
List_String_Const_u8 list = buffer_get_chunks(scratch, buffer);
buffer_chunks_clamp(&list, Ii64(first_pos, buffer_size(buffer)));
for (Node_String_Const_u8 *node = list.first;
node != 0;
node = node->next){
u8 *byte = node->string.str;
u8 *byte_opl = byte + node->string.size;
for (;byte < byte_opl; byte += 1){
pos += 1;
if (*byte == '\n'){
buffer->line_starts[write_counter] = pos;
write_counter += 1;
if (write_counter == new_line_indexes_opl){
goto double_break;
}
}
}
}
double_break:;
buffer->line_start_count += line_shift;
end_temp(temp);
}
#endif
internal Range_i64 internal Range_i64
buffer_get_pos_range_from_line_number(Gap_Buffer *buffer, i64 line_number){ buffer_get_pos_range_from_line_number(Gap_Buffer *buffer, i64 line_number){
Range_i64 result = {}; Range_i64 result = {};
@ -705,7 +658,7 @@ buffer_get_pos_range_from_line_number(Gap_Buffer *buffer, i64 line_number){
internal i64 internal i64
buffer_get_first_pos_from_line_number(Gap_Buffer *buffer, i64 line_number){ buffer_get_first_pos_from_line_number(Gap_Buffer *buffer, i64 line_number){
i64 result = {}; i64 result = 0;
if (line_number < 1){ if (line_number < 1){
result = 0; result = 0;
} }
@ -720,7 +673,7 @@ buffer_get_first_pos_from_line_number(Gap_Buffer *buffer, i64 line_number){
internal i64 internal i64
buffer_get_last_pos_from_line_number(Gap_Buffer *buffer, i64 line_number){ buffer_get_last_pos_from_line_number(Gap_Buffer *buffer, i64 line_number){
i64 result = {}; i64 result = 0;
if (line_number < 1){ if (line_number < 1){
result = 0; result = 0;
} }

View File

@ -90,8 +90,7 @@ edit_fix_markers__compute_scroll_y(i32 line_height, i32 old_y_val, f32 new_y_val
} }
function void function void
edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file, edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file, Batch_Edit *batch){
Batch_Edit *batch){
Layout *layout = &models->layout; Layout *layout = &models->layout;
Lifetime_Object *file_lifetime_object = file->lifetime_object; Lifetime_Object *file_lifetime_object = file->lifetime_object;
@ -135,7 +134,10 @@ edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file,
File_Edit_Positions edit_pos = view_get_edit_pos(view); File_Edit_Positions edit_pos = view_get_edit_pos(view);
write_cursor_with_index(cursors, &cursor_count, (i32)edit_pos.cursor_pos); write_cursor_with_index(cursors, &cursor_count, (i32)edit_pos.cursor_pos);
write_cursor_with_index(cursors, &cursor_count, (i32)view->mark); write_cursor_with_index(cursors, &cursor_count, (i32)view->mark);
// TODO(allen): write a cursor for the current scroll line Buffer_Cursor pos_cursor = file_compute_cursor(file, seek_line_col(edit_pos.scroll.position.line_number, 1));
Buffer_Cursor targ_cursor = file_compute_cursor(file, seek_line_col(edit_pos.scroll.target.line_number, 1));
write_cursor_with_index(cursors, &cursor_count, pos_cursor.pos);
write_cursor_with_index(cursors, &cursor_count, targ_cursor.pos);
} }
} }
@ -156,6 +158,8 @@ edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file,
} }
} }
buffer_remeasure_starts(tctx, &file->state.buffer, batch);
if (cursor_count > 0 || r_cursor_count > 0){ if (cursor_count > 0 || r_cursor_count > 0){
buffer_sort_cursors( cursors, cursor_count); buffer_sort_cursors( cursors, cursor_count);
buffer_sort_cursors(r_cursors, r_cursor_count); buffer_sort_cursors(r_cursors, r_cursor_count);
@ -178,8 +182,15 @@ edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file,
i64 cursor_pos = cursors[cursor_count++].pos; i64 cursor_pos = cursors[cursor_count++].pos;
view->mark = cursors[cursor_count++].pos; view->mark = cursors[cursor_count++].pos;
File_Edit_Positions edit_pos = view_get_edit_pos(view); File_Edit_Positions edit_pos = view_get_edit_pos(view);
i64 scroll_pos = cursors[cursor_count++].pos;
i64 scroll_targ = cursors[cursor_count++].pos;
Buffer_Cursor pos_cursor = file_compute_cursor(file, seek_pos(scroll_pos));
Buffer_Cursor targ_cursor = file_compute_cursor(file, seek_pos(scroll_targ));
edit_pos.scroll.position.line_number = pos_cursor.line;
edit_pos.scroll.target.line_number = targ_cursor.line;
view_set_cursor_and_scroll(tctx, models, view, cursor_pos, edit_pos.scroll); view_set_cursor_and_scroll(tctx, models, view, cursor_pos, edit_pos.scroll);
// TODO(allen): read a cursor for the current scroll line
} }
} }
@ -254,7 +265,6 @@ edit_single(Thread_Context *tctx, Models *models, Editing_File *file,
batch.edit.text = string; batch.edit.text = string;
batch.edit.range = range; batch.edit.range = range;
buffer_remeasure_starts(tctx, &file->state.buffer, &batch);
edit_fix_markers(tctx, models, file, &batch); edit_fix_markers(tctx, models, file, &batch);
post_edit_call_hook(tctx, models, file, post_edit_call_hook(tctx, models, file,
Ii64_size(range.first, string.size), range_size(range)); Ii64_size(range.first, string.size), range_size(range));
@ -489,7 +499,6 @@ edit_batch(Thread_Context *tctx, Models *models, Editing_File *file,
file_clear_layout_cache(file); file_clear_layout_cache(file);
buffer_remeasure_starts(tctx, buffer, batch);
edit_fix_markers(tctx, models, file, batch); edit_fix_markers(tctx, models, file, batch);
post_edit_call_hook(tctx, models, file, new_range, range_size(old_range)); post_edit_call_hook(tctx, models, file, new_range, range_size(old_range));

View File

@ -440,6 +440,21 @@ file_relative_xy_of_pos(Thread_Context *tctx, Models *models, Editing_File *file
return(rect_center(rect)); return(rect_center(rect));
} }
function Rect_f32
file_padded_box_of_pos(Thread_Context *tctx, Models *models, Editing_File *file,
Layout_Function *layout_func, f32 width, Face *face,
i64 base_line, i64 pos){
i64 line_number = buffer_get_line_index(&file->state.buffer, pos) + 1;
Layout_Item_List line = file_get_line_layout(tctx, models, file, layout_func, width, face, line_number);
Rect_f32 result = layout_padded_box_of_pos(line, pos);
f32 y_difference = file_line_y_difference(tctx, models, file, layout_func, width, face, line_number, base_line);
result.y0 += y_difference;
result.y1 += y_difference;
return(result);
}
internal Buffer_Point internal Buffer_Point
file_normalize_buffer_point(Thread_Context *tctx, Models *models, Editing_File *file, file_normalize_buffer_point(Thread_Context *tctx, Models *models, Editing_File *file,
Layout_Function *layout_func, f32 width, Face *face, Layout_Function *layout_func, f32 width, Face *face,

View File

@ -24,15 +24,6 @@ struct File_Edit_Positions{
i64 cursor_pos; i64 cursor_pos;
}; };
// TODO(allen): do(replace Text_Effect with IM rendering over time)
struct Text_Effect{
i64 start;
i64 end;
u32 color;
f32 seconds_down;
f32 seconds_max;
};
struct Editing_File_Settings{ struct Editing_File_Settings{
Layout_Function *layout_func; Layout_Function *layout_func;
Face_ID face_id; Face_ID face_id;
@ -40,6 +31,7 @@ struct Editing_File_Settings{
b8 is_initialized; b8 is_initialized;
b8 unimportant; b8 unimportant;
b8 read_only; b8 read_only;
b8 unkillable;
b8 never_kill; b8 never_kill;
}; };
@ -62,8 +54,6 @@ struct Editing_File_State{
History history; History history;
i32 current_record_index; i32 current_record_index;
Text_Effect paste_effect;
Dirty_State dirty; Dirty_State dirty;
File_Save_State save_state; File_Save_State save_state;

View File

@ -314,6 +314,7 @@ history__optimize_group(Arena *scratch, History *history, Record *record){
String_Const_u8 merged_forward = {}; String_Const_u8 merged_forward = {};
String_Const_u8 merged_backward = {}; String_Const_u8 merged_backward = {};
i64 merged_first = 0;
if (left->single.first + (i64)left->single.forward_text.size == right->single.first){ if (left->single.first + (i64)left->single.forward_text.size == right->single.first){
do_merge = true; do_merge = true;
merged_forward = push_u8_stringf(scratch, "%.*s%.*s", merged_forward = push_u8_stringf(scratch, "%.*s%.*s",
@ -322,6 +323,7 @@ history__optimize_group(Arena *scratch, History *history, Record *record){
merged_backward = push_u8_stringf(scratch, "%.*s%.*s", merged_backward = push_u8_stringf(scratch, "%.*s%.*s",
string_expand(left->single.backward_text), string_expand(left->single.backward_text),
string_expand(right->single.backward_text)); string_expand(right->single.backward_text));
merged_first = left->single.first;
} }
else if (right->single.first + (i64)right->single.backward_text.size == left->single.first){ else if (right->single.first + (i64)right->single.backward_text.size == left->single.first){
do_merge = true; do_merge = true;
@ -331,6 +333,7 @@ history__optimize_group(Arena *scratch, History *history, Record *record){
merged_backward = push_u8_stringf(scratch, "%.*s%.*s", merged_backward = push_u8_stringf(scratch, "%.*s%.*s",
string_expand(right->single.backward_text), string_expand(right->single.backward_text),
string_expand(left->single.backward_text)); string_expand(left->single.backward_text));
merged_first = right->single.first;
} }
else{ else{
break; break;
@ -340,6 +343,7 @@ history__optimize_group(Arena *scratch, History *history, Record *record){
end_temp(left->restore_point); end_temp(left->restore_point);
left->edit_number = right->edit_number; left->edit_number = right->edit_number;
left->single.first = merged_first;
left->single.forward_text = push_string_copy(history->arena, merged_forward); left->single.forward_text = push_string_copy(history->arena, merged_forward);
left->single.backward_text = push_string_copy(history->arena, merged_backward); left->single.backward_text = push_string_copy(history->arena, merged_backward);

View File

@ -123,6 +123,16 @@ layout_get_first_open_panel(Layout *layout){
return(panel); return(panel);
} }
internal Panel*
layout_get_last_open_panel(Layout *layout){
Panel *panel = CastFromMember(Panel, node, layout->open_panels.prev);
if (panel != 0 && &panel->node == &layout->open_panels){
panel = 0;
}
AssertImplies(panel != 0, panel->kind == PanelKind_Final);
return(panel);
}
internal Panel* internal Panel*
layout_get_next_open_panel(Layout *layout, Panel *panel){ layout_get_next_open_panel(Layout *layout, Panel *panel){
panel = CastFromMember(Panel, node, panel->node.next); panel = CastFromMember(Panel, node, panel->node.next);
@ -289,7 +299,7 @@ layout_initialize(Arena *arena, Layout *layout){
Panel *panel = panels; Panel *panel = panels;
layout->free_panels.next = &panel->node; layout->free_panels.next = &panel->node;
panel->node.prev = &layout->free_panels; panel->node.prev = &layout->free_panels;
for (i32 i = 1; i < MAX_VIEWS; i += 1, panel += 1){ for (i32 i = 1; i < panel_alloc_count; i += 1, panel += 1){
panel[1].node.prev = &panel[0].node; panel[1].node.prev = &panel[0].node;
panel[0].node.next = &panel[1].node; panel[0].node.next = &panel[1].node;
} }

View File

@ -125,7 +125,7 @@ find_all_matches_forward(Arena *arena, i32 maximum_output_count,
jump_back_0: jump_back_0:
if (n + 1 == needle.size){ if (n + 1 == needle.size){
String_Match_Flag flags = {}; String_Match_Flag flags = 0;
if (!(last_insensitive >= 0 && if (!(last_insensitive >= 0 &&
j <= (u64)last_insensitive && j <= (u64)last_insensitive &&
(u64)last_insensitive < j + needle.size)){ (u64)last_insensitive < j + needle.size)){
@ -245,7 +245,7 @@ find_all_matches_backward(Arena *arena, i32 maximum_output_count,
jump_back_0: jump_back_0:
if (n + 1 == needle.size){ if (n + 1 == needle.size){
String_Match_Flag flags = {}; String_Match_Flag flags = 0;
if (!(last_insensitive < size && if (!(last_insensitive < size &&
j >= last_insensitive && j >= last_insensitive &&
last_insensitive > j - (i64)needle.size)){ last_insensitive > j - (i64)needle.size)){

View File

@ -234,6 +234,17 @@ view_relative_xy_of_pos(Thread_Context *tctx, Models *models, View *view,
return(rect_center(rect)); return(rect_center(rect));
} }
function Rect_f32
view_padded_box_of_pos(Thread_Context *tctx, Models *models, View *view,
i64 base_line, i64 pos){
Editing_File *file = view->file;
Face *face = file_get_face(models, file);
f32 width = view_width(tctx, models, view);
Layout_Function *layout_func = file_get_layout_func(file);
return(file_padded_box_of_pos(tctx, models, file,
layout_func, width, face, base_line, pos));
}
internal Buffer_Point internal Buffer_Point
view_normalize_buffer_point(Thread_Context *tctx, Models *models, View *view, view_normalize_buffer_point(Thread_Context *tctx, Models *models, View *view,
Buffer_Point point){ Buffer_Point point){
@ -430,16 +441,6 @@ view_set_cursor_and_scroll(Thread_Context *tctx, Models *models, View *view, i64
view_set_edit_pos(view, edit_pos); view_set_edit_pos(view, edit_pos);
} }
internal void
view_post_paste_effect(View *view, f32 seconds, i64 start, i64 size, ARGB_Color color){
Editing_File *file = view->file;
file->state.paste_effect.start = start;
file->state.paste_effect.end = start + size;
file->state.paste_effect.color = color;
file->state.paste_effect.seconds_down = seconds;
file->state.paste_effect.seconds_max = seconds;
}
//////////////////////////////// ////////////////////////////////
internal void internal void
@ -518,7 +519,7 @@ co_handle_request(Models *models, Coroutine *co, Co_Out *out){
Face_Description *description = out->face_description; Face_Description *description = out->face_description;
Face *face = font_set_new_face(&models->font_set, description); Face *face = font_set_new_face(&models->font_set, description);
Co_In in = {}; Co_In in = {};
in.face_id = face->id; in.face_id = (face != 0)?face->id:0;
result = coroutine_run(&models->coroutines, co, &in, out); result = coroutine_run(&models->coroutines, co, &in, out);
}break; }break;

View File

@ -21,7 +21,8 @@ file_change_notification_check(Arena *scratch, Working_Set *working_set, Editing
if (file->canon.name_size > 0 && !file->settings.unimportant){ if (file->canon.name_size > 0 && !file->settings.unimportant){
String_Const_u8 name = SCu8(file->canon.name_space, file->canon.name_size); String_Const_u8 name = SCu8(file->canon.name_space, file->canon.name_size);
File_Attributes attributes = system_quick_file_attributes(scratch, name); File_Attributes attributes = system_quick_file_attributes(scratch, name);
if (attributes.last_write_time > file->attributes.last_write_time){ if ((attributes.last_write_time > file->attributes.last_write_time) ||
(attributes.last_write_time == 0 && file->attributes.last_write_time > 0)){
if (file->state.save_state == FileSaveState_SavedWaitingForNotification){ if (file->state.save_state == FileSaveState_SavedWaitingForNotification){
file->state.save_state = FileSaveState_Normal; file->state.save_state = FileSaveState_Normal;
file->attributes = attributes; file->attributes = attributes;

View File

@ -43,6 +43,7 @@ char *platform_names[] = {
enum{ enum{
Compiler_CL, Compiler_CL,
Compiler_GCC, Compiler_GCC,
Compiler_Clang,
// //
Compiler_COUNT, Compiler_COUNT,
Compiler_None = Compiler_COUNT, Compiler_None = Compiler_COUNT,
@ -51,6 +52,7 @@ enum{
char *compiler_names[] = { char *compiler_names[] = {
"cl", "cl",
"gcc", "gcc",
"clang",
}; };
#if OS_WINDOWS #if OS_WINDOWS
@ -67,6 +69,8 @@ char *compiler_names[] = {
# define This_Compiler Compiler_CL # define This_Compiler Compiler_CL
#elif COMPILER_GCC #elif COMPILER_GCC
# define This_Compiler Compiler_GCC # define This_Compiler Compiler_GCC
#elif COMPILER_CLANG
# define This_Compiler Compiler_Clang
#else #else
# error This compilers is not enumerated. # error This compilers is not enumerated.
#endif #endif
@ -90,7 +94,7 @@ char *includes[] = { "custom", FOREIGN "/freetype2", 0, };
char *windows_platform_layer[] = { "platform_win32/win32_4ed.cpp", 0 }; char *windows_platform_layer[] = { "platform_win32/win32_4ed.cpp", 0 };
char *linux_platform_layer[] = { "platform_linux/linux_4ed.cpp", 0 }; char *linux_platform_layer[] = { "platform_linux/linux_4ed.cpp", 0 };
char *mac_platform_layer[] = { "platform_mac/mac_4ed.m", "platform_mac/mac_4ed.cpp", 0 }; char *mac_platform_layer[] = { "platform_mac/mac_4ed.mm", 0 };
char **platform_layers[Platform_COUNT] = { char **platform_layers[Platform_COUNT] = {
windows_platform_layer, windows_platform_layer,
@ -100,12 +104,13 @@ char **platform_layers[Platform_COUNT] = {
char *windows_cl_platform_inc[] = { "platform_all", 0 }; char *windows_cl_platform_inc[] = { "platform_all", 0 };
char *linux_gcc_platform_inc[] = { "platform_all", "platform_unix", 0 }; char *linux_gcc_platform_inc[] = { "platform_all", "platform_unix", 0 };
char *mac_gcc_platform_inc[] = { "platform_all", "platform_unix", 0 };
char *mac_clang_platform_inc[] = { "platform_all", "platform_unix", 0 };
char **platform_includes[Platform_COUNT][Compiler_COUNT] = { char **platform_includes[Platform_COUNT][Compiler_COUNT] = {
{windows_cl_platform_inc, 0 }, {windows_cl_platform_inc, 0 , 0},
{0 , linux_gcc_platform_inc}, {0 , linux_gcc_platform_inc, 0},
{0 , mac_gcc_platform_inc }, {0 , 0 , mac_clang_platform_inc},
}; };
char *default_custom_target = "../code/custom/4coder_default_bindings.cpp"; char *default_custom_target = "../code/custom/4coder_default_bindings.cpp";
@ -298,25 +303,6 @@ build(Arena *arena, u32 flags, u32 arch, char *code_path, char **code_files, cha
#define GCC_LIBS_X64 GCC_LIBS_COMMON #define GCC_LIBS_X64 GCC_LIBS_COMMON
#define GCC_LIBS_X86 GCC_LIBS_COMMON #define GCC_LIBS_X86 GCC_LIBS_COMMON
#elif OS_MAC
# define GCC_OPTS \
"-Wno-write-strings -Wno-deprecated-declarations " \
"-Wno-comment -Wno-switch -Wno-null-dereference " \
"-Wno-tautological-compare " \
"-Wno-unused-result "
#define GCC_LIBS_COMMON \
"-framework Cocoa -framework QuartzCore " \
"-framework CoreServices " \
"-framework OpenGL -framework IOKit "
#define GCC_LIBS_X64 GCC_LIBS_COMMON \
FOREIGN "/x64/libfreetype-mac.a"
#define GCC_LIBS_X86 GCC_LIBS_COMMON \
FOREIGN "/x86/libfreetype-mac.a"
#else #else
# error gcc options not set for this platform # error gcc options not set for this platform
#endif #endif
@ -391,6 +377,104 @@ build(Arena *arena, u32 flags, u32 arch, char *code_path, char **code_files, cha
fm_popdir(temp); fm_popdir(temp);
} }
#elif COMPILER_CLANG
#if OS_MAC
# define CLANG_OPTS \
"-Wno-write-strings -Wno-deprecated-declarations " \
"-Wno-comment -Wno-switch -Wno-null-dereference " \
"-Wno-tautological-compare -Wno-unused-result " \
"-Wno-missing-declarations -Wno-nullability-completeness " \
"-std=c++11 "
#define CLANG_LIBS_COMMON \
"-framework Cocoa -framework QuartzCore " \
"-framework CoreServices " \
"-framework OpenGL -framework IOKit -framework Metal -framework MetalKit "
#define CLANG_LIBS_X64 CLANG_LIBS_COMMON \
FOREIGN "/x64/libfreetype-mac.a"
#define CLANG_LIBS_X86 CLANG_LIBS_COMMON \
FOREIGN "/x86/libfreetype-mac.a"
#else
# error clang options not set for this platform
#endif
internal void
build(Arena *arena, u32 flags, u32 arch, char *code_path, char **code_files, char *out_path, char *out_file, char **defines, char **exports, char **inc_folders){
Build_Line line;
fm_init_build_line(&line);
switch (arch){
case Arch_X64:
fm_add_to_line(line, "-m64");
fm_add_to_line(line, "-DFTECH_64_BIT"); break;
case Arch_X86:
fm_add_to_line(line, "-m32");
fm_add_to_line(line, "-DFTECH_32_BIT"); break;
default: InvalidPath;
}
if (flags & OPTS){
fm_add_to_line(line, CLANG_OPTS);
}
fm_add_to_line(line, "-I%s", code_path);
if (inc_folders != 0){
for (u32 i = 0; inc_folders[i] != 0; ++i){
char *str = fm_str(arena, code_path, "/", inc_folders[i]);
fm_add_to_line(line, "-I%s", str);
}
}
if (flags & DEBUG_INFO){
fm_add_to_line(line, "-g -O0");
}
if (flags & OPTIMIZATION){
fm_add_to_line(line, "-O3");
}
if (flags & SHARED_CODE){
fm_add_to_line(line, "-shared");
}
if (defines != 0){
for (u32 i = 0; defines[i]; ++i){
char *define_flag = fm_str(arena, "-D", defines[i]);
fm_add_to_line(line, "%s", define_flag);
}
}
fm_add_to_line(line, "-I\"%s\"", code_path);
for (u32 i = 0; code_files[i] != 0; ++i){
fm_add_to_line(line, "\"%s/%s\"", code_path, code_files[i]);
}
if (flags & LIBS){
if (arch == Arch_X64){
fm_add_to_line(line, CLANG_LIBS_X64);
}
else if (arch == Arch_X86)
{
fm_add_to_line(line, CLANG_LIBS_X86);
}
}
fm_finish_build_line(&line);
Temp_Dir temp = fm_pushdir(out_path);
// systemf("clang++ %s -E -o %s", line.build_options, "4ed.i");
systemf("clang++ %s -o %s", line.build_options, out_file);
fm_popdir(temp);
}
#else #else
# error build function not defined for this compiler # error build function not defined for this compiler
#endif #endif
@ -427,7 +511,11 @@ buildsuper(Arena *arena, char *cdir, char *file, u32 arch){
BEGIN_TIME_SECTION(); BEGIN_TIME_SECTION();
Temp_Dir temp = fm_pushdir(fm_str(arena, BUILD_DIR)); Temp_Dir temp = fm_pushdir(fm_str(arena, BUILD_DIR));
char *build_script = fm_str(arena, "custom/bin/buildsuper_", arch_names[arch], BAT); char *build_script_postfix = "";
if (This_OS == Platform_Mac){
build_script_postfix = "-mac";
}
char *build_script = fm_str(arena, "custom/bin/buildsuper_", arch_names[arch], build_script_postfix, BAT);
char *build_command = fm_str(arena, "\"", cdir, "/", build_script, "\" \"", file, "\""); char *build_command = fm_str(arena, "\"", cdir, "/", build_script, "\" \"", file, "\"");
if (This_OS == Platform_Windows){ if (This_OS == Platform_Windows){
@ -499,6 +587,54 @@ enum{
Tier_COUNT, Tier_COUNT,
}; };
function void
package_for_arch(Arena *arena, u32 arch, char *cdir, char *build_dir, char *pack_dir, i32 tier, char *tier_name, char *current_dist_tier, u32 flags, char** dist_files, i32 dist_file_count){
char *arch_name = arch_names[arch];
char *parent_dir = fm_str(arena, current_dist_tier, "_", arch_name);
char *dir = fm_str(arena, parent_dir, SLASH "4coder");
char *zip_dir = fm_str(arena, pack_dir, SLASH, tier_name, "_", arch_name);
printf("\nbuild: %s_%s\n", tier_name, arch_name);
printf("parent_dir: %s\n", parent_dir);
printf("dir: %s\n", dir);
printf("zip_dir: %s\n", zip_dir);
fflush(stdout);
buildsuper(arena, cdir, fm_str(arena, default_custom_target), arch);
build_main(arena, cdir, false, flags, arch);
fm_clear_folder(parent_dir);
fm_make_folder_if_missing(arena, parent_dir);
fm_make_folder_if_missing(arena, dir);
fm_copy_file(fm_str(arena, build_dir, "/4ed" EXE), fm_str(arena, dir, "/4ed" EXE));
fm_copy_file(fm_str(arena, build_dir, "/4ed_app" DLL), fm_str(arena, dir, "/4ed_app" DLL));
fm_copy_file(fm_str(arena, build_dir, "/custom_4coder" DLL), fm_str(arena, dir, "/custom_4coder" DLL));
if (tier == Tier_Demo){
dist_file_count -= 1;
}
for (i32 j = 0; j < dist_file_count; j += 1){
fm_copy_all(dist_files[j], dir);
}
if (tier == Tier_Super){
char *custom_src_dir = fm_str(arena, cdir, SLASH, "custom");
char *custom_dst_dir = fm_str(arena, dir, SLASH, "custom");
// HACK(yuval): make_folder_if_missing seems to cause a second custom folder to be created inside the custom folder on macOS.
//if (This_OS != Platform_Mac){
fm_make_folder_if_missing(arena, custom_dst_dir);
//}
fm_copy_all(custom_src_dir, custom_dst_dir);
}
char *dist_name = get_4coder_dist_name(arena, This_OS, tier_name, arch);
char *zip_name = fm_str(arena, zip_dir, SLASH, dist_name, ".zip");
fm_make_folder_if_missing(arena, zip_dir);
fm_zip(parent_dir, "4coder", zip_name);
}
internal void internal void
package(Arena *arena, char *cdir){ package(Arena *arena, char *cdir){
// NOTE(allen): meta // NOTE(allen): meta
@ -527,48 +663,17 @@ package(Arena *arena, char *cdir){
Temp_Memory temp = begin_temp(arena); Temp_Memory temp = begin_temp(arena);
char *current_dist_tier = fm_str(arena, ".." SLASH "current_dist_", tier_name); char *current_dist_tier = fm_str(arena, ".." SLASH "current_dist_", tier_name);
for (u32 arch = 0; arch < Arch_COUNT; ++arch){ u32 arch_count = Arch_COUNT;
char *arch_name = arch_names[arch]; u32 arch_array[2] = {
char *parent_dir = fm_str(arena, current_dist_tier, "_", arch_name); Arch_X64,
char *dir = fm_str(arena, parent_dir, SLASH "4coder"); Arch_X86,
char *zip_dir = fm_str(arena, pack_dir, SLASH, tier_name, "_", arch_name); };
if (This_OS == Platform_Mac){
printf("\nbuild: %s_%s\n", tier_name, arch_name); arch_count = 1;
printf("parent_dir: %s\n", parent_dir);
printf("dir: %s\n", dir);
printf("zip_dir: %s\n", zip_dir);
fflush(stdout);
buildsuper(arena, cdir, fm_str(arena, default_custom_target), arch);
build_main(arena, cdir, false, flags, arch);
fm_make_folder_if_missing(arena, parent_dir);
fm_clear_folder(parent_dir);
fm_make_folder_if_missing(arena, dir);
fm_copy_file(fm_str(arena, build_dir, "/4ed" EXE), fm_str(arena, dir, "/4ed" EXE));
fm_copy_file(fm_str(arena, build_dir, "/4ed_app" DLL), fm_str(arena, dir, "/4ed_app" DLL));
fm_copy_file(fm_str(arena, build_dir, "/custom_4coder" DLL), fm_str(arena, dir, "/custom_4coder" DLL));
i32 dist_file_count = ArrayCount(dist_files);
if (i == Tier_Demo){
dist_file_count -= 1;
} }
for (u32 arch_ind = 0; arch_ind < arch_count; arch_ind += 1){
for (i32 j = 0; j < dist_file_count; j += 1){ u32 arch = arch_array[arch_ind];
fm_copy_all(dist_files[j], dir); package_for_arch(arena, arch, cdir, build_dir, pack_dir, i, tier_name, current_dist_tier, flags, dist_files, ArrayCount(dist_files));
}
if (i == Tier_Super){
char *custom_src_dir = fm_str(arena, cdir, SLASH, "custom");
char *custom_dst_dir = fm_str(arena, dir, SLASH, "custom");
fm_make_folder_if_missing(arena, custom_dst_dir);
fm_copy_all(custom_src_dir, custom_dst_dir);
}
char *dist_name = get_4coder_dist_name(arena, This_OS, tier_name, arch);
char *zip_name = fm_str(arena, zip_dir, SLASH, dist_name, ".zip");
fm_make_folder_if_missing(arena, zip_dir);
fm_zip(parent_dir, "4coder", zip_name);
} }
end_temp(temp); end_temp(temp);
@ -596,7 +701,7 @@ int main(int argc, char **argv){
arch = Arch_X86; arch = Arch_X86;
#endif #endif
#if defined(DEV_BUILD) || defined(OPT_BUILD) || defined(DEV_BUILD_X86) #if defined(DEV_BUILD) || defined(OPT_BUILD) || defined(DEV_BUILD_X86) || defined(OPT_BUILD_X86)
standard_build(&arena, cdir, flags, arch); standard_build(&arena, cdir, flags, arch);
#elif defined(PACKAGE) #elif defined(PACKAGE)

43
bin/build-mac.sh Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
# If any command errors, stop the script
set -e
# Set up directories (mirrors build.bat)
# NOTE(yuval): Replaced readlink with realpath which works for both macOS and Linux
ME="$(realpath "$0")"
LOCATION="$(dirname "$ME")"
SRC_ROOT="$(dirname "$LOCATION")"
PROJECT_ROOT="$(dirname "$SRC_ROOT")"
if [ ! -d "$PROJECT_ROOT/build" ]; then
mkdir "$PROJECT_ROOT/build"
fi
BUILD_ROOT="$PROJECT_ROOT/build"
BIN_ROOT="$SRC_ROOT/bin"
CUSTOM_ROOT="$SRC_ROOT/custom"
CUSTOM_BIN="$CUSTOM_ROOT/bin"
# Get the build mode
BUILD_MODE="$1"
if [ -z "$BUILD_MODE" ]; then
BUILD_MODE="-DDEV_BUILD"
fi
# Get the OS specific flags
chmod +rx "$BIN_ROOT/detect_os.sh"
os=$("$BIN_ROOT/detect_os.sh")
if [[ "$os" == "linux" ]]; then
WARNINGS="-Wno-write-strings -Wno-comment"
elif [[ "$os" == "mac" ]]; then
WARNINGS="-Wno-write-strings -Wno-comment -Wno-null-dereference -Wno-logical-op-parentheses -Wno-switch"
fi
FLAGS="-D_GNU_SOURCE -fPIC -fpermissive $BUILD_MODE"
INCLUDES="-I$SRC_ROOT -I$CUSTOM_ROOT"
# Execute
clang++ $WARNINGS $FLAGS $INCLUDES "$BIN_ROOT/4ed_build.cpp" -g -o "$BUILD_ROOT/build"
pushd "$SRC_ROOT"
"$BUILD_ROOT/build"
popd

View File

@ -1,3 +1,3 @@
@echo off @echo off
call build.bat /DOPT_BUILD call bin\build.bat /DOPT_BUILD

5
bin/build_x86-mac.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
./build.sh -DDEV_BUILD_X86

View File

@ -1,7 +1,5 @@
#!/bin/sh #!/bin/sh
#todo rewrite this as a build.cpp script
if [ "$#" -lt "3" ] if [ "$#" -lt "3" ]
then then
echo need 3 parameters echo need 3 parameters

22
bin/itchio_push_mac.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
if [ "$#" -lt "3" ]
then
echo need 3 parameters
exit
else
fake=$1
maj=$2
min=$3
vr=$fake.$maj.$min
fv=$fake-$maj-$min
flags="--fix-permissions --userversion=$vr"
dir=../distributions
butler push $flags $dir/demo_x64/4coder-$fv-demo-mac-x64.zip 4coder/4coder:mac-x64-demo
butler push $flags $dir/super_x64/4coder-$fv-super-mac-x64.zip 4coder/4coder:mac-x64
fi

4
bin/package-mac.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
chmod 777 bin/build-mac.sh
bin/build-mac.sh "-DPACKAGE"

View File

@ -15,7 +15,7 @@ make_batch_from_indentations(Application_Links *app, Arena *arena, Buffer_ID buf
line_number <= lines.max; line_number <= lines.max;
++line_number){ ++line_number){
i64 line_start_pos = get_line_start_pos(app, buffer, line_number); i64 line_start_pos = get_line_start_pos(app, buffer, line_number);
Indent_Info indent_info = get_indent_info_line_start(app, buffer, line_start_pos, tab_width); Indent_Info indent_info = get_indent_info_line_number_and_start(app, buffer, line_number, line_start_pos, tab_width);
i64 correct_indentation = shifted_indentations[line_number]; i64 correct_indentation = shifted_indentations[line_number];
if (indent_info.is_blank && HasFlag(flags, Indent_ClearLine)){ if (indent_info.is_blank && HasFlag(flags, Indent_ClearLine)){
@ -63,6 +63,7 @@ set_line_indents(Application_Links *app, Arena *arena, Buffer_ID buffer, Range_i
internal Token* internal Token*
find_anchor_token(Application_Links *app, Buffer_ID buffer, Token_Array *tokens, i64 invalid_line){ find_anchor_token(Application_Links *app, Buffer_ID buffer, Token_Array *tokens, i64 invalid_line){
ProfileScope(app, "find anchor token");
Token *result = 0; Token *result = 0;
if (tokens != 0 && tokens->tokens != 0){ if (tokens != 0 && tokens->tokens != 0){
@ -146,8 +147,20 @@ indent__unfinished_statement(Token *token, Nest *current_nest){
return(result); return(result);
} }
function void
line_indent_cache_update(Application_Links *app, Buffer_ID buffer, i32 tab_width, Indent_Line_Cache *line_cache){
if (line_cache->line_number_for_cached_indent != line_cache->where_token_starts){
ProfileScope(app, "get indent info");
line_cache->line_number_for_cached_indent = line_cache->where_token_starts;
line_cache->start_pos = get_line_start_pos(app, buffer, line_cache->where_token_starts);
Range_i64 range = Ii64(line_cache->start_pos, line_cache->one_past_last_pos);
line_cache->indent_info = get_indent_info_range(app, buffer, range, tab_width);
}
}
internal i64* internal i64*
get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Range_i64 lines, Indent_Flag flags, i32 tab_width, i32 indent_width){ get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Range_i64 lines, Indent_Flag flags, i32 tab_width, i32 indent_width){
ProfileScope(app, "get indentation array");
i64 count = lines.max - lines.min + 1; i64 count = lines.max - lines.min + 1;
i64 *indentations = push_array(arena, i64, count); i64 *indentations = push_array(arena, i64, count);
i64 *shifted_indentations = indentations - lines.first; i64 *shifted_indentations = indentations - lines.first;
@ -174,11 +187,17 @@ get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Ra
i64 actual_indent = 0; i64 actual_indent = 0;
b32 in_unfinished_statement = false; b32 in_unfinished_statement = false;
Indent_Line_Cache line_cache = {};
for (;;){ for (;;){
Token *token = token_it_read(&token_it); Token *token = token_it_read(&token_it);
i64 line_where_token_starts = get_line_number_from_pos(app, buffer, token->pos);
i64 line_start_pos = get_line_start_pos(app, buffer, line_where_token_starts); if (line_cache.where_token_starts == 0 ||
Indent_Info line_indent_info = get_indent_info_line_start(app, buffer, line_start_pos, tab_width); token->pos >= line_cache.one_past_last_pos){
ProfileScope(app, "get line number");
line_cache.where_token_starts = get_line_number_from_pos(app, buffer, token->pos);
line_cache.one_past_last_pos = get_line_end_pos(app, buffer, line_cache.where_token_starts);
}
i64 current_indent = 0; i64 current_indent = 0;
if (nest != 0){ if (nest != 0){
@ -229,7 +248,8 @@ get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Ra
Nest *new_nest = indent__new_nest(arena, &nest_alloc); Nest *new_nest = indent__new_nest(arena, &nest_alloc);
sll_stack_push(nest, new_nest); sll_stack_push(nest, new_nest);
nest->kind = TokenBaseKind_ParentheticalOpen; nest->kind = TokenBaseKind_ParentheticalOpen;
nest->indent = (token->pos - line_indent_info.first_char_pos) + 1; line_indent_cache_update(app, buffer, tab_width, &line_cache);
nest->indent = (token->pos - line_cache.indent_info.first_char_pos) + 1;
following_indent = nest->indent; following_indent = nest->indent;
shift_by_actual_indent = true; shift_by_actual_indent = true;
}break; }break;
@ -245,7 +265,7 @@ get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Ra
if (nest != 0){ if (nest != 0){
following_indent = nest->indent; following_indent = nest->indent;
} }
ignore_unfinished_statement = true; //ignore_unfinished_statement = true;
}break; }break;
} }
} }
@ -260,26 +280,38 @@ get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Ra
actual_indent = N; ) actual_indent = N; )
i64 line_it = line_last_indented; i64 line_it = line_last_indented;
for (;line_it < line_where_token_starts;){ if (lines.first <= line_cache.where_token_starts){
for (;line_it < line_cache.where_token_starts;){
line_it += 1; line_it += 1;
if (line_it == line_where_token_starts){ if (line_it == line_cache.where_token_starts){
EMIT(this_indent); EMIT(this_indent);
} }
else{ else{
EMIT(last_indent); EMIT(last_indent);
} }
} }
}
else{
actual_indent = this_indent;
line_it = line_cache.where_token_starts;
}
i64 line_where_token_starts_shift = this_indent - line_indent_info.indent_pos;
i64 line_where_token_ends = get_line_number_from_pos(app, buffer, token->pos + token->size); i64 line_where_token_ends = get_line_number_from_pos(app, buffer, token->pos + token->size);
if (lines.first <= line_where_token_ends){
line_indent_cache_update(app, buffer, tab_width, &line_cache);
i64 line_where_token_starts_shift = this_indent - line_cache.indent_info.indent_pos;
for (;line_it < line_where_token_ends;){ for (;line_it < line_where_token_ends;){
line_it += 1; line_it += 1;
i64 line_it_start_pos = get_line_start_pos(app, buffer, line_it); i64 line_it_start_pos = get_line_start_pos(app, buffer, line_it);
Indent_Info line_it_indent_info = get_indent_info_line_start(app, buffer, line_it_start_pos, tab_width); Indent_Info line_it_indent_info = get_indent_info_line_number_and_start(app, buffer, line_it, line_it_start_pos, tab_width);
i64 new_indent = line_it_indent_info.indent_pos + line_where_token_starts_shift; i64 new_indent = line_it_indent_info.indent_pos + line_where_token_starts_shift;
new_indent = clamp_bot(0, new_indent); new_indent = clamp_bot(0, new_indent);
EMIT(new_indent); EMIT(new_indent);
} }
}
else{
line_it = line_where_token_ends;
}
#undef EMIT #undef EMIT
if (shift_by_actual_indent){ if (shift_by_actual_indent){
@ -395,6 +427,7 @@ CUSTOM_DOC("Auto-indents the range between the cursor and the mark.")
CUSTOM_COMMAND_SIG(write_text_and_auto_indent) CUSTOM_COMMAND_SIG(write_text_and_auto_indent)
CUSTOM_DOC("Inserts text and auto-indents the line on which the cursor sits if any of the text contains 'layout punctuation' such as ;:{}()[]# and new lines.") CUSTOM_DOC("Inserts text and auto-indents the line on which the cursor sits if any of the text contains 'layout punctuation' such as ;:{}()[]# and new lines.")
{ {
ProfileScope(app, "write and auto indent");
User_Input in = get_current_input(app); User_Input in = get_current_input(app);
String_Const_u8 insert = to_writable(&in); String_Const_u8 insert = to_writable(&in);
if (insert.str != 0 && insert.size > 0){ if (insert.str != 0 && insert.size > 0){

View File

@ -24,6 +24,14 @@ struct Nest_Alloc{
Nest *free_nest; Nest *free_nest;
}; };
struct Indent_Line_Cache{
i64 where_token_starts;
i64 line_number_for_cached_indent;
i64 start_pos;
i64 one_past_last_pos;
Indent_Info indent_info;
};
#endif #endif
// BOTTOM // BOTTOM

View File

@ -65,7 +65,7 @@ CUSTOM_DOC("Inserts whatever text was used to trigger this command.")
} }
CUSTOM_COMMAND_SIG(write_space) CUSTOM_COMMAND_SIG(write_space)
CUSTOM_DOC("Inserts an underscore.") CUSTOM_DOC("Inserts a space.")
{ {
write_text(app, string_u8_litexpr(" ")); write_text(app, string_u8_litexpr(" "));
} }
@ -112,6 +112,17 @@ CUSTOM_DOC("Deletes the character to the left of the cursor.")
} }
} }
CUSTOM_COMMAND_SIG(test_double_backspace)
CUSTOM_DOC("Made for testing purposes (I should have deleted this if you are reading it let me know)")
{
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
History_Group group = history_group_begin(app, buffer);
backspace_char(app);
backspace_char(app);
history_group_end(group);
}
CUSTOM_COMMAND_SIG(set_mark) CUSTOM_COMMAND_SIG(set_mark)
CUSTOM_DOC("Sets the mark to the current position of the cursor.") CUSTOM_DOC("Sets the mark to the current position of the cursor.")
{ {
@ -281,9 +292,15 @@ move_vertical_pixels(Application_Links *app, View_ID view, f32 pixels){
ProfileScope(app, "move vertical pixels"); ProfileScope(app, "move vertical pixels");
i64 pos = view_get_cursor_pos(app, view); i64 pos = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos)); Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
Vec2_f32 p = view_relative_xy_of_pos(app, view, cursor.line, pos); Rect_f32 r = view_padded_box_of_pos(app, view, cursor.line, pos);
Vec2_f32 p = {};
p.x = view_get_preferred_x(app, view); p.x = view_get_preferred_x(app, view);
p.y += pixels; if (pixels > 0.f){
p.y = r.y1 + pixels;
}
else{
p.y = r.y0 + pixels;
}
i64 new_pos = view_pos_at_relative_xy(app, view, cursor.line, p); i64 new_pos = view_pos_at_relative_xy(app, view, cursor.line, p);
view_set_cursor(app, view, seek_pos(new_pos)); view_set_cursor(app, view, seek_pos(new_pos));
no_mark_snap_to_cursor_if_shift(app, view); no_mark_snap_to_cursor_if_shift(app, view);
@ -299,20 +316,12 @@ internal void
move_vertical_lines(Application_Links *app, View_ID view, i64 lines){ move_vertical_lines(Application_Links *app, View_ID view, i64 lines){
if (lines > 0){ if (lines > 0){
for (i64 i = 0; i < lines; i += 1){ for (i64 i = 0; i < lines; i += 1){
i64 pos = view_get_cursor_pos(app, view); move_vertical_pixels(app, 1.f);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
Rect_f32 box = view_relative_box_of_pos(app, view, cursor.line, cursor.pos);
f32 half_height = rect_height(box)*0.5f;
move_vertical_pixels(app, half_height + 2.f);
} }
} }
else{ else{
for (i64 i = 0; i > lines; i -= 1){ for (i64 i = 0; i > lines; i -= 1){
i64 pos = view_get_cursor_pos(app, view); move_vertical_pixels(app, -1.f);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
Rect_f32 box = view_relative_box_of_pos(app, view, cursor.line, cursor.pos);
f32 half_height = rect_height(box)*0.5f;
move_vertical_pixels(app, -half_height - 2.f);
} }
} }
} }
@ -1079,10 +1088,8 @@ query_replace_base(Application_Links *app, View_ID view, Buffer_ID buffer_id, i6
i64 new_pos = 0; i64 new_pos = 0;
seek_string_forward(app, buffer_id, pos - 1, 0, r, &new_pos); seek_string_forward(app, buffer_id, pos - 1, 0, r, &new_pos);
i64 buffer_size = buffer_get_size(app, buffer_id);
User_Input in = {}; User_Input in = {};
for (;new_pos < buffer_size;){ for (;;){
Range_i64 match = Ii64(new_pos, new_pos + r.size); Range_i64 match = Ii64(new_pos, new_pos + r.size);
isearch__update_highlight(app, view, match); isearch__update_highlight(app, view, match);
@ -1091,9 +1098,11 @@ query_replace_base(Application_Links *app, View_ID view, Buffer_ID buffer_id, i6
break; break;
} }
if (match_key_code(&in, KeyCode_Y) || i64 size = buffer_get_size(app, buffer_id);
if (match.max <= size &&
(match_key_code(&in, KeyCode_Y) ||
match_key_code(&in, KeyCode_Return) || match_key_code(&in, KeyCode_Return) ||
match_key_code(&in, KeyCode_Tab)){ match_key_code(&in, KeyCode_Tab))){
buffer_replace_range(app, buffer_id, match, w); buffer_replace_range(app, buffer_id, match, w);
pos = match.start + w.size; pos = match.start + w.size;
} }
@ -1313,11 +1322,10 @@ CUSTOM_DOC("Queries the user for a new name and renames the file of the current
bar.prompt = push_u8_stringf(scratch, "Rename '%.*s' to: ", string_expand(front)); bar.prompt = push_u8_stringf(scratch, "Rename '%.*s' to: ", string_expand(front));
bar.string = SCu8(name_space, (u64)0); bar.string = SCu8(name_space, (u64)0);
bar.string_capacity = sizeof(name_space); bar.string_capacity = sizeof(name_space);
if (query_user_string(app, &bar)){ if (query_user_string(app, &bar) && bar.string.size != 0){
if (bar.string.size != 0){
// TODO(allen): There should be a way to say, "detach a buffer's file" and "attach this file to a buffer" // TODO(allen): There should be a way to say, "detach a buffer's file" and "attach this file to a buffer"
List_String_Const_u8 new_file_name_list = {}; List_String_Const_u8 new_file_name_list = {};
string_list_push(scratch, &new_file_name_list, file_name); string_list_push(scratch, &new_file_name_list, string_remove_front_of_path(file_name));
string_list_push(scratch, &new_file_name_list, bar.string); string_list_push(scratch, &new_file_name_list, bar.string);
String_Const_u8 new_file_name = string_list_flatten(scratch, new_file_name_list, StringFill_NullTerminate); String_Const_u8 new_file_name = string_list_flatten(scratch, new_file_name_list, StringFill_NullTerminate);
if (buffer_save(app, buffer, new_file_name, BufferSave_IgnoreDirtyFlag)){ if (buffer_save(app, buffer, new_file_name, BufferSave_IgnoreDirtyFlag)){
@ -1329,8 +1337,6 @@ CUSTOM_DOC("Queries the user for a new name and renames the file of the current
} }
} }
} }
}
} }
CUSTOM_COMMAND_SIG(make_directory_query) CUSTOM_COMMAND_SIG(make_directory_query)

View File

@ -4321,6 +4321,18 @@ string_remove_last_folder(String_Const_u32 str){
return(str); return(str);
} }
function b32
string_looks_like_drive_letter(String_Const_u8 string){
b32 result = false;
if (string.size == 3 &&
character_is_alpha(string.str[0]) &&
string.str[1] == ':' &&
character_is_slash(string.str[2])){
result = true;
}
return(result);
}
function String_Const_char function String_Const_char
string_remove_front_of_path(String_Const_char str){ string_remove_front_of_path(String_Const_char str){
i64 slash_pos = string_find_last_slash(str); i64 slash_pos = string_find_last_slash(str);
@ -4399,6 +4411,26 @@ string_front_of_path(String_Const_u32 str){
return(str); return(str);
} }
function String_Const_u8
string_remove_front_folder_of_path(String_Const_u8 str){
i64 slash_pos = string_find_last_slash(string_chop(str, 1));
if (slash_pos < 0){
str.size = 0;
}
else{
str.size = slash_pos + 1;
}
return(str);
}
function String_Const_u8
string_front_folder_of_path(String_Const_u8 str){
i64 slash_pos = string_find_last_slash(string_chop(str, 1));
if (slash_pos >= 0){
str = string_skip(str, slash_pos + 1);
}
return(str);
}
function String_Const_char function String_Const_char
string_file_extension(String_Const_char string){ string_file_extension(String_Const_char string){
return(string_skip(string, string_find_last(string, '.') + 1)); return(string_skip(string, string_find_last(string, '.') + 1));
@ -4728,9 +4760,10 @@ string_find_first(String_Const_char str, String_Const_char needle, String_Match_
i = str.size; i = str.size;
if (str.size >= needle.size){ if (str.size >= needle.size){
i = 0; i = 0;
char c = character_to_upper(needle.str[0]);
u64 one_past_last = str.size - needle.size + 1; u64 one_past_last = str.size - needle.size + 1;
for (;i < one_past_last; i += 1){ for (;i < one_past_last; i += 1){
if (str.str[i] == needle.str[0]){ if (character_to_upper(str.str[i]) == c){
String_Const_char source_part = string_prefix(string_skip(str, i), needle.size); String_Const_char source_part = string_prefix(string_skip(str, i), needle.size);
if (string_match(source_part, needle, rule)){ if (string_match(source_part, needle, rule)){
break; break;
@ -4751,9 +4784,10 @@ string_find_first(String_Const_u8 str, String_Const_u8 needle, String_Match_Rule
i = str.size; i = str.size;
if (str.size >= needle.size){ if (str.size >= needle.size){
i = 0; i = 0;
u8 c = character_to_upper(needle.str[0]);
u64 one_past_last = str.size - needle.size + 1; u64 one_past_last = str.size - needle.size + 1;
for (;i < one_past_last; i += 1){ for (;i < one_past_last; i += 1){
if (str.str[i] == needle.str[0]){ if (character_to_upper(str.str[i]) == c){
String_Const_u8 source_part = string_prefix(string_skip(str, i), needle.size); String_Const_u8 source_part = string_prefix(string_skip(str, i), needle.size);
if (string_match(source_part, needle, rule)){ if (string_match(source_part, needle, rule)){
break; break;
@ -4774,9 +4808,10 @@ string_find_first(String_Const_u16 str, String_Const_u16 needle, String_Match_Ru
i = str.size; i = str.size;
if (str.size >= needle.size){ if (str.size >= needle.size){
i = 0; i = 0;
u16 c = character_to_upper(needle.str[0]);
u64 one_past_last = str.size - needle.size + 1; u64 one_past_last = str.size - needle.size + 1;
for (;i < one_past_last; i += 1){ for (;i < one_past_last; i += 1){
if (str.str[i] == needle.str[0]){ if (character_to_upper(str.str[i]) == c){
String_Const_u16 source_part = string_prefix(string_skip(str, i), needle.size); String_Const_u16 source_part = string_prefix(string_skip(str, i), needle.size);
if (string_match(source_part, needle, rule)){ if (string_match(source_part, needle, rule)){
break; break;
@ -4797,9 +4832,10 @@ string_find_first(String_Const_u32 str, String_Const_u32 needle, String_Match_Ru
i = str.size; i = str.size;
if (str.size >= needle.size){ if (str.size >= needle.size){
i = 0; i = 0;
u32 c = character_to_upper(needle.str[0]);
u64 one_past_last = str.size - needle.size + 1; u64 one_past_last = str.size - needle.size + 1;
for (;i < one_past_last; i += 1){ for (;i < one_past_last; i += 1){
if (str.str[i] == needle.str[0]){ if (character_to_upper(str.str[i]) == c){
String_Const_u32 source_part = string_prefix(string_skip(str, i), needle.size); String_Const_u32 source_part = string_prefix(string_skip(str, i), needle.size);
if (string_match(source_part, needle, rule)){ if (string_match(source_part, needle, rule)){
break; break;
@ -6963,7 +6999,7 @@ global_const u8 base64_reverse[128] = {
function u64 function u64
digit_count_from_integer(u64 x, u32 radix){ digit_count_from_integer(u64 x, u32 radix){
u64 result = {}; u64 result = 0;
if (radix >= 2 && radix <= 16){ if (radix >= 2 && radix <= 16){
if (x == 0){ if (x == 0){
result = 1; result = 1;

View File

@ -31,14 +31,34 @@
# error architecture not supported yet # error architecture not supported yet
# endif # endif
#elif defined(__clang__)
# define COMPILER_CLANG 1
# if defined(__APPLE__) && defined(__MACH__)
# define OS_MAC 1
# else
# error This compiler/platform combo is not supported yet
# endif
# if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)
# define ARCH_X64 1
# elif defined(i386) || defined(__i386) || defined(__i386__)
# define ARCH_X86 1
# elif defined(__aarch64__)
# define ARCH_ARM64 1
# elif defined(__arm__)
# define ARCH_ARM32 1
# else
# error architecture not supported yet
# endif
#elif defined(__GNUC__) || defined(__GNUG__) #elif defined(__GNUC__) || defined(__GNUG__)
# define COMPILER_GCC 1 # define COMPILER_GCC 1
# if defined(__gnu_linux__) # if defined(__gnu_linux__)
# define OS_LINUX 1 # define OS_LINUX 1
# elif defined(__APPLE__) && defined(__MACH__)
# define OS_MAC 1
# else # else
# error This compiler/platform combo is not supported yet # error This compiler/platform combo is not supported yet
# endif # endif
@ -92,6 +112,9 @@
#if !defined(COMPILER_GCC) #if !defined(COMPILER_GCC)
#define COMPILER_GCC 0 #define COMPILER_GCC 0
#endif #endif
#if !defined(COMPILER_CLANG)
#define COMPILER_CLANG 0
#endif
#if !defined(OS_WINDOWS) #if !defined(OS_WINDOWS)
#define OS_WINDOWS 0 #define OS_WINDOWS 0
#endif #endif
@ -121,13 +144,12 @@
#endif #endif
#endif #endif
#if OS_WINDOWS // NOTE(yuval): Changed this so that CALL_CONVENTION will be defined for all platforms
#if ARCH_32BIT #if ARCH_32BIT
# define CALL_CONVENTION __stdcall # define CALL_CONVENTION __stdcall
#else #else
# define CALL_CONVENTION # define CALL_CONVENTION
#endif #endif
#endif
#if defined(JUST_GUESS_INTS) #if defined(JUST_GUESS_INTS)
typedef signed char i8; typedef signed char i8;
@ -268,8 +290,6 @@ enum{
#define Max(a,b) (((a)>(b))?(a):(b)) #define Max(a,b) (((a)>(b))?(a):(b))
#define Min(a,b) (((a)<(b))?(a):(b)) #define Min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))
#define clamp_top(a,b) Min(a,b) #define clamp_top(a,b) Min(a,b)
#define clamp_bot(a,b) Max(a,b) #define clamp_bot(a,b) Max(a,b)
#define clamp_(a,x,b) ((a>x)?a:((b<x)?b:x)) #define clamp_(a,x,b) ((a>x)?a:((b<x)?b:x))
@ -511,6 +531,9 @@ union SNode{
#define zdll_remove_front(f,l) zdll_remove_back_NP_((l),(f),prev,next) #define zdll_remove_front(f,l) zdll_remove_back_NP_((l),(f),prev,next)
#define zdll_remove(f,l,n) zdll_remove_NP_((f),(l),(n),next,prev) #define zdll_remove(f,l,n) zdll_remove_NP_((f),(l),(n),next,prev)
#define zdll_assert_good(T,f) Stmnt( if (f != 0){ Assert(f->prev == 0); \
for(T *p_ = f; p_ != 0; p_ = p_->next){ Assert(p_->prev == 0 || p_->prev->next == p_); Assert(p_->next == 0 || p_->next->prev == p_); } } )
//////////////////////////////// ////////////////////////////////
union Vec2_i8{ union Vec2_i8{

View File

@ -63,7 +63,7 @@ standard_build_exec_command(Application_Links *app, View_ID view, String_Const_u
standard_build_exec_flags); standard_build_exec_flags);
} }
static b32 function b32
standard_search_and_build_from_dir(Application_Links *app, View_ID view, String_Const_u8 start_dir){ standard_search_and_build_from_dir(Application_Links *app, View_ID view, String_Const_u8 start_dir){
Scratch_Block scratch(app); Scratch_Block scratch(app);
@ -82,15 +82,9 @@ standard_search_and_build_from_dir(Application_Links *app, View_ID view, String_
if (result){ if (result){
// NOTE(allen): Build // NOTE(allen): Build
String_Const_u8 path = string_remove_last_folder(full_file_path); String_Const_u8 path = string_remove_last_folder(full_file_path);
#if OS_WINDOWS String_Const_u8 command = push_u8_stringf(scratch, "\"%.*s/%.*s\"",
String_Const_u8 command = push_u8_stringf(scratch, "%.*s/%.*s",
string_expand(path), string_expand(path),
string_expand(cmd_string)); string_expand(cmd_string));
#elif OS_LINUX || OS_MAC
String_Const_u8 command = cmd_string;
#else
#error OS needs standard search and build rules
#endif
if (global_config.automatically_save_changes_on_build){ if (global_config.automatically_save_changes_on_build){
save_all_dirty_buffers(app); save_all_dirty_buffers(app);
} }

View File

@ -29,12 +29,16 @@ CUSTOM_DOC("Queries for an output buffer name and system command, runs the syste
bar_out.string = SCu8(out_buffer_space, (u64)0); bar_out.string = SCu8(out_buffer_space, (u64)0);
bar_out.string_capacity = sizeof(out_buffer_space); bar_out.string_capacity = sizeof(out_buffer_space);
if (!query_user_string(app, &bar_out)) return; if (!query_user_string(app, &bar_out)) return;
bar_out.string.size = clamp_top(bar_out.string.size, sizeof(out_buffer_space) - 1);
out_buffer_space[bar_out.string.size] = 0;
Query_Bar bar_cmd = {}; Query_Bar bar_cmd = {};
bar_cmd.prompt = string_u8_litexpr("Command: "); bar_cmd.prompt = string_u8_litexpr("Command: ");
bar_cmd.string = SCu8(command_space, (u64)0); bar_cmd.string = SCu8(command_space, (u64)0);
bar_cmd.string_capacity = sizeof(command_space); bar_cmd.string_capacity = sizeof(command_space);
if (!query_user_string(app, &bar_cmd)) return; if (!query_user_string(app, &bar_cmd)) return;
bar_cmd.string.size = clamp_top(bar_cmd.string.size, sizeof(command_space) - 1);
command_space[bar_cmd.string.size] = 0;
String_Const_u8 hot = push_hot_directory(app, scratch); String_Const_u8 hot = push_hot_directory(app, scratch);
{ {

View File

@ -46,6 +46,7 @@ CUSTOM_DOC("At the cursor, insert the text at the top of the clipboard.")
Managed_Scope scope = view_get_managed_scope(app, view); Managed_Scope scope = view_get_managed_scope(app, view);
Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type); Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type);
if (next_rewrite != 0){
*next_rewrite = Rewrite_Paste; *next_rewrite = Rewrite_Paste;
i32 *paste_index = scope_attachment(app, scope, view_paste_index_loc, i32); i32 *paste_index = scope_attachment(app, scope, view_paste_index_loc, i32);
*paste_index = 0; *paste_index = 0;
@ -61,9 +62,9 @@ CUSTOM_DOC("At the cursor, insert the text at the top of the clipboard.")
view_set_mark(app, view, seek_pos(pos)); view_set_mark(app, view, seek_pos(pos));
view_set_cursor_and_preferred_x(app, view, seek_pos(pos + (i32)string.size)); view_set_cursor_and_preferred_x(app, view, seek_pos(pos + (i32)string.size));
// TODO(allen): Send this to all views.
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste)); ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
view_post_fade(app, view, 0.667f, Ii64_size(pos, string.size), argb); buffer_post_fade(app, buffer, 0.667f, Ii64_size(pos, string.size), argb);
}
} }
} }
} }
@ -80,6 +81,7 @@ CUSTOM_DOC("If the previous command was paste or paste_next, replaces the paste
no_mark_snap_to_cursor(app, scope); no_mark_snap_to_cursor(app, scope);
Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type); Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type);
if (rewrite != 0){
if (*rewrite == Rewrite_Paste){ if (*rewrite == Rewrite_Paste){
Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type); Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type);
*next_rewrite = Rewrite_Paste; *next_rewrite = Rewrite_Paste;
@ -99,13 +101,14 @@ CUSTOM_DOC("If the previous command was paste or paste_next, replaces the paste
view_set_cursor_and_preferred_x(app, view, seek_pos(pos + string.size)); view_set_cursor_and_preferred_x(app, view, seek_pos(pos + string.size));
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste)); ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
view_post_fade(app, view, 0.667f, Ii64_size(pos, string.size), argb); buffer_post_fade(app, buffer, 0.667f, Ii64_size(pos, string.size), argb);
} }
else{ else{
paste(app); paste(app);
} }
} }
} }
}
CUSTOM_COMMAND_SIG(paste_and_indent) CUSTOM_COMMAND_SIG(paste_and_indent)
CUSTOM_DOC("Paste from the top of clipboard and run auto-indent on the newly pasted text.") CUSTOM_DOC("Paste from the top of clipboard and run auto-indent on the newly pasted text.")
@ -132,6 +135,7 @@ CUSTOM_COMMAND_SIG(multi_paste){
Managed_Scope scope = view_get_managed_scope(app, view); Managed_Scope scope = view_get_managed_scope(app, view);
Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type); Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type);
if (rewrite != 0){
if (*rewrite == Rewrite_Paste){ if (*rewrite == Rewrite_Paste){
Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type); Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type);
*next_rewrite = Rewrite_Paste; *next_rewrite = Rewrite_Paste;
@ -150,15 +154,14 @@ CUSTOM_COMMAND_SIG(multi_paste){
view_set_cursor_and_preferred_x(app, view, seek_pos(range.max + insert_string.size)); view_set_cursor_and_preferred_x(app, view, seek_pos(range.max + insert_string.size));
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste)); ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
view_post_fade(app, view, 0.667f, view_post_fade(app, buffer, 0.667f, Ii64(range.max + 1, range.max + insert_string.size), argb);
Ii64(range.max + 1, range.max + insert_string.size),
argb);
} }
else{ else{
paste(app); paste(app);
} }
} }
} }
}
function Range_i64 function Range_i64
multi_paste_range(Application_Links *app, View_ID view, Range_i64 range, i32 paste_count, b32 old_to_new){ multi_paste_range(Application_Links *app, View_ID view, Range_i64 range, i32 paste_count, b32 old_to_new){
@ -207,9 +210,8 @@ multi_paste_range(Application_Links *app, View_ID view, Range_i64 range, i32 pas
view_set_mark(app, view, seek_pos(finish_range.min)); view_set_mark(app, view, seek_pos(finish_range.min));
view_set_cursor_and_preferred_x(app, view, seek_pos(finish_range.max)); view_set_cursor_and_preferred_x(app, view, seek_pos(finish_range.max));
// TODO(allen): Send this to all views.
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste)); ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
view_post_fade(app, view, 0.667f, finish_range, argb); buffer_post_fade(app, buffer, 0.667f, finish_range, argb);
} }
} }
return(finish_range); return(finish_range);

File diff suppressed because it is too large Load Diff

View File

@ -755,7 +755,7 @@ map_set_binding_l(m, map, BindFWrap_(F), InputEventKind_MouseMove, 0, __VA_ARGS_
#define BindCore(F, K, ...) \ #define BindCore(F, K, ...) \
map_set_binding_l(m, map, BindFWrap_(F), InputEventKind_Core, (K), __VA_ARGS__, 0) map_set_binding_l(m, map, BindFWrap_(F), InputEventKind_Core, (K), __VA_ARGS__, 0)
#elif COMPILER_GCC #elif COMPILER_GCC | COMPILER_CLANG
#define Bind(F, K, ...) \ #define Bind(F, K, ...) \
map_set_binding_l(m, map, BindFWrap_(F), InputEventKind_KeyStroke, (K), ##__VA_ARGS__, 0) map_set_binding_l(m, map, BindFWrap_(F), InputEventKind_KeyStroke, (K), ##__VA_ARGS__, 0)

View File

@ -34,6 +34,32 @@ parse_extension_line_to_extension_list(Application_Links *app,
//////////////////////////////// ////////////////////////////////
function void
setup_built_in_mapping(Application_Links *app, String_Const_u8 name, Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){
Thread_Context *tctx = get_thread_context(app);
if (string_match(name, string_u8_litexpr("default"))){
mapping_release(tctx, mapping);
mapping_init(tctx, mapping);
setup_default_mapping(mapping, global_id, file_id, code_id);
}
else if (string_match(name, string_u8_litexpr("mac-default"))){
mapping_release(tctx, mapping);
mapping_init(tctx, mapping);
setup_mac_mapping(mapping, global_id, file_id, code_id);
}
else if (string_match(name, string_u8_litexpr("choose"))){
mapping_release(tctx, mapping);
mapping_init(tctx, mapping);
#if OS_MAC
setup_mac_mapping(mapping, global_id, file_id, code_id);
#else
setup_default_mapping(mapping, global_id, file_id, code_id);
#endif
}
}
////////////////////////////////
function Error_Location function Error_Location
get_error_location(Application_Links *app, u8 *base, u8 *pos){ get_error_location(Application_Links *app, u8 *base, u8 *pos){
ProfileScope(app, "get error location"); ProfileScope(app, "get error location");
@ -1196,6 +1222,7 @@ config_init_default(Config_Data *config){
block_zero_struct(&config->code_exts); block_zero_struct(&config->code_exts);
config->mapping = SCu8(config->mapping_space, (u64)0);
config->mode = SCu8(config->mode_space, (u64)0); config->mode = SCu8(config->mode_space, (u64)0);
config->use_scroll_bars = false; config->use_scroll_bars = false;
@ -1211,7 +1238,6 @@ config_init_default(Config_Data *config){
config->enable_virtual_whitespace = true; config->enable_virtual_whitespace = true;
config->enable_code_wrapping = true; config->enable_code_wrapping = true;
config->automatically_adjust_wrapping = true;
config->automatically_indent_text_on_save = true; config->automatically_indent_text_on_save = true;
config->automatically_save_changes_on_build = true; config->automatically_save_changes_on_build = true;
config->automatically_load_project = false; config->automatically_load_project = false;
@ -1219,9 +1245,6 @@ config_init_default(Config_Data *config){
config->indent_with_tabs = false; config->indent_with_tabs = false;
config->indent_width = 4; config->indent_width = 4;
config->default_wrap_width = 672;
config->default_min_base_width = 550;
config->default_theme_name = SCu8(config->default_theme_name_space, sizeof("4coder") - 1); config->default_theme_name = SCu8(config->default_theme_name_space, sizeof("4coder") - 1);
block_copy(config->default_theme_name.str, "4coder", config->default_theme_name.size); block_copy(config->default_theme_name.str, "4coder", config->default_theme_name.size);
config->highlight_line_at_cursor = true; config->highlight_line_at_cursor = true;
@ -1263,8 +1286,8 @@ config_parse__data(Application_Links *app, Arena *arena, String_Const_u8 file_na
parse_extension_line_to_extension_list(app, arena, str); parse_extension_line_to_extension_list(app, arena, str);
} }
config_fixed_string_var(parsed, "mode", 0, config_fixed_string_var(parsed, "mapping", 0, &config->mapping, config->mapping_space);
&config->mode, config->mode_space); config_fixed_string_var(parsed, "mode", 0, &config->mode, config->mode_space);
config_bool_var(parsed, "use_scroll_bars", 0, &config->use_scroll_bars); config_bool_var(parsed, "use_scroll_bars", 0, &config->use_scroll_bars);
config_bool_var(parsed, "use_file_bars", 0, &config->use_file_bars); config_bool_var(parsed, "use_file_bars", 0, &config->use_file_bars);
@ -1280,7 +1303,6 @@ config_parse__data(Application_Links *app, Arena *arena, String_Const_u8 file_na
config_bool_var(parsed, "enable_virtual_whitespace", 0, &config->enable_virtual_whitespace); config_bool_var(parsed, "enable_virtual_whitespace", 0, &config->enable_virtual_whitespace);
config_bool_var(parsed, "enable_code_wrapping", 0, &config->enable_code_wrapping); config_bool_var(parsed, "enable_code_wrapping", 0, &config->enable_code_wrapping);
config_bool_var(parsed, "automatically_adjust_wrapping", 0, &config->automatically_adjust_wrapping);
config_bool_var(parsed, "automatically_indent_text_on_save", 0, &config->automatically_indent_text_on_save); config_bool_var(parsed, "automatically_indent_text_on_save", 0, &config->automatically_indent_text_on_save);
config_bool_var(parsed, "automatically_save_changes_on_build", 0, &config->automatically_save_changes_on_build); config_bool_var(parsed, "automatically_save_changes_on_build", 0, &config->automatically_save_changes_on_build);
config_bool_var(parsed, "automatically_load_project", 0, &config->automatically_load_project); config_bool_var(parsed, "automatically_load_project", 0, &config->automatically_load_project);
@ -1288,9 +1310,6 @@ config_parse__data(Application_Links *app, Arena *arena, String_Const_u8 file_na
config_bool_var(parsed, "indent_with_tabs", 0, &config->indent_with_tabs); config_bool_var(parsed, "indent_with_tabs", 0, &config->indent_with_tabs);
config_int_var(parsed, "indent_width", 0, &config->indent_width); config_int_var(parsed, "indent_width", 0, &config->indent_width);
config_int_var(parsed, "default_wrap_width", 0, &config->default_wrap_width);
config_int_var(parsed, "default_min_base_width", 0, &config->default_min_base_width);
config_fixed_string_var(parsed, "default_theme_name", 0, config_fixed_string_var(parsed, "default_theme_name", 0,
&config->default_theme_name, config->default_theme_name_space); &config->default_theme_name, config->default_theme_name_space);
config_bool_var(parsed, "highlight_line_at_cursor", 0, &config->highlight_line_at_cursor); config_bool_var(parsed, "highlight_line_at_cursor", 0, &config->highlight_line_at_cursor);
@ -1400,6 +1419,17 @@ theme_parse__data(Application_Links *app, Arena *arena, String_Const_u8 file_nam
return(parsed); return(parsed);
} }
function Config*
theme_parse__buffer(Application_Links *app, Arena *arena, Buffer_ID buffer, Arena *color_arena, Color_Table *color_table){
String_Const_u8 contents = push_whole_buffer(app, arena, buffer);
Config *parsed = 0;
if (contents.str != 0){
String_Const_u8 file_name = push_buffer_file_name(app, arena, buffer);
parsed = theme_parse__data(app, arena, file_name, contents, color_arena, color_table);
}
return(parsed);
}
function Config* function Config*
theme_parse__file_handle(Application_Links *app, Arena *arena, String_Const_u8 file_name, FILE *file, Arena *color_arena, Color_Table *color_table){ theme_parse__file_handle(Application_Links *app, Arena *arena, String_Const_u8 file_name, FILE *file, Arena *color_arena, Color_Table *color_table){
Data data = dump_file_handle(arena, file); Data data = dump_file_handle(arena, file);
@ -1505,6 +1535,7 @@ load_config_and_apply(Application_Links *app, Arena *out_arena, Config_Data *con
config_feedback_string(scratch, &list, "user_name", config->user_name); config_feedback_string(scratch, &list, "user_name", config->user_name);
config_feedback_extension_list(scratch, &list, "treat_as_code", &config->code_exts); config_feedback_extension_list(scratch, &list, "treat_as_code", &config->code_exts);
config_feedback_string(scratch, &list, "mapping", config->mapping);
config_feedback_string(scratch, &list, "mode", config->mode); config_feedback_string(scratch, &list, "mode", config->mode);
config_feedback_bool(scratch, &list, "use_scroll_bars", config->use_scroll_bars); config_feedback_bool(scratch, &list, "use_scroll_bars", config->use_scroll_bars);
@ -1522,15 +1553,11 @@ load_config_and_apply(Application_Links *app, Arena *out_arena, Config_Data *con
config_feedback_bool(scratch, &list, "enable_code_wrapping", config->enable_code_wrapping); config_feedback_bool(scratch, &list, "enable_code_wrapping", config->enable_code_wrapping);
config_feedback_bool(scratch, &list, "automatically_indent_text_on_save", config->automatically_indent_text_on_save); config_feedback_bool(scratch, &list, "automatically_indent_text_on_save", config->automatically_indent_text_on_save);
config_feedback_bool(scratch, &list, "automatically_save_changes_on_build", config->automatically_save_changes_on_build); config_feedback_bool(scratch, &list, "automatically_save_changes_on_build", config->automatically_save_changes_on_build);
config_feedback_bool(scratch, &list, "automatically_adjust_wrapping", config->automatically_adjust_wrapping);
config_feedback_bool(scratch, &list, "automatically_load_project", config->automatically_load_project); config_feedback_bool(scratch, &list, "automatically_load_project", config->automatically_load_project);
config_feedback_bool(scratch, &list, "indent_with_tabs", config->indent_with_tabs); config_feedback_bool(scratch, &list, "indent_with_tabs", config->indent_with_tabs);
config_feedback_int(scratch, &list, "indent_width", config->indent_width); config_feedback_int(scratch, &list, "indent_width", config->indent_width);
config_feedback_int(scratch, &list, "default_wrap_width", config->default_wrap_width);
config_feedback_int(scratch, &list, "default_min_base_width", config->default_min_base_width);
config_feedback_string(scratch, &list, "default_theme_name", config->default_theme_name); config_feedback_string(scratch, &list, "default_theme_name", config->default_theme_name);
config_feedback_bool(scratch, &list, "highlight_line_at_cursor", config->highlight_line_at_cursor); config_feedback_bool(scratch, &list, "highlight_line_at_cursor", config->highlight_line_at_cursor);
@ -1552,13 +1579,12 @@ load_config_and_apply(Application_Links *app, Arena *out_arena, Config_Data *con
} }
// Apply config // Apply config
setup_built_in_mapping(app, config->mapping, &framework_mapping, mapid_global, mapid_file, mapid_code);
change_mode(app, config->mode); change_mode(app, config->mode);
global_set_setting(app, GlobalSetting_LAltLCtrlIsAltGr, config->lalt_lctrl_is_altgr); global_set_setting(app, GlobalSetting_LAltLCtrlIsAltGr, config->lalt_lctrl_is_altgr);
// TODO(allen): Color_Table *colors = get_color_table_by_name(config->default_theme_name);
#if 0 set_active_color(colors);
change_theme(app, config->default_theme_name.str, config->default_theme_name.size);
#endif
Face_Description description = {}; Face_Description description = {};
if (override_font_size != 0){ if (override_font_size != 0){
@ -1593,6 +1619,34 @@ load_theme_file_into_live_set(Application_Links *app, char *file_name){
save_theme(color_table, name); save_theme(color_table, name);
} }
CUSTOM_COMMAND_SIG(load_theme_current_buffer)
CUSTOM_DOC("Parse the current buffer as a theme file and add the theme to the theme list. If the buffer has a .4coder postfix in it's name, it is removed when the name is saved.")
{
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);
if (file_name.size > 0){
Arena *arena = &global_theme_arena;
Color_Table color_table = make_color_table(app, arena);
Config *config = theme_parse__buffer(app, scratch, buffer, arena, &color_table);
String_Const_u8 error_text = config_stringize_errors(app, scratch, config);
print_message(app, error_text);
String_Const_u8 name = string_front_of_path(file_name);
if (string_match(string_postfix(name, 7), string_u8_litexpr(".4coder"))){
name = string_chop(name, 7);
}
save_theme(color_table, name);
Color_Table_Node *node = global_theme_list.last;
if (node != 0 && string_match(node->name, name)){
active_color_table = node->table;
}
}
}
function void function void
load_folder_of_themes_into_live_set(Application_Links *app, String_Const_u8 path){ load_folder_of_themes_into_live_set(Application_Links *app, String_Const_u8 path){
Scratch_Block scratch(app, Scratch_Share); Scratch_Block scratch(app, Scratch_Share);

View File

@ -185,6 +185,9 @@ struct Config_Data{
String_Const_u8_Array code_exts; String_Const_u8_Array code_exts;
u8 mapping_space[64];
String_Const_u8 mapping;
u8 mode_space[64]; u8 mode_space[64];
String_Const_u8 mode; String_Const_u8 mode;
@ -203,15 +206,11 @@ struct Config_Data{
b8 enable_code_wrapping; b8 enable_code_wrapping;
b8 automatically_indent_text_on_save; b8 automatically_indent_text_on_save;
b8 automatically_save_changes_on_build; b8 automatically_save_changes_on_build;
b8 automatically_adjust_wrapping;
b8 automatically_load_project; b8 automatically_load_project;
b8 indent_with_tabs; b8 indent_with_tabs;
i32 indent_width; i32 indent_width;
i32 default_wrap_width;
i32 default_min_base_width;
u8 default_theme_name_space[256]; u8 default_theme_name_space[256];
String_Const_u8 default_theme_name; String_Const_u8 default_theme_name;

View File

@ -8,7 +8,10 @@
#define FCODER_DEFAULT_BINDINGS_CPP #define FCODER_DEFAULT_BINDINGS_CPP
#include "4coder_default_include.cpp" #include "4coder_default_include.cpp"
#include "4coder_default_map.cpp"
// NOTE(allen): Users can declare their own managed IDs here.
#include "generated/managed_id_metadata.cpp"
void void
custom_layer_init(Application_Links *app){ custom_layer_init(Application_Links *app){

View File

@ -120,10 +120,10 @@ set_default_color_scheme(Application_Links *app){
default_color_table.arrays[defcolor_margin] = make_colors(arena, 0xFF181818); default_color_table.arrays[defcolor_margin] = make_colors(arena, 0xFF181818);
default_color_table.arrays[defcolor_margin_hover] = make_colors(arena, 0xFF252525); default_color_table.arrays[defcolor_margin_hover] = make_colors(arena, 0xFF252525);
default_color_table.arrays[defcolor_margin_active] = make_colors(arena, 0xFF323232); default_color_table.arrays[defcolor_margin_active] = make_colors(arena, 0xFF323232);
default_color_table.arrays[defcolor_list_item] = make_colors(arena, 0xFF181818); default_color_table.arrays[defcolor_list_item] = make_colors(arena, 0xFF181818, 0xFF0C0C0C);
default_color_table.arrays[defcolor_list_item_hover] = make_colors(arena, 0xFF252525); default_color_table.arrays[defcolor_list_item_hover] = make_colors(arena, 0xFF252525, 0xFF181818);
default_color_table.arrays[defcolor_list_item_active] = make_colors(arena, 0xFF323232); default_color_table.arrays[defcolor_list_item_active] = make_colors(arena, 0xFF323232, 0xFF323232);
default_color_table.arrays[defcolor_cursor] = make_colors(arena, 0xFF00EE00); default_color_table.arrays[defcolor_cursor] = make_colors(arena, 0xFF00EE00, 0xFFEE7700);
default_color_table.arrays[defcolor_at_cursor] = make_colors(arena, 0xFF0C0C0C); default_color_table.arrays[defcolor_at_cursor] = make_colors(arena, 0xFF0C0C0C);
default_color_table.arrays[defcolor_highlight_cursor_line] = make_colors(arena, 0xFF1E1E1E); default_color_table.arrays[defcolor_highlight_cursor_line] = make_colors(arena, 0xFF1E1E1E);
default_color_table.arrays[defcolor_highlight] = make_colors(arena, 0xFFDDEE00); default_color_table.arrays[defcolor_highlight] = make_colors(arena, 0xFFDDEE00);
@ -156,6 +156,13 @@ set_default_color_scheme(Application_Links *app){
//////////////////////////////// ////////////////////////////////
function void
set_active_color(Color_Table *table){
if (table != 0){
active_color_table = *table;
}
}
function void function void
save_theme(Color_Table table, String_Const_u8 name){ save_theme(Color_Table table, String_Const_u8 name){
Color_Table_Node *node = push_array(&global_theme_arena, Color_Table_Node, 1); Color_Table_Node *node = push_array(&global_theme_arena, Color_Table_Node, 1);
@ -165,4 +172,20 @@ save_theme(Color_Table table, String_Const_u8 name){
node->table = table; node->table = table;
} }
////////////////////////////////
function Color_Table*
get_color_table_by_name(String_Const_u8 name){
Color_Table *result = 0;
for (Color_Table_Node *node = global_theme_list.first;
node != 0;
node = node->next){
if (string_match(node->name, name)){
result = &node->table;
break;
}
}
return(result);
}
// BOTTOM // BOTTOM

View File

@ -501,9 +501,14 @@ default_4coder_initialize(Application_Links *app, String_Const_u8_Array file_nam
#define M \ #define M \
"Welcome to " VERSION "\n" \ "Welcome to " VERSION "\n" \
"If you're new to 4coder there are some tutorials at http://4coder.net/tutorials.html\n" \ "If you're new to 4coder there is a built in tutorial\n" \
"Use the key combination [ X Alt ] (on mac [ X Control ])\n" \
"Type in 'hms_demo_tutorial' and press enter\n" \
"\n" \
"Direct bug reports and feature requests to https://github.com/4coder-editor/4coder/issues\n" \ "Direct bug reports and feature requests to https://github.com/4coder-editor/4coder/issues\n" \
"\n" \
"Other questions and discussion can be directed to editor@4coder.net or 4coder.handmade.network\n" \ "Other questions and discussion can be directed to editor@4coder.net or 4coder.handmade.network\n" \
"\n" \
"The change log can be found in CHANGES.txt\n" \ "The change log can be found in CHANGES.txt\n" \
"\n" "\n"
print_message(app, string_u8_litexpr(M)); print_message(app, string_u8_litexpr(M));
@ -529,6 +534,8 @@ default_4coder_initialize(Application_Links *app, String_Const_u8_Array file_nam
create_buffer(app, input_name, 0); create_buffer(app, input_name, 0);
} }
} }
fade_range_arena = make_arena_system(KB(8));
} }
function void function void
@ -687,5 +694,102 @@ buffer_modified_set_clear(void){
} }
} }
////////////////////////////////
function Fade_Range*
alloc_fade_range(void){
Fade_Range *result = free_fade_ranges;
if (result == 0){
result = push_array(&fade_range_arena, Fade_Range, 1);
}
else{
sll_stack_pop(free_fade_ranges);
}
return(result);
}
function void
free_fade_range(Fade_Range *range){
sll_stack_push(free_fade_ranges, range);
}
function void
buffer_post_fade(Application_Links *app, Buffer_ID buffer_id, f32 seconds, Range_i64 range, ARGB_Color color){
Fade_Range *fade_range = alloc_fade_range();
sll_queue_push(buffer_fade_ranges.first, buffer_fade_ranges.last, fade_range);
buffer_fade_ranges.count += 1;
fade_range->buffer_id = buffer_id;
fade_range->t = seconds;
fade_range->full_t = seconds;
fade_range->range = range;
fade_range->color= color;
}
function void
view_post_fade(Application_Links *app, View_ID view_id, f32 seconds, Range_i64 range, ARGB_Color color){
Fade_Range *fade_range = alloc_fade_range();
sll_queue_push(view_fade_ranges.first, view_fade_ranges.last, fade_range);
view_fade_ranges.count += 1;
fade_range->view_id = view_id;
fade_range->t = seconds;
fade_range->full_t = seconds;
fade_range->range = range;
fade_range->color= color;
}
function b32
tick_all_fade_ranges(f32 t){
Fade_Range **prev_next = &buffer_fade_ranges.first;
for (Fade_Range *node = buffer_fade_ranges.first, *next = 0;
node != 0;
node = next){
next = node->next;
node->t -= t;
if (node->t <= 0.f){
*prev_next = next;
buffer_fade_ranges.count -= 1;
}
else{
prev_next = &node->next;
}
}
prev_next = &view_fade_ranges.first;
for (Fade_Range *node = view_fade_ranges.first, *next = 0;
node != 0;
node = next){
next = node->next;
node->t -= t;
if (node->t <= 0.f){
*prev_next = next;
view_fade_ranges.count -= 1;
}
else{
prev_next = &node->next;
}
}
return(buffer_fade_ranges.count > 0 || view_fade_ranges.count > 0);
}
function void
paint_fade_ranges(Application_Links *app, Text_Layout_ID layout, Buffer_ID buffer, View_ID view){
for (Fade_Range *node = buffer_fade_ranges.first;
node != 0;
node = node->next){
if (node->buffer_id == buffer){
paint_text_color_blend(app, layout, node->range, node->color, node->t/node->full_t);
}
}
for (Fade_Range *node = view_fade_ranges.first;
node != 0;
node = node->next){
if (node->view_id == view){
paint_text_color_blend(app, layout, node->range, node->color, node->t/node->full_t);
}
}
}
// BOTTOM // BOTTOM

View File

@ -94,6 +94,26 @@ struct Buffer_Modified_Set{
Table_u64_u64 id_to_node; Table_u64_u64 id_to_node;
}; };
////////////////////////////////
struct Fade_Range{
Fade_Range *next;
union{
Buffer_ID buffer_id;
View_ID view_id;
};
f32 t;
f32 full_t;
Range_i64 range;
ARGB_Color color;
};
struct Fade_Range_List{
Fade_Range *first;
Fade_Range *last;
i32 count;
};
#endif #endif
// BOTTOM // BOTTOM

View File

@ -86,5 +86,17 @@ global Mapping framework_mapping = {};
global Buffer_Modified_Set global_buffer_modified_set = {}; global Buffer_Modified_Set global_buffer_modified_set = {};
////////////////////////////////
global b32 global_keyboard_macro_is_recording = false;
global Range_i64 global_keyboard_macro_range = {};
////////////////////////////////
global Fade_Range_List buffer_fade_ranges = {};
global Fade_Range_List view_fade_ranges = {};
global Arena fade_range_arena = {};
global Fade_Range *free_fade_ranges = 0;
// BOTTOM // BOTTOM

View File

@ -11,12 +11,12 @@ CUSTOM_DOC("Default command for responding to a startup event")
User_Input input = get_current_input(app); User_Input input = get_current_input(app);
if (match_core_code(&input, CoreCode_Startup)){ if (match_core_code(&input, CoreCode_Startup)){
String_Const_u8_Array file_names = input.event.core.file_names; String_Const_u8_Array file_names = input.event.core.file_names;
load_themes_default_folder(app);
default_4coder_initialize(app, file_names); default_4coder_initialize(app, file_names);
default_4coder_side_by_side_panels(app, file_names); default_4coder_side_by_side_panels(app, file_names);
if (global_config.automatically_load_project){ if (global_config.automatically_load_project){
load_project(app); load_project(app);
} }
load_themes_default_folder(app);
} }
} }
@ -43,13 +43,7 @@ CUSTOM_DOC("Default command for responding to a try-exit event")
} }
} }
if (do_exit){ if (do_exit){
// NOTE(allen): By leaving try exit unhandled we indicate hard_exit(app);
// that the core should take responsibility for handling this,
// and it will handle it by exiting 4coder. If we leave this
// event marked as handled on the other hand (for instance by
// running a confirmation GUI that cancels the exit) then 4coder
// will not exit.
leave_current_input_unhandled(app);
} }
} }
} }
@ -195,6 +189,10 @@ default_tick(Application_Links *app, Frame_Info frame_info){
} }
buffer_modified_set_clear(); buffer_modified_set_clear();
if (tick_all_fade_ranges(frame_info.animation_dt)){
animate_in_n_milliseconds(app, 0);
}
} }
function Rect_f32 function Rect_f32
@ -368,6 +366,9 @@ default_render_buffer(Application_Links *app, View_ID view_id, Face_ID face_id,
}break; }break;
} }
// NOTE(allen): Fade ranges
paint_fade_ranges(app, text_layout_id, buffer, view_id);
// NOTE(allen): put the actual text on the actual screen // NOTE(allen): put the actual text on the actual screen
draw_text_layout_default(app, text_layout_id); draw_text_layout_default(app, text_layout_id);
@ -932,15 +933,51 @@ BUFFER_HOOK_SIG(default_begin_buffer){
} }
BUFFER_HOOK_SIG(default_new_file){ BUFFER_HOOK_SIG(default_new_file){
// buffer_id Scratch_Block scratch(app);
// no meaning for return String_Const_u8 file_name = push_buffer_base_name(app, scratch, buffer_id);
if (!string_match(string_postfix(file_name, 2), string_u8_litexpr(".h"))) {
return(0);
}
List_String_Const_u8 guard_list = {};
for (u64 i = 0; i < file_name.size; ++i){
u8 c[2] = {};
u64 c_size = 1;
u8 ch = file_name.str[i];
if (ch == '.'){
c[0] = '_';
}
else if (ch >= 'A' && ch <= 'Z'){
c_size = 2;
c[0] = '_';
c[1] = ch;
}
else if (ch >= 'a' && ch <= 'z'){
c[0] = ch - ('a' - 'A');
}
String_Const_u8 part = push_string_copy(scratch, SCu8(c, c_size));
string_list_push(scratch, &guard_list, part);
}
String_Const_u8 guard = string_list_flatten(scratch, guard_list);
Buffer_Insertion insert = begin_buffer_insertion_at_buffered(app, buffer_id, 0, scratch, KB(16));
insertf(&insert,
"#ifndef %.*s\n"
"#define %.*s\n"
"\n"
"#endif //%.*s\n",
string_expand(guard),
string_expand(guard),
string_expand(guard));
end_buffer_insertion(&insert);
return(0); return(0);
} }
BUFFER_HOOK_SIG(default_file_save){ BUFFER_HOOK_SIG(default_file_save){
// buffer_id // buffer_id
ProfileScope(app, "default file save"); ProfileScope(app, "default file save");
b32 is_virtual = false; b32 is_virtual = global_config.enable_virtual_whitespace;
if (global_config.automatically_indent_text_on_save && is_virtual){ if (global_config.automatically_indent_text_on_save && is_virtual){
auto_indent_buffer(app, buffer_id, buffer_range(app, buffer_id)); auto_indent_buffer(app, buffer_id, buffer_range(app, buffer_id));
} }

View File

@ -78,6 +78,8 @@
#include "4coder_token.cpp" #include "4coder_token.cpp"
#include "generated/lexer_cpp.cpp" #include "generated/lexer_cpp.cpp"
#include "4coder_command_map.cpp" #include "4coder_command_map.cpp"
#include "4coder_default_map.cpp"
#include "4coder_mac_map.cpp"
#include "4coder_default_framework_variables.cpp" #include "4coder_default_framework_variables.cpp"
#include "4coder_default_colors.cpp" #include "4coder_default_colors.cpp"
#include "4coder_helper.cpp" #include "4coder_helper.cpp"
@ -118,8 +120,6 @@
#include "4coder_default_hooks.cpp" #include "4coder_default_hooks.cpp"
#include "generated/managed_id_metadata.cpp"
#endif #endif
// BOTTOM // BOTTOM

View File

@ -24,10 +24,13 @@ doc_commands(Arena *arena){
} }
function Doc_Cluster* function Doc_Cluster*
doc_default_bindings(Arena *arena, Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){ doc_default_bindings(Arena *arena, i32 map_count, Mapping *mapping_array, char **page_titles, char **page_names,
i64 global_id, i64 file_id, i64 code_id){
Doc_Cluster *cluster = new_doc_cluster(arena, "Bindings", "bindings"); Doc_Cluster *cluster = new_doc_cluster(arena, "Bindings", "bindings");
Doc_Page *page = new_doc_page(arena, cluster, "Default Bindings", "default_bindings"); for (i32 i = 0; i < map_count; i += 1){
Mapping *mapping = &mapping_array[i];
Doc_Page *page = new_doc_page(arena, cluster, page_titles[i], page_names[i]);
for (Command_Map *map = mapping->first_map; for (Command_Map *map = mapping->first_map;
map != 0; map != 0;
map = map->next){ map = map->next){
@ -164,6 +167,7 @@ doc_default_bindings(Arena *arena, Mapping *mapping, i64 global_id, i64 file_id,
par->table.dim = table_dims; par->table.dim = table_dims;
par->table.vals = vals; par->table.vals = vals;
} }
}
return(cluster); return(cluster);
} }

View File

@ -204,5 +204,21 @@ doc_paragraph(Arena *arena, Doc_Block *block){
par->kind = DocParagraphKind_Text; par->kind = DocParagraphKind_Text;
} }
////////////////////////////////
function Doc_Page*
doc_get_page(Doc_Cluster *cluster, String_Const_u8 name){
Doc_Page *result = 0;
for (Doc_Page *page = cluster->first_page;
page != 0;
page = page->next){
if (string_match(name, page->name)){
result = page;
break;
}
}
return(result);
}
// BOTTOM // BOTTOM

View File

@ -195,10 +195,12 @@ CUSTOM_DOC("Prompts the user to select a command then loads a doc buffer for tha
Scratch_Block scratch(app); Scratch_Block scratch(app);
Doc_Cluster *docs = doc_commands(scratch); Doc_Cluster *docs = doc_commands(scratch);
Doc_Page *page = get_doc_page_from_user(app, docs, "Doc Page:"); Doc_Page *page = get_doc_page_from_user(app, docs, "Doc Page:");
if (page != 0){
Buffer_ID buffer = render_doc_page(app, page); Buffer_ID buffer = render_doc_page(app, page);
view_set_buffer(app, view, buffer, 0); view_set_buffer(app, view, buffer, 0);
} }
} }
}
// BOTTOM // BOTTOM

View File

@ -12,21 +12,45 @@ draw_text_layout_default(Application_Links *app, Text_Layout_ID layout_id){
} }
function FColor function FColor
get_margin_color(i32 level){ get_item_margin_color(i32 level, i32 sub_id){
FColor margin = fcolor_zero(); FColor margin = fcolor_zero();
switch (level){ switch (level){
default: default:
case UIHighlight_None: case UIHighlight_None:
{ {
margin = fcolor_id(defcolor_list_item); margin = fcolor_id(defcolor_list_item, sub_id);
}break; }break;
case UIHighlight_Hover: case UIHighlight_Hover:
{ {
margin = fcolor_id(defcolor_list_item_hover); margin = fcolor_id(defcolor_list_item_hover, sub_id);
}break; }break;
case UIHighlight_Active: case UIHighlight_Active:
{ {
margin = fcolor_id(defcolor_list_item_active); margin = fcolor_id(defcolor_list_item_active, sub_id);
}break;
}
return(margin);
}
function FColor
get_item_margin_color(i32 level){
return(get_item_margin_color(level, 0));
}
function FColor
get_panel_margin_color(i32 level){
FColor margin = fcolor_zero();
switch (level){
default:
case UIHighlight_None:
{
margin = fcolor_id(defcolor_margin);
}break;
case UIHighlight_Hover:
{
margin = fcolor_id(defcolor_margin_hover);
}break;
case UIHighlight_Active:
{
margin = fcolor_id(defcolor_margin_active);
}break; }break;
} }
return(margin); return(margin);
@ -40,7 +64,7 @@ draw_string(Application_Links *app, Face_ID font_id, String_Const_u8 string, Vec
function Vec2_f32 function Vec2_f32
draw_string(Application_Links *app, Face_ID font_id, String_Const_u8 string, Vec2_f32 p, FColor color){ draw_string(Application_Links *app, Face_ID font_id, String_Const_u8 string, Vec2_f32 p, FColor color){
ARGB_Color argb = fcolor_resolve(color); ARGB_Color argb = fcolor_resolve(color);
draw_string(app, font_id, string, p, argb); return(draw_string(app, font_id, string, p, argb));
} }
function void function void
@ -111,9 +135,6 @@ draw_character_block(Application_Links *app, Text_Layout_ID layout, Range_i64 ra
} }
draw_rectangle(app, Rf32(x, y), roundness, color); draw_rectangle(app, Rf32(x, y), roundness, color);
} }
for (i64 i = range.first; i < range.one_past_last; i += 1){
draw_character_block(app, layout, i, roundness, color);
}
} }
function void function void
@ -257,7 +278,7 @@ draw_background_and_margin(Application_Links *app, View_ID view, FColor margin,
function Rect_f32 function Rect_f32
draw_background_and_margin(Application_Links *app, View_ID view, b32 is_active_view){ draw_background_and_margin(Application_Links *app, View_ID view, b32 is_active_view){
FColor margin_color = get_margin_color(is_active_view?UIHighlight_Active:UIHighlight_None); FColor margin_color = get_panel_margin_color(is_active_view?UIHighlight_Active:UIHighlight_None);
return(draw_background_and_margin(app, view, margin_color, fcolor_id(defcolor_back))); return(draw_background_and_margin(app, view, margin_color, fcolor_id(defcolor_back)));
} }
@ -305,9 +326,9 @@ draw_file_bar(Application_Links *app, View_ID view_id, Buffer_ID buffer, Face_ID
}break; }break;
} }
u8 space[3];
{ {
Dirty_State dirty = buffer_get_dirty_state(app, buffer); Dirty_State dirty = buffer_get_dirty_state(app, buffer);
u8 space[3];
String_u8 str = Su8(space, 0, 3); String_u8 str = Su8(space, 0, 3);
if (dirty != 0){ if (dirty != 0){
string_append(&str, string_u8_litexpr(" ")); string_append(&str, string_u8_litexpr(" "));
@ -706,17 +727,28 @@ draw_highlight_range(Application_Links *app, View_ID view_id,
return(has_highlight_range); return(has_highlight_range);
} }
function i32
default_cursor_sub_id(void){
i32 result = 0;
if (global_keyboard_macro_is_recording){
result = 1;
}
return(result);
}
function void function void
draw_original_4coder_style_cursor_mark_highlight(Application_Links *app, View_ID view_id, b32 is_active_view, draw_original_4coder_style_cursor_mark_highlight(Application_Links *app, View_ID view_id, b32 is_active_view,
Buffer_ID buffer, Text_Layout_ID text_layout_id, Buffer_ID buffer, Text_Layout_ID text_layout_id,
f32 roundness, f32 outline_thickness){ f32 roundness, f32 outline_thickness){
b32 has_highlight_range = draw_highlight_range(app, view_id, buffer, text_layout_id, roundness); b32 has_highlight_range = draw_highlight_range(app, view_id, buffer, text_layout_id, roundness);
if (!has_highlight_range){ if (!has_highlight_range){
i32 cursor_sub_id = default_cursor_sub_id();
i64 cursor_pos = view_get_cursor_pos(app, view_id); i64 cursor_pos = view_get_cursor_pos(app, view_id);
i64 mark_pos = view_get_mark_pos(app, view_id); i64 mark_pos = view_get_mark_pos(app, view_id);
if (is_active_view){ if (is_active_view){
draw_character_block(app, text_layout_id, cursor_pos, roundness, draw_character_block(app, text_layout_id, cursor_pos, roundness,
fcolor_id(defcolor_cursor)); fcolor_id(defcolor_cursor, cursor_sub_id));
paint_text_color_pos(app, text_layout_id, cursor_pos, paint_text_color_pos(app, text_layout_id, cursor_pos,
fcolor_id(defcolor_at_cursor)); fcolor_id(defcolor_at_cursor));
draw_character_wire_frame(app, text_layout_id, mark_pos, draw_character_wire_frame(app, text_layout_id, mark_pos,
@ -729,7 +761,7 @@ draw_original_4coder_style_cursor_mark_highlight(Application_Links *app, View_ID
fcolor_id(defcolor_mark)); fcolor_id(defcolor_mark));
draw_character_wire_frame(app, text_layout_id, cursor_pos, draw_character_wire_frame(app, text_layout_id, cursor_pos,
roundness, outline_thickness, roundness, outline_thickness,
fcolor_id(defcolor_cursor)); fcolor_id(defcolor_cursor, cursor_sub_id));
} }
} }
} }
@ -740,16 +772,15 @@ draw_notepad_style_cursor_highlight(Application_Links *app, View_ID view_id,
f32 roundness){ f32 roundness){
b32 has_highlight_range = draw_highlight_range(app, view_id, buffer, text_layout_id, roundness); b32 has_highlight_range = draw_highlight_range(app, view_id, buffer, text_layout_id, roundness);
if (!has_highlight_range){ if (!has_highlight_range){
i32 cursor_sub_id = default_cursor_sub_id();
i64 cursor_pos = view_get_cursor_pos(app, view_id); i64 cursor_pos = view_get_cursor_pos(app, view_id);
i64 mark_pos = view_get_mark_pos(app, view_id); i64 mark_pos = view_get_mark_pos(app, view_id);
if (cursor_pos != mark_pos){ if (cursor_pos != mark_pos){
Range_i64 range = Ii64(cursor_pos, mark_pos); Range_i64 range = Ii64(cursor_pos, mark_pos);
draw_character_block(app, text_layout_id, range, roundness, draw_character_block(app, text_layout_id, range, roundness, fcolor_id(defcolor_highlight));
fcolor_id(defcolor_highlight)); paint_text_color_fcolor(app, text_layout_id, range, fcolor_id(defcolor_at_highlight));
paint_text_color_fcolor(app, text_layout_id, range,
fcolor_id(defcolor_at_highlight));
} }
draw_character_i_bar(app, text_layout_id, cursor_pos, fcolor_id(defcolor_cursor)); draw_character_i_bar(app, text_layout_id, cursor_pos, fcolor_id(defcolor_cursor, cursor_sub_id));
} }
} }
@ -825,10 +856,10 @@ draw_button(Application_Links *app, Rect_f32 rect, Vec2_f32 mouse_p, Face_ID fac
hovered = true; hovered = true;
} }
FColor margin_color = get_margin_color(hovered?UIHighlight_Active:UIHighlight_None); UI_Highlight_Level highlight = hovered?UIHighlight_Active:UIHighlight_None;
draw_rectangle_fcolor(app, rect, 3.f, margin_color); draw_rectangle_fcolor(app, rect, 3.f, get_item_margin_color(highlight));
rect = rect_inner(rect, 3.f); rect = rect_inner(rect, 3.f);
draw_rectangle_fcolor(app, rect, 3.f, fcolor_id(defcolor_back)); draw_rectangle_fcolor(app, rect, 3.f, get_item_margin_color(highlight, 1));
Scratch_Block scratch(app); Scratch_Block scratch(app);
Fancy_String *fancy = push_fancy_string(scratch, 0, face, fcolor_id(defcolor_text_default), text); Fancy_String *fancy = push_fancy_string(scratch, 0, face, fcolor_id(defcolor_text_default), text);

View File

@ -347,11 +347,11 @@ function Fancy_String*
push_fancy_string_fixed(Arena *arena, Fancy_Line *line, FColor fore, push_fancy_string_fixed(Arena *arena, Fancy_Line *line, FColor fore,
String_Const_u8 value, i32 max){ String_Const_u8 value, i32 max){
if (value.size <= max){ if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fore, 0.f, 0.f, return(push_fancy_stringf(arena, line, (Face_ID)0, fore, 0.f, 0.f,
"%-*.*s", max, string_expand(value))); "%-*.*s", max, string_expand(value)));
} }
else{ else{
return(push_fancy_stringf(arena, line, 0, fore, 0.f, 0.f, return(push_fancy_stringf(arena, line, (Face_ID)0, fore, 0.f, 0.f,
"%-*.*s...", max - 3, string_expand(value))); "%-*.*s...", max - 3, string_expand(value)));
} }
} }
@ -360,12 +360,12 @@ push_fancy_string_fixed(Arena *arena, Fancy_Line *line,
f32 pre_margin, f32 post_margin, String_Const_u8 value, f32 pre_margin, f32 post_margin, String_Const_u8 value,
i32 max){ i32 max){
if (value.size <= max){ if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(),
pre_margin, post_margin, pre_margin, post_margin,
"%-*.*s", max, string_expand(value))); "%-*.*s", max, string_expand(value)));
} }
else{ else{
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(),
pre_margin, post_margin, pre_margin, post_margin,
"%-*.*s...", max - 3, string_expand(value))); "%-*.*s...", max - 3, string_expand(value)));
} }
@ -374,11 +374,11 @@ function Fancy_String*
push_fancy_string_fixed(Arena *arena, Fancy_Line *line, String_Const_u8 value, push_fancy_string_fixed(Arena *arena, Fancy_Line *line, String_Const_u8 value,
i32 max){ i32 max){
if (value.size <= max){ if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), 0.f, 0.f, return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(), 0.f, 0.f,
"%-*.*s", max, string_expand(value))); "%-*.*s", max, string_expand(value)));
} }
else{ else{
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), 0.f, 0.f, return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(), 0.f, 0.f,
"%-*.*s...", max - 3, string_expand(value))); "%-*.*s...", max - 3, string_expand(value)));
} }
} }
@ -452,11 +452,11 @@ function Fancy_String*
push_fancy_string_trunc(Arena *arena, Fancy_Line *line, FColor fore, push_fancy_string_trunc(Arena *arena, Fancy_Line *line, FColor fore,
String_Const_u8 value, i32 max){ String_Const_u8 value, i32 max){
if (value.size <= max){ if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fore, 0.f, 0.f, return(push_fancy_stringf(arena, line, (Face_ID)0, fore, 0.f, 0.f,
"%.*s", string_expand(value))); "%.*s", string_expand(value)));
} }
else{ else{
return(push_fancy_stringf(arena, line, 0, fore, 0.f, 0.f, return(push_fancy_stringf(arena, line, (Face_ID)0, fore, 0.f, 0.f,
"%.*s...", max - 3, value.str)); "%.*s...", max - 3, value.str));
} }
} }
@ -465,12 +465,12 @@ push_fancy_string_trunc(Arena *arena, Fancy_Line *line,
f32 pre_margin, f32 post_margin, String_Const_u8 value, f32 pre_margin, f32 post_margin, String_Const_u8 value,
i32 max){ i32 max){
if (value.size <= max){ if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(),
pre_margin, post_margin, pre_margin, post_margin,
"%.*s", string_expand(value))); "%.*s", string_expand(value)));
} }
else{ else{
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(),
pre_margin, post_margin, pre_margin, post_margin,
"%.*s...", max - 3, value.str)); "%.*s...", max - 3, value.str));
} }
@ -479,11 +479,11 @@ function Fancy_String*
push_fancy_string_trunc(Arena *arena, Fancy_Line *line, String_Const_u8 value, push_fancy_string_trunc(Arena *arena, Fancy_Line *line, String_Const_u8 value,
i32 max){ i32 max){
if (value.size <= max){ if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), 0.f, 0.f, return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(), 0.f, 0.f,
"%.*s", string_expand(value))); "%.*s", string_expand(value)));
} }
else{ else{
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), 0.f, 0.f, return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(), 0.f, 0.f,
"%.*s...", max - 3, value.str)); "%.*s...", max - 3, value.str));
} }
} }

View File

@ -115,7 +115,7 @@ internal void fm__swap_ptr(char **A, char **B);
fm__swap_ptr(&line.build_options, &line.build_options_prev); \ fm__swap_ptr(&line.build_options, &line.build_options_prev); \
}while(0) }while(0)
#elif COMPILER_GCC #elif COMPILER_GCC | COMPILER_CLANG
#define fm_add_to_line(line, str, ...) do{ \ #define fm_add_to_line(line, str, ...) do{ \
snprintf(line.build_options, line.build_max, "%s " str, \ snprintf(line.build_options, line.build_max, "%s " str, \
@ -510,7 +510,7 @@ fm_copy_file(char *file, char *newname){
internal void internal void
fm_copy_all(char *source, char *folder){ fm_copy_all(char *source, char *folder){
fprintf(stdout, "copy %s to %s\n", source, folder); fprintf(stdout, "copy %s to %s\n", source, folder);
systemf("cp -rf %s %s > /dev/null", source, folder); systemf("cp -rf %s/* %s > /dev/null", source, folder);
} }
internal void internal void

View File

@ -277,13 +277,14 @@ 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_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.") CUSTOM_DOC("Creates a lister of locations that look like function definitions and declarations in the buffer.")
{ {
Heap *heap = &global_heap;
View_ID view = get_active_view(app, Access_ReadVisible); View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible); Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
if (buffer != 0){ if (buffer != 0){
list_all_functions(app, buffer); list_all_functions(app, buffer);
view = get_active_view(app, Access_Always); view = get_active_view(app, Access_Always);
buffer = view_get_buffer(app, view, Access_Always); buffer = view_get_buffer(app, view, Access_Always);
Marker_List *list = get_marker_list_for_buffer(buffer); Marker_List *list = get_or_make_list_for_buffer(app, heap, buffer);
if (list != 0){ if (list != 0){
Jump_Lister_Result jump = get_jump_index_from_user(app, list, Jump_Lister_Result jump = get_jump_index_from_user(app, list,
"Function:"); "Function:");
@ -301,13 +302,13 @@ CUSTOM_DOC("Creates a jump list of lines from all buffers that appear to define
CUSTOM_COMMAND_SIG(list_all_functions_all_buffers_lister) 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.") CUSTOM_DOC("Creates a lister of locations that look like function definitions and declarations all buffers.")
{ {
Heap *heap = &global_heap;
list_all_functions(app, 0); list_all_functions(app, 0);
View_ID view = get_active_view(app, Access_Always); View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always); Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Marker_List *list = get_marker_list_for_buffer(buffer); Marker_List *list = get_or_make_list_for_buffer(app, heap, buffer);
if (list != 0){ if (list != 0){
Jump_Lister_Result jump = get_jump_index_from_user(app, list, Jump_Lister_Result jump = get_jump_index_from_user(app, list, "Function:");
"Function:");
jump_to_jump_lister_result(app, view, list, &jump); jump_to_jump_lister_result(app, view, list, &jump);
} }
} }

View File

@ -788,7 +788,7 @@ enclose_boundary(Application_Links *app, Buffer_ID buffer, Range_i64 range,
range.min = new_min; range.min = new_min;
} }
i64 new_max = func(app, buffer, Side_Max, Scan_Forward, range.max - 1); i64 new_max = func(app, buffer, Side_Max, Scan_Forward, range.max - 1);
i64 new_max_check = func(app, buffer, Side_Min, Scan_Forward, range.max - 1); i64 new_max_check = func(app, buffer, Side_Min, Scan_Forward, range.max);
if (new_max_check >= new_max && new_max > range.max){ if (new_max_check >= new_max && new_max > range.max){
range.max = new_max; range.max = new_max;
} }
@ -1227,8 +1227,8 @@ get_indent_info_range(Application_Links *app, Buffer_ID buffer, Range_i64 range,
} }
internal Indent_Info internal Indent_Info
get_indent_info_line_start(Application_Links *app, Buffer_ID buffer, i64 line_start, i32 tab_width){ get_indent_info_line_number_and_start(Application_Links *app, Buffer_ID buffer, i64 line_number, i64 line_start, i32 tab_width){
i64 end = get_line_side_pos_from_pos(app, buffer, line_start, Side_Max); i64 end = get_line_side_pos(app, buffer, line_number, Side_Max);
return(get_indent_info_range(app, buffer, Ii64(line_start, end), tab_width)); return(get_indent_info_range(app, buffer, Ii64(line_start, end), tab_width));
} }
@ -1897,7 +1897,7 @@ push_token_or_word_under_pos(Application_Links *app, Arena *arena, Buffer_ID buf
String_Const_u8 result = {}; String_Const_u8 result = {};
Token *token = get_token_from_pos(app, buffer, pos); Token *token = get_token_from_pos(app, buffer, pos);
if (token != 0 && token->size > 0 && token->kind != TokenBaseKind_Whitespace){ if (token != 0 && token->size > 0 && token->kind != TokenBaseKind_Whitespace){
Range_i64 range = Ii64(token->pos, token->pos + token->size); Range_i64 range = Ii64(token);
result = push_buffer_range(app, arena, buffer, range); result = push_buffer_range(app, arena, buffer, range);
} }
return(result); return(result);

View File

@ -44,7 +44,7 @@ insert_string__no_buffering(Buffer_Insertion *insertion, String_Const_u8 string)
insertion->at += string.size; insertion->at += string.size;
} }
static void function void
insert__flush(Buffer_Insertion *insertion){ insert__flush(Buffer_Insertion *insertion){
Cursor *cursor = insertion->cursor; Cursor *cursor = insertion->cursor;
u64 pos = insertion->temp.temp_memory_cursor.pos; u64 pos = insertion->temp.temp_memory_cursor.pos;
@ -53,7 +53,7 @@ insert__flush(Buffer_Insertion *insertion){
end_temp(insertion->temp); end_temp(insertion->temp);
} }
static char* function char*
insert__reserve(Buffer_Insertion *insertion, u64 size){ insert__reserve(Buffer_Insertion *insertion, u64 size){
char *space = push_array(insertion->cursor, char, size); char *space = push_array(insertion->cursor, char, size);
if (space == 0){ if (space == 0){
@ -63,14 +63,14 @@ insert__reserve(Buffer_Insertion *insertion, u64 size){
return(space); return(space);
} }
static void function void
end_buffer_insertion(Buffer_Insertion *insertion){ end_buffer_insertion(Buffer_Insertion *insertion){
if (insertion->buffering){ if (insertion->buffering){
insert__flush(insertion); insert__flush(insertion);
} }
} }
static void function void
insert_string(Buffer_Insertion *insertion, String_Const_u8 string){ insert_string(Buffer_Insertion *insertion, String_Const_u8 string){
if (!insertion->buffering){ if (!insertion->buffering){
insert_string__no_buffering(insertion, string); insert_string__no_buffering(insertion, string);
@ -86,7 +86,7 @@ insert_string(Buffer_Insertion *insertion, String_Const_u8 string){
} }
} }
static u64 function u64
insertf(Buffer_Insertion *insertion, char *format, ...){ insertf(Buffer_Insertion *insertion, char *format, ...){
Scratch_Block scratch(insertion->app); Scratch_Block scratch(insertion->app);
va_list args; va_list args;
@ -97,12 +97,12 @@ insertf(Buffer_Insertion *insertion, char *format, ...){
return(string.size); return(string.size);
} }
static void function void
insertc(Buffer_Insertion *insertion, char C){ insertc(Buffer_Insertion *insertion, char C){
insert_string(insertion, SCu8(&C, 1)); insert_string(insertion, SCu8(&C, 1));
} }
static b32 function b32
insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, i32 line, i32 truncate_at){ insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, i32 line, i32 truncate_at){
b32 success = is_valid_line(insertion->app, buffer_id, line); b32 success = is_valid_line(insertion->app, buffer_id, line);
if (success){ if (success){
@ -112,7 +112,7 @@ insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, i32 li
return(success); return(success);
} }
static b32 function b32
insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, i32 line){ insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, i32 line){
return(insert_line_from_buffer(insertion, buffer_id, line, 0)); return(insert_line_from_buffer(insertion, buffer_id, line, 0));
} }

View File

@ -59,9 +59,10 @@ jump_to_jump_lister_result(Application_Links *app, View_ID view,
CUSTOM_COMMAND_SIG(view_jump_list_with_lister) 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") CUSTOM_DOC("When executed on a buffer with jumps, creates a persistent lister for all the jumps")
{ {
Heap *heap = &global_heap;
View_ID view = get_active_view(app, Access_Always); View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always); Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Marker_List *list = get_marker_list_for_buffer(buffer); Marker_List *list = get_or_make_list_for_buffer(app, heap, buffer);
if (list != 0){ if (list != 0){
Jump_Lister_Result jump = get_jump_index_from_user(app, list, "Jump:"); Jump_Lister_Result jump = get_jump_index_from_user(app, list, "Jump:");
jump_to_jump_lister_result(app, view, list, &jump); jump_to_jump_lister_result(app, view, list, &jump);

View File

@ -171,8 +171,10 @@ init_marker_list(Application_Links *app, Heap *heap, Buffer_ID buffer, Marker_Li
Assert(managed_object_get_type(app, marker_handle) == ManagedObjectType_Markers); Assert(managed_object_get_type(app, marker_handle) == ManagedObjectType_Markers);
Managed_Object *marker_handle_ptr = scope_attachment(app, scope, sticky_jump_marker_handle, Managed_Object); Managed_Object *marker_handle_ptr = scope_attachment(app, scope, sticky_jump_marker_handle, Managed_Object);
if (marker_handle_ptr != 0){
*marker_handle_ptr = marker_handle; *marker_handle_ptr = marker_handle;
} }
}
Managed_Object stored_jump_array = alloc_managed_memory_in_scope(app, scope_array[0], sizeof(Sticky_Jump_Stored), jumps.count); Managed_Object stored_jump_array = alloc_managed_memory_in_scope(app, scope_array[0], sizeof(Sticky_Jump_Stored), jumps.count);
managed_object_store_data(app, stored_jump_array, 0, jumps.count, stored); managed_object_store_data(app, stored_jump_array, 0, jumps.count, stored);
@ -279,7 +281,7 @@ get_jump_from_list(Application_Links *app, Marker_List *list, i32 index, ID_Pos_
Managed_Scope scope = get_managed_scope_with_multiple_dependencies(app, scope_array, ArrayCount(scope_array)); Managed_Scope scope = get_managed_scope_with_multiple_dependencies(app, scope_array, ArrayCount(scope_array));
Managed_Object *marker_array = scope_attachment(app, scope, sticky_jump_marker_handle, Managed_Object); Managed_Object *marker_array = scope_attachment(app, scope, sticky_jump_marker_handle, Managed_Object);
if (*marker_array != 0){ if (marker_array != 0 && *marker_array != 0){
Marker marker = {}; Marker marker = {};
managed_object_load_data(app, *marker_array, stored.index_into_marker_array, 1, &marker); managed_object_load_data(app, *marker_array, stored.index_into_marker_array, 1, &marker);
location->buffer_id = target_buffer_id; location->buffer_id = target_buffer_id;

View File

@ -4,9 +4,6 @@
// TOP // TOP
global b32 global_keyboard_macro_is_recording = false;
global Range_i64 global_keyboard_macro_range = {};
function Buffer_ID function Buffer_ID
get_keyboard_log_buffer(Application_Links *app){ get_keyboard_log_buffer(Application_Links *app){
return(get_buffer_by_name(app, string_u8_litexpr("*keyboard*"), Access_Always)); return(get_buffer_by_name(app, string_u8_litexpr("*keyboard*"), Access_Always));

View File

@ -15,7 +15,6 @@ layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){
} }
else{ else{
if (0.f < p.x && p.x < max_f32){ if (0.f < p.x && p.x < max_f32){
f32 bottom_padding = list.bottom_padding;
f32 closest_x = -max_f32; f32 closest_x = -max_f32;
for (Layout_Item_Block *block = list.first; for (Layout_Item_Block *block = list.first;
block != 0; block != 0;
@ -30,7 +29,7 @@ layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){
if (p.y < item->rect.y0){ if (p.y < item->rect.y0){
goto double_break; goto double_break;
} }
if (item->rect.y1 + bottom_padding <= p.y){ if (item->padded_y1 <= p.y){
continue; continue;
} }
f32 dist0 = p.x - item->rect.x0; f32 dist0 = p.x - item->rect.x0;
@ -68,7 +67,7 @@ layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){
goto double_break_2; goto double_break_2;
} }
prev_item = item; prev_item = item;
if (item->rect.y1 <= p.y){ if (item->padded_y1 <= p.y){
continue; continue;
} }
} }
@ -97,7 +96,7 @@ layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){
if (p.y < item->rect.y0){ if (p.y < item->rect.y0){
goto double_break_3; goto double_break_3;
} }
if (item->rect.y1 <= p.y){ if (item->padded_y1 <= p.y){
continue; continue;
} }
closest_item = item; closest_item = item;
@ -160,6 +159,19 @@ layout_box_of_pos(Layout_Item_List list, i64 index){
return(result); return(result);
} }
function Rect_f32
layout_padded_box_of_pos(Layout_Item_List list, i64 index){
Rect_f32 result = {};
Layout_Item *item = layout_get_first_with_index(list, index);
if (item != 0){
result.x0 = item->rect.x0;
result.y0 = item->rect.y0;
result.x1 = item->rect.x1;
result.y1 = item->padded_y1;
}
return(result);
}
internal i64 internal i64
layout_get_pos_at_character(Layout_Item_List list, i64 character){ layout_get_pos_at_character(Layout_Item_List list, i64 character){
i64 result = 0; i64 result = 0;

View File

@ -56,7 +56,7 @@ layout_item_list_finish(Layout_Item_List *list, f32 bottom_padding){
} }
function void function void
layout_write(Arena *arena, Layout_Item_List *list, Face_ID face, i64 index, u32 codepoint, Layout_Item_Flag flags, Rect_f32 rect){ layout_write(Arena *arena, Layout_Item_List *list, Face_ID face, i64 index, u32 codepoint, Layout_Item_Flag flags, Rect_f32 rect, f32 padded_y1){
Temp_Memory restore_point = begin_temp(arena); Temp_Memory restore_point = begin_temp(arena);
Layout_Item *item = push_array(arena, Layout_Item, 1); Layout_Item *item = push_array(arena, Layout_Item, 1);
Layout_Item_Block *block = list->last; Layout_Item_Block *block = list->last;
@ -95,6 +95,7 @@ layout_write(Arena *arena, Layout_Item_List *list, Face_ID face, i64 index, u32
item->codepoint = codepoint; item->codepoint = codepoint;
item->flags = flags; item->flags = flags;
item->rect = rect; item->rect = rect;
item->padded_y1 = padded_y1;
list->height = Max(list->height, rect.y1); list->height = Max(list->height, rect.y1);
} }
@ -179,7 +180,7 @@ lr_tb_write_with_advance_with_flags(LefRig_TopBot_Layout_Vars *vars, Face_ID fac
} }
vars->p.x = f32_ceil32(vars->p.x); vars->p.x = f32_ceil32(vars->p.x);
f32 next_x = vars->p.x + advance; f32 next_x = vars->p.x + advance;
layout_write(arena, list, face, index, codepoint, flags, Rf32(vars->p, V2f32(next_x, vars->text_y))); layout_write(arena, list, face, index, codepoint, flags, Rf32(vars->p, V2f32(next_x, vars->text_y)), vars->line_y);
vars->p.x = next_x; vars->p.x = next_x;
} }
@ -219,15 +220,15 @@ lr_tb_write_byte_with_advance(LefRig_TopBot_Layout_Vars *vars, Face_ID face, f32
f32 text_y = vars->text_y; f32 text_y = vars->text_y;
Layout_Item_Flag flags = LayoutItemFlag_Special_Character; Layout_Item_Flag flags = LayoutItemFlag_Special_Character;
layout_write(arena, list, face, index, '\\', flags, Rf32(p, V2f32(next_x, text_y))); layout_write(arena, list, face, index, '\\', flags, Rf32(p, V2f32(next_x, text_y)), vars->line_y);
p.x = next_x; p.x = next_x;
flags = LayoutItemFlag_Ghost_Character; flags = LayoutItemFlag_Ghost_Character;
next_x += metrics->byte_sub_advances[1]; next_x += metrics->byte_sub_advances[1];
layout_write(arena, list, face, index, integer_symbols[hi], flags, Rf32(p, V2f32(next_x, text_y))); layout_write(arena, list, face, index, integer_symbols[hi], flags, Rf32(p, V2f32(next_x, text_y)), vars->line_y);
p.x = next_x; p.x = next_x;
next_x += metrics->byte_sub_advances[2]; next_x += metrics->byte_sub_advances[2];
layout_write(arena, list, face, index, integer_symbols[lo], flags, Rf32(p, V2f32(next_x, text_y))); layout_write(arena, list, face, index, integer_symbols[lo], flags, Rf32(p, V2f32(next_x, text_y)), vars->line_y);
vars->p.x = final_next_x; vars->p.x = final_next_x;
} }
@ -242,7 +243,7 @@ lr_tb_write_byte(LefRig_TopBot_Layout_Vars *vars, Face_ID face,
function void function void
lr_tb_write_blank_dim(LefRig_TopBot_Layout_Vars *vars, Face_ID face, Vec2_f32 dim, lr_tb_write_blank_dim(LefRig_TopBot_Layout_Vars *vars, Face_ID face, Vec2_f32 dim,
Arena *arena, Layout_Item_List *list, i64 index){ Arena *arena, Layout_Item_List *list, i64 index){
layout_write(arena, list, face, index, ' ', 0, Rf32_xy_wh(vars->p, dim)); layout_write(arena, list, face, index, ' ', 0, Rf32_xy_wh(vars->p, dim), vars->line_y);
vars->p.x += dim.x; vars->p.x += dim.x;
} }

View File

@ -266,8 +266,8 @@ lister_render(Application_Links *app, Frame_Info frame_info, View_ID view){
highlight = UIHighlight_Hover; highlight = UIHighlight_Hover;
} }
draw_rectangle_fcolor(app, item_rect, 6.f, get_margin_color(highlight)); draw_rectangle_fcolor(app, item_rect, 6.f, get_item_margin_color(highlight));
draw_rectangle_fcolor(app, item_inner, 6.f, fcolor_id(defcolor_back)); draw_rectangle_fcolor(app, item_inner, 6.f, get_item_margin_color(highlight, 1));
Fancy_Line line = {}; Fancy_Line line = {};
push_fancy_string(scratch, &line, fcolor_id(defcolor_text_default), node->string); push_fancy_string(scratch, &line, fcolor_id(defcolor_text_default), node->string);
@ -472,7 +472,7 @@ run_lister(Application_Links *app, Lister *lister){
case InputEventKind_TextInsert: case InputEventKind_TextInsert:
{ {
if (lister->handlers.write_character != 0){ if (lister->handlers.write_character != 0){
lister->handlers.write_character(app); result = lister->handlers.write_character(app);
} }
}break; }break;
@ -716,8 +716,9 @@ lister_add_item(Lister *lister, String_Const_u8 string, String_Const_u8 status,
user_data, extra_space)); user_data, extra_space));
} }
function void function Lister_Activation_Code
lister__write_string__default(Application_Links *app){ lister__write_string__default(Application_Links *app){
Lister_Activation_Code result = ListerActivation_Continue;
View_ID view = get_active_view(app, Access_Always); View_ID view = get_active_view(app, Access_Always);
Lister *lister = view_get_lister(view); Lister *lister = view_get_lister(view);
if (lister != 0){ if (lister != 0){
@ -731,6 +732,7 @@ lister__write_string__default(Application_Links *app){
lister_update_filtered_list(app, lister); lister_update_filtered_list(app, lister);
} }
} }
return(result);
} }
function void function void

View File

@ -39,6 +39,7 @@ struct Lister_Node_Ptr_Array{
i32 count; i32 count;
}; };
typedef Lister_Activation_Code Lister_Write_Character_Function(Application_Links *app);
typedef Lister_Activation_Code Lister_Key_Stroke_Function(Application_Links *app); typedef Lister_Activation_Code Lister_Key_Stroke_Function(Application_Links *app);
typedef void Lister_Navigate_Function(Application_Links *app, typedef void Lister_Navigate_Function(Application_Links *app,
View_ID view, struct Lister *lister, View_ID view, struct Lister *lister,
@ -46,7 +47,7 @@ typedef void Lister_Navigate_Function(Application_Links *app,
struct Lister_Handlers{ struct Lister_Handlers{
Lister_Regenerate_List_Function_Type *refresh; Lister_Regenerate_List_Function_Type *refresh;
Custom_Command_Function *write_character; Lister_Write_Character_Function *write_character;
Custom_Command_Function *backspace; Custom_Command_Function *backspace;
Lister_Navigate_Function *navigate; Lister_Navigate_Function *navigate;
Lister_Key_Stroke_Function *key_stroke; Lister_Key_Stroke_Function *key_stroke;

View File

@ -236,8 +236,9 @@ get_color_table_from_user(Application_Links *app){
//////////////////////////////// ////////////////////////////////
function void function Lister_Activation_Code
lister__write_character__file_path(Application_Links *app){ lister__write_character__file_path(Application_Links *app){
Lister_Activation_Code result = ListerActivation_Continue;
View_ID view = get_this_ctx_view(app, Access_Always); View_ID view = get_this_ctx_view(app, Access_Always);
Lister *lister = view_get_lister(view); Lister *lister = view_get_lister(view);
if (lister != 0){ if (lister != 0){
@ -245,18 +246,20 @@ lister__write_character__file_path(Application_Links *app){
String_Const_u8 string = to_writable(&in); String_Const_u8 string = to_writable(&in);
if (string.str != 0 && string.size > 0){ if (string.str != 0 && string.size > 0){
lister_append_text_field(lister, string); lister_append_text_field(lister, string);
if (character_is_slash(string.str[0])){
lister->out.text_field = lister->text_field.string;
result = ListerActivation_Finished;
}
else{
String_Const_u8 front_name = string_front_of_path(lister->text_field.string); String_Const_u8 front_name = string_front_of_path(lister->text_field.string);
lister_set_key(lister, front_name); lister_set_key(lister, front_name);
if (character_is_slash(string.str[0])){
String_Const_u8 new_hot = lister->text_field.string;
set_hot_directory(app, new_hot);
lister_call_refresh_handler(app, lister);
} }
lister->item_index = 0; lister->item_index = 0;
lister_zero_scroll(lister); lister_zero_scroll(lister);
lister_update_filtered_list(app, lister); lister_update_filtered_list(app, lister);
} }
} }
return(result);
} }
function void function void
@ -374,15 +377,13 @@ struct File_Name_Result{
}; };
function File_Name_Result function File_Name_Result
get_file_name_from_user(Application_Links *app, Arena *arena, String_Const_u8 query, get_file_name_from_user(Application_Links *app, Arena *arena, String_Const_u8 query, View_ID view){
View_ID view){
Lister_Handlers handlers = lister_get_default_handlers(); Lister_Handlers handlers = lister_get_default_handlers();
handlers.refresh = generate_hot_directory_file_list; handlers.refresh = generate_hot_directory_file_list;
handlers.write_character = lister__write_character__file_path; handlers.write_character = lister__write_character__file_path;
handlers.backspace = lister__backspace_text_field__file_path; handlers.backspace = lister__backspace_text_field__file_path;
Lister_Result l_result = Lister_Result l_result = run_lister_with_refresh_handler(app, arena, query, handlers);
run_lister_with_refresh_handler(app, arena, query, handlers);
File_Name_Result result = {}; File_Name_Result result = {};
result.canceled = l_result.canceled; result.canceled = l_result.canceled;
@ -391,12 +392,18 @@ get_file_name_from_user(Application_Links *app, Arena *arena, String_Const_u8 qu
if (l_result.user_data != 0){ if (l_result.user_data != 0){
String_Const_u8 name = SCu8((u8*)l_result.user_data); String_Const_u8 name = SCu8((u8*)l_result.user_data);
result.file_name_activated = name; result.file_name_activated = name;
result.is_folder = result.is_folder = character_is_slash(string_get_character(name, name.size - 1));
character_is_slash(string_get_character(name, name.size -1 ));
} }
result.file_name_in_text_field = string_front_of_path(l_result.text_field); result.file_name_in_text_field = string_front_of_path(l_result.text_field);
String_Const_u8 path = string_remove_front_of_path(l_result.text_field); String_Const_u8 path = {};
if (l_result.user_data == 0 && result.file_name_in_text_field.size == 0 && l_result.text_field.size > 0){
result.file_name_in_text_field = string_front_folder_of_path(l_result.text_field);
path = string_remove_front_folder_of_path(l_result.text_field);
}
else{
path = string_remove_front_of_path(l_result.text_field);
}
if (character_is_slash(string_get_character(path, path.size - 1))){ if (character_is_slash(string_get_character(path, path.size - 1))){
path = string_chop(path, 1); path = string_chop(path, 1);
} }
@ -407,8 +414,7 @@ get_file_name_from_user(Application_Links *app, Arena *arena, String_Const_u8 qu
} }
function File_Name_Result function File_Name_Result
get_file_name_from_user(Application_Links *app, Arena *arena, char *query, get_file_name_from_user(Application_Links *app, Arena *arena, char *query, View_ID view){
View_ID view){
return(get_file_name_from_user(app, arena, SCu8(query), view)); return(get_file_name_from_user(app, arena, SCu8(query), view));
} }
@ -429,8 +435,7 @@ do_buffer_kill_user_check(Application_Links *app, Buffer_ID buffer, View_ID view
lister_choice(scratch, &list, "(Y)es" , "", KeyCode_Y, SureToKill_Yes); lister_choice(scratch, &list, "(Y)es" , "", KeyCode_Y, SureToKill_Yes);
lister_choice(scratch, &list, "(S)ave", "", KeyCode_S, SureToKill_Save); lister_choice(scratch, &list, "(S)ave", "", KeyCode_S, SureToKill_Save);
Lister_Choice *choice = Lister_Choice *choice = get_choice_from_user(app, "There are unsaved changes, close anyway?", list);
get_choice_from_user(app, "There are unsaved changes, close anyway?", list);
b32 do_kill = false; b32 do_kill = false;
if (choice != 0){ if (choice != 0){
@ -524,6 +529,50 @@ CUSTOM_DOC("Interactively kill an open buffer.")
//////////////////////////////// ////////////////////////////////
enum{
SureToCreateFolder_NULL = 0,
SureToCreateFolder_No = 1,
SureToCreateFolder_Yes = 2,
};
function b32
query_create_folder(Application_Links *app, String_Const_u8 folder_name){
Scratch_Block scratch(app);
Lister_Choice_List list = {};
lister_choice(scratch, &list, "(N)o" , "", KeyCode_N, SureToKill_No);
lister_choice(scratch, &list, "(Y)es" , "", KeyCode_Y, SureToKill_Yes);
String_Const_u8 message = push_u8_stringf(scratch, "Create the folder %.*s?", string_expand(folder_name));
Lister_Choice *choice = get_choice_from_user(app, message, list);
b32 did_create_folder = false;
if (choice != 0){
switch (choice->user_data){
case SureToCreateFolder_No:
{}break;
case SureToCreateFolder_Yes:
{
String_Const_u8 hot = push_hot_directory(app, scratch);
String_Const_u8 fixed_folder_name = folder_name;
for (;fixed_folder_name.size > 0 &&
character_is_slash(fixed_folder_name.str[fixed_folder_name.size - 1]);){
fixed_folder_name = string_chop(fixed_folder_name, 1);
}
if (fixed_folder_name.size > 0){
String_Const_u8 cmd = push_u8_stringf(scratch, "mkdir %.*s", string_expand(fixed_folder_name));
exec_system_command(app, 0, buffer_identifier(0), hot, cmd, 0);
did_create_folder = true;
}
}break;
}
}
return(did_create_folder);
}
////////////////////////////////
function Lister_Activation_Code function Lister_Activation_Code
activate_open_or_new__generic(Application_Links *app, View_ID view, activate_open_or_new__generic(Application_Links *app, View_ID view,
String_Const_u8 path, String_Const_u8 file_name, String_Const_u8 path, String_Const_u8 file_name,
@ -566,8 +615,7 @@ CUSTOM_DOC("Interactively open a file out of the file system.")
for (;;){ for (;;){
Scratch_Block scratch(app); Scratch_Block scratch(app);
View_ID view = get_this_ctx_view(app, Access_Always); View_ID view = get_this_ctx_view(app, Access_Always);
File_Name_Result result = get_file_name_from_user(app, scratch, "Open:", File_Name_Result result = get_file_name_from_user(app, scratch, "Open:", view);
view);
if (result.canceled) break; if (result.canceled) break;
String_Const_u8 file_name = result.file_name_activated; String_Const_u8 file_name = result.file_name_activated;
@ -577,8 +625,7 @@ CUSTOM_DOC("Interactively open a file out of the file system.")
if (file_name.size == 0) break; if (file_name.size == 0) break;
String_Const_u8 path = result.path_in_text_field; String_Const_u8 path = result.path_in_text_field;
String_Const_u8 full_file_name = String_Const_u8 full_file_name = push_u8_stringf(scratch, "%.*s/%.*s",
push_u8_stringf(scratch, "%.*s/%.*s",
string_expand(path), string_expand(file_name)); string_expand(path), string_expand(file_name));
if (result.is_folder){ if (result.is_folder){
@ -586,6 +633,23 @@ CUSTOM_DOC("Interactively open a file out of the file system.")
continue; continue;
} }
if (character_is_slash(file_name.str[file_name.size - 1])){
File_Attributes attribs = system_quick_file_attributes(scratch, full_file_name);
if (HasFlag(attribs.flags, FileAttribute_IsDirectory)){
set_hot_directory(app, full_file_name);
continue;
}
if (string_looks_like_drive_letter(file_name)){
set_hot_directory(app, file_name);
continue;
}
if (query_create_folder(app, file_name)){
set_hot_directory(app, full_file_name);
continue;
}
break;
}
Buffer_ID buffer = create_buffer(app, full_file_name, 0); Buffer_ID buffer = create_buffer(app, full_file_name, 0);
if (buffer != 0){ if (buffer != 0){
view_set_buffer(app, view, buffer, 0); view_set_buffer(app, view, buffer, 0);
@ -622,6 +686,23 @@ CUSTOM_DOC("Interactively creates a new file.")
continue; continue;
} }
if (character_is_slash(file_name.str[file_name.size - 1])){
File_Attributes attribs = system_quick_file_attributes(scratch, full_file_name);
if (HasFlag(attribs.flags, FileAttribute_IsDirectory)){
set_hot_directory(app, full_file_name);
continue;
}
if (string_looks_like_drive_letter(file_name)){
set_hot_directory(app, file_name);
continue;
}
if (query_create_folder(app, file_name)){
set_hot_directory(app, full_file_name);
continue;
}
break;
}
Buffer_Create_Flag flags = BufferCreate_AlwaysNew; Buffer_Create_Flag flags = BufferCreate_AlwaysNew;
Buffer_ID buffer = create_buffer(app, full_file_name, flags); Buffer_ID buffer = create_buffer(app, full_file_name, flags);
if (buffer != 0){ if (buffer != 0){
@ -637,8 +718,7 @@ CUSTOM_DOC("Interactively opens a file.")
for (;;){ for (;;){
Scratch_Block scratch(app); Scratch_Block scratch(app);
View_ID view = get_this_ctx_view(app, Access_Always); View_ID view = get_this_ctx_view(app, Access_Always);
File_Name_Result result = get_file_name_from_user(app, scratch, "Open:", File_Name_Result result = get_file_name_from_user(app, scratch, "Open:", view);
view);
if (result.canceled) break; if (result.canceled) break;
String_Const_u8 file_name = result.file_name_activated; String_Const_u8 file_name = result.file_name_activated;
@ -654,6 +734,19 @@ CUSTOM_DOC("Interactively opens a file.")
continue; continue;
} }
if (character_is_slash(file_name.str[file_name.size - 1])){
File_Attributes attribs = system_quick_file_attributes(scratch, full_file_name);
if (HasFlag(attribs.flags, FileAttribute_IsDirectory)){
set_hot_directory(app, full_file_name);
continue;
}
if (query_create_folder(app, file_name)){
set_hot_directory(app, full_file_name);
continue;
}
break;
}
Buffer_Create_Flag flags = BufferCreate_NeverNew; Buffer_Create_Flag flags = BufferCreate_NeverNew;
Buffer_ID buffer = create_buffer(app, full_file_name, flags); Buffer_ID buffer = create_buffer(app, full_file_name, flags);
if (buffer != 0){ if (buffer != 0){

View File

@ -672,7 +672,7 @@ log_graph_render(Application_Links *app, Frame_Info frame_info, View_ID view){
Rect_f32 view_rect = view_get_screen_rect(app, view); Rect_f32 view_rect = view_get_screen_rect(app, view);
Rect_f32 inner = rect_inner(view_rect, 3); Rect_f32 inner = rect_inner(view_rect, 3);
draw_rectangle_fcolor(app, view_rect, 0.f, draw_rectangle_fcolor(app, view_rect, 0.f,
get_margin_color(is_active_view?UIHighlight_Active:UIHighlight_None)); get_item_margin_color(is_active_view?UIHighlight_Active:UIHighlight_None));
draw_rectangle_fcolor(app, inner, 0.f, fcolor_id(defcolor_back)); draw_rectangle_fcolor(app, inner, 0.f, fcolor_id(defcolor_back));
Rect_f32 prev_clip = draw_set_clip(app, inner); Rect_f32 prev_clip = draw_set_clip(app, inner);

160
custom/4coder_mac_map.cpp Normal file
View File

@ -0,0 +1,160 @@
/*
4coder_mac_map.cpp - Instantiate mac keyboard bindings.
*/
// TOP
function void
setup_mac_mapping(Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){
MappingScope();
SelectMapping(mapping);
SelectMap(global_id);
BindCore(default_startup, CoreCode_Startup);
BindCore(default_try_exit, CoreCode_TryExit);
Bind(keyboard_macro_start_recording , KeyCode_U, KeyCode_Command);
Bind(keyboard_macro_finish_recording, KeyCode_U, KeyCode_Command, KeyCode_Shift);
Bind(keyboard_macro_replay, KeyCode_U, KeyCode_Control);
Bind(change_active_panel, KeyCode_Comma, KeyCode_Command);
Bind(change_active_panel_backwards, KeyCode_Comma, KeyCode_Command, KeyCode_Shift);
Bind(interactive_new, KeyCode_N, KeyCode_Command);
Bind(interactive_open_or_new, KeyCode_O, KeyCode_Command);
Bind(open_in_other, KeyCode_O, KeyCode_Control);
Bind(interactive_kill_buffer, KeyCode_K, KeyCode_Command);
Bind(interactive_switch_buffer, KeyCode_I, KeyCode_Command);
Bind(project_go_to_root_directory, KeyCode_H, KeyCode_Command);
Bind(save_all_dirty_buffers, KeyCode_S, KeyCode_Command, KeyCode_Shift);
Bind(change_to_build_panel, KeyCode_Period, KeyCode_Control);
Bind(close_build_panel, KeyCode_Comma, KeyCode_Control);
Bind(goto_next_jump, KeyCode_N, KeyCode_Control);
Bind(goto_prev_jump, KeyCode_N, KeyCode_Control, KeyCode_Shift);
Bind(build_in_build_panel, KeyCode_M, KeyCode_Control);
Bind(goto_first_jump, KeyCode_M, KeyCode_Control, KeyCode_Shift);
Bind(toggle_filebar, KeyCode_B, KeyCode_Control);
Bind(execute_any_cli, KeyCode_Z, KeyCode_Control);
Bind(execute_previous_cli, KeyCode_Z, KeyCode_Control, KeyCode_Shift);
Bind(command_lister, KeyCode_X, KeyCode_Control);
Bind(project_command_lister, KeyCode_X, KeyCode_Control, KeyCode_Shift);
Bind(list_all_functions_current_buffer, KeyCode_I, KeyCode_Command, KeyCode_Shift);
Bind(project_fkey_command, KeyCode_F1);
Bind(project_fkey_command, KeyCode_F2);
Bind(project_fkey_command, KeyCode_F3);
Bind(project_fkey_command, KeyCode_F4);
Bind(project_fkey_command, KeyCode_F5);
Bind(project_fkey_command, KeyCode_F6);
Bind(project_fkey_command, KeyCode_F7);
Bind(project_fkey_command, KeyCode_F8);
Bind(project_fkey_command, KeyCode_F9);
Bind(project_fkey_command, KeyCode_F10);
Bind(project_fkey_command, KeyCode_F11);
Bind(project_fkey_command, KeyCode_F12);
Bind(project_fkey_command, KeyCode_F13);
Bind(project_fkey_command, KeyCode_F14);
Bind(project_fkey_command, KeyCode_F15);
Bind(project_fkey_command, KeyCode_F16);
Bind(exit_4coder, KeyCode_F4, KeyCode_Alt);
BindMouseWheel(mouse_wheel_scroll);
BindMouseWheel(mouse_wheel_change_face_size, KeyCode_Command);
SelectMap(file_id);
ParentMap(global_id);
BindTextInput(write_text_input);
BindMouse(click_set_cursor_and_mark, MouseCode_Left);
BindMouseRelease(click_set_cursor, MouseCode_Left);
BindCore(click_set_cursor_and_mark, CoreCode_ClickActivateView);
BindMouseMove(click_set_cursor_if_lbutton);
Bind(delete_char, KeyCode_Delete);
Bind(backspace_char, KeyCode_Backspace);
Bind(move_up, KeyCode_Up);
Bind(move_down, KeyCode_Down);
Bind(move_left, KeyCode_Left);
Bind(move_right, KeyCode_Right);
Bind(seek_end_of_line, KeyCode_End);
Bind(seek_beginning_of_line, KeyCode_Home);
Bind(page_up, KeyCode_PageUp);
Bind(page_down, KeyCode_PageDown);
Bind(goto_beginning_of_file, KeyCode_PageUp, KeyCode_Command);
Bind(goto_end_of_file, KeyCode_PageDown, KeyCode_Command);
Bind(move_up_to_blank_line_end, KeyCode_Up, KeyCode_Command);
Bind(move_down_to_blank_line_end, KeyCode_Down, KeyCode_Command);
Bind(move_left_whitespace_boundary, KeyCode_Left, KeyCode_Command);
Bind(move_right_whitespace_boundary, KeyCode_Right, KeyCode_Command);
Bind(move_line_up, KeyCode_Up, KeyCode_Alt);
Bind(move_line_down, KeyCode_Down, KeyCode_Alt);
Bind(backspace_alpha_numeric_boundary, KeyCode_Backspace, KeyCode_Command);
Bind(delete_alpha_numeric_boundary, KeyCode_Delete, KeyCode_Command);
Bind(snipe_backward_whitespace_or_token_boundary, KeyCode_Backspace, KeyCode_Control);
Bind(snipe_forward_whitespace_or_token_boundary, KeyCode_Delete, KeyCode_Control);
Bind(set_mark, KeyCode_Space, KeyCode_Control);
Bind(set_mark, KeyCode_ForwardSlash, KeyCode_Command);
Bind(replace_in_range, KeyCode_A, KeyCode_Command);
Bind(copy, KeyCode_C, KeyCode_Command);
Bind(delete_range, KeyCode_D, KeyCode_Command);
Bind(delete_line, KeyCode_D, KeyCode_Command, KeyCode_Shift);
Bind(center_view, KeyCode_E, KeyCode_Command);
Bind(left_adjust_view, KeyCode_E, KeyCode_Command, KeyCode_Shift);
Bind(search, KeyCode_F, KeyCode_Command);
Bind(list_all_locations, KeyCode_F, KeyCode_Command, KeyCode_Shift);
Bind(list_all_substring_locations_case_insensitive, KeyCode_F, KeyCode_Control);
Bind(goto_line, KeyCode_G, KeyCode_Command);
Bind(list_all_locations_of_selection, KeyCode_G, KeyCode_Command, KeyCode_Shift);
Bind(snippet_lister, KeyCode_J, KeyCode_Command);
Bind(kill_buffer, KeyCode_K, KeyCode_Command, KeyCode_Shift);
Bind(duplicate_line, KeyCode_L, KeyCode_Command);
Bind(cursor_mark_swap, KeyCode_M, KeyCode_Command);
Bind(reopen, KeyCode_O, KeyCode_Command, KeyCode_Shift);
Bind(query_replace, KeyCode_Q, KeyCode_Command);
Bind(query_replace_identifier, KeyCode_Q, KeyCode_Command, KeyCode_Shift);
Bind(query_replace_selection, KeyCode_Q, KeyCode_Control);
Bind(reverse_search, KeyCode_R, KeyCode_Command);
Bind(save, KeyCode_S, KeyCode_Command);
Bind(save_all_dirty_buffers, KeyCode_S, KeyCode_Command, KeyCode_Shift);
Bind(search_identifier, KeyCode_T, KeyCode_Command);
Bind(list_all_locations_of_identifier, KeyCode_T, KeyCode_Command, KeyCode_Shift);
Bind(paste_and_indent, KeyCode_V, KeyCode_Command);
Bind(paste_next_and_indent, KeyCode_V, KeyCode_Command, KeyCode_Shift);
Bind(cut, KeyCode_X, KeyCode_Command);
Bind(redo, KeyCode_Y, KeyCode_Command);
Bind(undo, KeyCode_Z, KeyCode_Command);
Bind(view_buffer_other_panel, KeyCode_1, KeyCode_Command);
Bind(swap_panels, KeyCode_2, KeyCode_Command);
Bind(if_read_only_goto_position, KeyCode_Return);
Bind(if_read_only_goto_position_same_panel, KeyCode_Return, KeyCode_Shift);
Bind(view_jump_list_with_lister, KeyCode_Period, KeyCode_Command, KeyCode_Shift);
SelectMap(code_id);
ParentMap(file_id);
BindTextInput(write_text_and_auto_indent);
Bind(move_left_alpha_numeric_boundary, KeyCode_Left, KeyCode_Command);
Bind(move_right_alpha_numeric_boundary, KeyCode_Right, KeyCode_Command);
Bind(move_left_alpha_numeric_or_camel_boundary, KeyCode_Left, KeyCode_Control);
Bind(move_right_alpha_numeric_or_camel_boundary, KeyCode_Right, KeyCode_Control);
Bind(comment_line_toggle, KeyCode_Semicolon, KeyCode_Command);
Bind(word_complete, KeyCode_Tab);
Bind(auto_indent_range, KeyCode_Tab, KeyCode_Command);
Bind(auto_indent_line_at_cursor, KeyCode_Tab, KeyCode_Shift);
Bind(word_complete_drop_down, KeyCode_Tab, KeyCode_Shift, KeyCode_Command);
Bind(write_block, KeyCode_R, KeyCode_Control);
Bind(write_todo, KeyCode_T, KeyCode_Control);
Bind(write_note, KeyCode_Y, KeyCode_Control);
Bind(list_all_locations_of_type_definition, KeyCode_D, KeyCode_Control);
Bind(list_all_locations_of_type_definition_of_identifier, KeyCode_T, KeyCode_Control, KeyCode_Shift);
Bind(open_long_braces, KeyCode_LeftBracket, KeyCode_Command);
Bind(open_long_braces_semicolon, KeyCode_LeftBracket, KeyCode_Command, KeyCode_Shift);
Bind(open_long_braces_break, KeyCode_RightBracket, KeyCode_Command, KeyCode_Shift);
Bind(select_surrounding_scope, KeyCode_LeftBracket, KeyCode_Control);
Bind(select_surrounding_scope_maximal, KeyCode_LeftBracket, KeyCode_Control, KeyCode_Shift);
Bind(select_prev_scope_absolute, KeyCode_RightBracket, KeyCode_Control);
Bind(select_prev_top_most_scope, KeyCode_RightBracket, KeyCode_Control, KeyCode_Shift);
Bind(select_next_scope_absolute, KeyCode_Quote, KeyCode_Control);
Bind(select_next_scope_after_current, KeyCode_Quote, KeyCode_Control, KeyCode_Shift);
Bind(place_in_scope, KeyCode_ForwardSlash, KeyCode_Control);
Bind(delete_current_scope, KeyCode_Minus, KeyCode_Control);
Bind(if0_off, KeyCode_I, KeyCode_Control);
Bind(open_file_in_quotes, KeyCode_1, KeyCode_Control);
Bind(open_matching_file_cpp, KeyCode_2, KeyCode_Control);
Bind(write_zero_struct, KeyCode_0, KeyCode_Command);
}
// BOTTOM

View File

@ -5,7 +5,10 @@
// TOP // TOP
#include <stdlib.h> #include <stdlib.h>
#if !OS_MAC
# include <malloc.h> # include <malloc.h>
#endif
internal void* internal void*
base_reserve__malloc(void *user_data, u64 size, u64 *size_out, String_Const_u8 location){ base_reserve__malloc(void *user_data, u64 size, u64 *size_out, String_Const_u8 location){

View File

@ -91,17 +91,20 @@ internal String_Const_u8_Array
user_list_definition_array(Application_Links *app, Arena *arena, String_Const_u8 base_needle){ user_list_definition_array(Application_Links *app, Arena *arena, String_Const_u8 base_needle){
String_Const_u8_Array result = {}; String_Const_u8_Array result = {};
if (base_needle.size > 0){ if (base_needle.size > 0){
result.count = 9; result.count = 12;
result.vals = push_array(arena, String_Const_u8, result.count); result.vals = push_array(arena, String_Const_u8, result.count);
i32 i = 0; i32 i = 0;
result.vals[i++] = (push_u8_stringf(arena, "struct %.*s{" , string_expand(base_needle))); result.vals[i++] = (push_u8_stringf(arena, "struct %.*s{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "struct %.*s\n{", string_expand(base_needle))); result.vals[i++] = (push_u8_stringf(arena, "struct %.*s\n{", string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "struct %.*s\r\n{", string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "struct %.*s {" , string_expand(base_needle))); result.vals[i++] = (push_u8_stringf(arena, "struct %.*s {" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "union %.*s{" , string_expand(base_needle))); result.vals[i++] = (push_u8_stringf(arena, "union %.*s{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "union %.*s\n{" , string_expand(base_needle))); result.vals[i++] = (push_u8_stringf(arena, "union %.*s\n{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "union %.*s\r\n{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "union %.*s {" , string_expand(base_needle))); result.vals[i++] = (push_u8_stringf(arena, "union %.*s {" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "enum %.*s{" , string_expand(base_needle))); result.vals[i++] = (push_u8_stringf(arena, "enum %.*s{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "enum %.*s\n{" , string_expand(base_needle))); result.vals[i++] = (push_u8_stringf(arena, "enum %.*s\n{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "enum %.*s\r\n{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "enum %.*s {" , string_expand(base_needle))); result.vals[i++] = (push_u8_stringf(arena, "enum %.*s {" , string_expand(base_needle)));
Assert(i == result.count); Assert(i == result.count);
} }

View File

@ -121,7 +121,7 @@ tutorial_render(Application_Links *app, Frame_Info frame_info, View_ID view_id){
View_ID active_view = get_active_view(app, Access_Always); View_ID active_view = get_active_view(app, Access_Always);
b32 is_active_view = (active_view == view_id); b32 is_active_view = (active_view == view_id);
FColor margin_color = get_margin_color(is_active_view?UIHighlight_Active:UIHighlight_None); FColor margin_color = get_panel_margin_color(is_active_view?UIHighlight_Active:UIHighlight_None);
Rect_f32 region = draw_background_and_margin(app, view_id, margin_color, margin_color); Rect_f32 region = draw_background_and_margin(app, view_id, margin_color, margin_color);
Rect_f32 prev_clip = draw_set_clip(app, region); Rect_f32 prev_clip = draw_set_clip(app, region);

View File

@ -178,6 +178,7 @@ enum{
BufferSetting_Unimportant, BufferSetting_Unimportant,
BufferSetting_ReadOnly, BufferSetting_ReadOnly,
BufferSetting_RecordsHistory, BufferSetting_RecordsHistory,
BufferSetting_Unkillable,
}; };
api(custom) api(custom)
@ -707,6 +708,7 @@ struct Layout_Item{
u32 codepoint; u32 codepoint;
Layout_Item_Flag flags; Layout_Item_Flag flags;
Rect_f32 rect; Rect_f32 rect;
f32 padded_y1;
}; };
api(custom) api(custom)
@ -777,4 +779,3 @@ struct Process_State{
}; };
#endif #endif

View File

@ -1,6 +1,6 @@
#define MAJOR 4 #define MAJOR 4
#define MINOR 1 #define MINOR 1
#define PATCH 0 #define PATCH 2
// string // string
#define VN__(a,b,c) #a "." #b "." #c #define VN__(a,b,c) #a "." #b "." #c

View File

@ -0,0 +1,30 @@
#!/bin/bash
# If any command errors, stop the script
set -e
# Store the real CWD
ME="$(realpath "$0")"
LOCATION="$(dirname "$ME")"
CODE_HOME="$(dirname "$LOCATION")"
# Find the most reasonable candidate build file
SOURCE="$1"
if [ -z "$SOURCE" ]; then
SOURCE="$(realpath "$CODE_HOME/4coder_default_bindings.cpp")"
fi
# NOTE(yuval): Removed -Wno-writable-strings as it is the same as -Wno-write-strings
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g"
arch=-m64
preproc_file=4coder_command_metadata.i
meta_macros="-DMETA_PASS"
clang++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=gnu++0x "$SOURCE" -E -o $preproc_file
clang++ -I"$CODE_HOME" $opts $debug -std=gnu++0x "$CODE_HOME/4coder_metadata_generator.cpp" -o "$CODE_HOME/metadata_generator"
"$CODE_HOME/metadata_generator" -R "$CODE_HOME" "$PWD/$preproc_file"
clang++ -I"$CODE_HOME" $arch $opts $debug -std=c++11 "$SOURCE" -shared -o custom_4coder.so -fPIC
rm "$CODE_HOME/metadata_generator"
rm $preproc_file

View File

@ -0,0 +1,30 @@
#!/bin/bash
# If any command errors, stop the script
set -e
# Store the real CWD
ME="$(realpath "$0")"
LOCATION="$(dirname "$ME")"
CODE_HOME="$(dirname "$LOCATION")"
# Find the most reasonable candidate build file
SOURCE="$1"
if [ -z "$SOURCE" ]; then
SOURCE="$(readlink -f "$CODE_HOME/4coder_default_bindings.cpp")"
fi
# NOTE(yuval): Removed -Wno-writable-strings as it is the same as -Wno-write-strings
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g"
arch=-m32
preproc_file=4coder_command_metadata.i
meta_macros="-DMETA_PASS"
clang++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=gnu++0x "$SOURCE" -E -o $preproc_file
clang++ -I"$CODE_HOME" $opts $debug -std=gnu++0x "$CODE_HOME/4coder_metadata_generator.cpp" -o "$CODE_HOME/metadata_generator"
"$CODE_HOME/metadata_generator" -R "$CODE_HOME" "$PWD/$preproc_file"
clang++ -I"$CODE_HOME" $arch $opts $debug -std=c++11 "$SOURCE" -shared -o custom_4coder.so -fPIC
rm "$CODE_HOME/metadata_generator"
rm $preproc_file

View File

@ -22,3 +22,10 @@ IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcv
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1)) IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1))
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1))
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1))

View File

@ -2,7 +2,7 @@
#define command_id(c) (fcoder_metacmd_ID_##c) #define command_id(c) (fcoder_metacmd_ID_##c)
#define command_metadata(c) (&fcoder_metacmd_table[command_id(c)]) #define command_metadata(c) (&fcoder_metacmd_table[command_id(c)])
#define command_metadata_by_id(id) (&fcoder_metacmd_table[id]) #define command_metadata_by_id(id) (&fcoder_metacmd_table[id])
#define command_one_past_last_id 229 #define command_one_past_last_id 231
#if defined(CUSTOM_COMMAND_SIG) #if defined(CUSTOM_COMMAND_SIG)
#define PROC_LINKS(x,y) x #define PROC_LINKS(x,y) x
#else #else
@ -99,6 +99,7 @@ CUSTOM_COMMAND_SIG(list_all_locations_of_type_definition_of_identifier);
CUSTOM_COMMAND_SIG(list_all_substring_locations); CUSTOM_COMMAND_SIG(list_all_substring_locations);
CUSTOM_COMMAND_SIG(list_all_substring_locations_case_insensitive); CUSTOM_COMMAND_SIG(list_all_substring_locations_case_insensitive);
CUSTOM_COMMAND_SIG(load_project); CUSTOM_COMMAND_SIG(load_project);
CUSTOM_COMMAND_SIG(load_theme_current_buffer);
CUSTOM_COMMAND_SIG(load_themes_default_folder); CUSTOM_COMMAND_SIG(load_themes_default_folder);
CUSTOM_COMMAND_SIG(load_themes_hot_directory); CUSTOM_COMMAND_SIG(load_themes_hot_directory);
CUSTOM_COMMAND_SIG(make_directory_query); CUSTOM_COMMAND_SIG(make_directory_query);
@ -206,6 +207,7 @@ CUSTOM_COMMAND_SIG(snipe_forward_whitespace_or_token_boundary);
CUSTOM_COMMAND_SIG(snippet_lister); CUSTOM_COMMAND_SIG(snippet_lister);
CUSTOM_COMMAND_SIG(suppress_mouse); CUSTOM_COMMAND_SIG(suppress_mouse);
CUSTOM_COMMAND_SIG(swap_panels); CUSTOM_COMMAND_SIG(swap_panels);
CUSTOM_COMMAND_SIG(test_double_backspace);
CUSTOM_COMMAND_SIG(theme_lister); CUSTOM_COMMAND_SIG(theme_lister);
CUSTOM_COMMAND_SIG(to_lowercase); CUSTOM_COMMAND_SIG(to_lowercase);
CUSTOM_COMMAND_SIG(to_uppercase); CUSTOM_COMMAND_SIG(to_uppercase);
@ -250,236 +252,238 @@ char *source_name;
i32 source_name_len; i32 source_name_len;
i32 line_number; i32 line_number;
}; };
static Command_Metadata fcoder_metacmd_table[229] = { static Command_Metadata fcoder_metacmd_table[231] = {
{ PROC_LINKS(allow_mouse, 0), false, "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "../code/custom/4coder_default_framework.cpp", 43, 409 }, { PROC_LINKS(allow_mouse, 0), false, "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 409 },
{ PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "../code/custom/4coder_auto_indent.cpp", 37, 375 }, { PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "c:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 407 },
{ PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "../code/custom/4coder_auto_indent.cpp", 37, 385 }, { PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "c:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 417 },
{ PROC_LINKS(auto_indent_whole_file, 0), false, "auto_indent_whole_file", 22, "Audo-indents the entire current buffer.", 39, "../code/custom/4coder_auto_indent.cpp", 37, 366 }, { PROC_LINKS(auto_indent_whole_file, 0), false, "auto_indent_whole_file", 22, "Audo-indents the entire current buffer.", 39, "c:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 398 },
{ PROC_LINKS(backspace_alpha_numeric_boundary, 0), false, "backspace_alpha_numeric_boundary", 32, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "../code/custom/4coder_base_commands.cpp", 39, 154 }, { PROC_LINKS(backspace_alpha_numeric_boundary, 0), false, "backspace_alpha_numeric_boundary", 32, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 165 },
{ PROC_LINKS(backspace_char, 0), false, "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "../code/custom/4coder_base_commands.cpp", 39, 96 }, { PROC_LINKS(backspace_char, 0), false, "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 96 },
{ PROC_LINKS(basic_change_active_panel, 0), false, "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "../code/custom/4coder_base_commands.cpp", 39, 613 }, { PROC_LINKS(basic_change_active_panel, 0), false, "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 622 },
{ PROC_LINKS(build_in_build_panel, 0), false, "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "../code/custom/4coder_build_commands.cpp", 40, 165 }, { PROC_LINKS(build_in_build_panel, 0), false, "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "c:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 159 },
{ PROC_LINKS(build_search, 0), false, "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "../code/custom/4coder_build_commands.cpp", 40, 128 }, { PROC_LINKS(build_search, 0), false, "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "c:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 122 },
{ PROC_LINKS(center_view, 0), false, "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "../code/custom/4coder_base_commands.cpp", 39, 197 }, { PROC_LINKS(center_view, 0), false, "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 208 },
{ PROC_LINKS(change_active_panel, 0), false, "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "../code/custom/4coder_default_framework.cpp", 43, 284 }, { PROC_LINKS(change_active_panel, 0), false, "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 284 },
{ PROC_LINKS(change_active_panel_backwards, 0), false, "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "../code/custom/4coder_default_framework.cpp", 43, 290 }, { PROC_LINKS(change_active_panel_backwards, 0), false, "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 290 },
{ PROC_LINKS(change_to_build_panel, 0), false, "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "../code/custom/4coder_build_commands.cpp", 40, 186 }, { PROC_LINKS(change_to_build_panel, 0), false, "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "c:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 180 },
{ PROC_LINKS(clean_all_lines, 0), false, "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "../code/custom/4coder_base_commands.cpp", 39, 578 }, { PROC_LINKS(clean_all_lines, 0), false, "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 587 },
{ PROC_LINKS(clear_all_themes, 0), false, "clear_all_themes", 16, "Clear the theme list", 20, "../code/custom/4coder_default_framework.cpp", 43, 480 }, { PROC_LINKS(clear_all_themes, 0), false, "clear_all_themes", 16, "Clear the theme list", 20, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 480 },
{ PROC_LINKS(click_set_cursor, 0), false, "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "../code/custom/4coder_base_commands.cpp", 39, 233 }, { PROC_LINKS(click_set_cursor, 0), false, "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 244 },
{ PROC_LINKS(click_set_cursor_and_mark, 0), false, "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "../code/custom/4coder_base_commands.cpp", 39, 223 }, { PROC_LINKS(click_set_cursor_and_mark, 0), false, "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 234 },
{ PROC_LINKS(click_set_cursor_if_lbutton, 0), false, "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "../code/custom/4coder_base_commands.cpp", 39, 243 }, { PROC_LINKS(click_set_cursor_if_lbutton, 0), false, "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 254 },
{ PROC_LINKS(click_set_mark, 0), false, "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "../code/custom/4coder_base_commands.cpp", 39, 255 }, { PROC_LINKS(click_set_mark, 0), false, "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 266 },
{ PROC_LINKS(close_all_code, 0), false, "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "../code/custom/4coder_project_commands.cpp", 42, 842 }, { PROC_LINKS(close_all_code, 0), false, "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 842 },
{ PROC_LINKS(close_build_panel, 0), false, "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "../code/custom/4coder_build_commands.cpp", 40, 180 }, { PROC_LINKS(close_build_panel, 0), false, "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "c:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 174 },
{ PROC_LINKS(close_panel, 0), false, "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "../code/custom/4coder_base_commands.cpp", 39, 621 }, { PROC_LINKS(close_panel, 0), false, "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 630 },
{ PROC_LINKS(command_documentation, 0), true, "command_documentation", 21, "Prompts the user to select a command then loads a doc buffer for that item", 74, "../code/custom/4coder_docs.cpp", 30, 190 }, { PROC_LINKS(command_documentation, 0), true, "command_documentation", 21, "Prompts the user to select a command then loads a doc buffer for that item", 74, "c:\\4ed\\code\\custom\\4coder_docs.cpp", 34, 190 },
{ PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "../code/custom/4coder_lists.cpp", 31, 668 }, { PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 761 },
{ PROC_LINKS(comment_line, 0), false, "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "../code/custom/4coder_combined_write_commands.cpp", 49, 125 }, { PROC_LINKS(comment_line, 0), false, "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 125 },
{ PROC_LINKS(comment_line_toggle, 0), false, "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "../code/custom/4coder_combined_write_commands.cpp", 49, 149 }, { PROC_LINKS(comment_line_toggle, 0), false, "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 149 },
{ PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "../code/custom/4coder_clipboard.cpp", 35, 19 }, { PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 19 },
{ PROC_LINKS(cursor_mark_swap, 0), false, "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "../code/custom/4coder_base_commands.cpp", 39, 124 }, { PROC_LINKS(cursor_mark_swap, 0), false, "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 135 },
{ PROC_LINKS(custom_api_documentation, 0), true, "custom_api_documentation", 24, "Prompts the user to select a Custom API item then loads a doc buffer for that item", 82, "../code/custom/4coder_docs.cpp", 30, 175 }, { PROC_LINKS(custom_api_documentation, 0), true, "custom_api_documentation", 24, "Prompts the user to select a Custom API item then loads a doc buffer for that item", 82, "c:\\4ed\\code\\custom\\4coder_docs.cpp", 34, 175 },
{ PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "../code/custom/4coder_clipboard.cpp", 35, 28 }, { PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 28 },
{ PROC_LINKS(decrease_face_size, 0), false, "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "../code/custom/4coder_base_commands.cpp", 39, 684 }, { PROC_LINKS(decrease_face_size, 0), false, "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 693 },
{ PROC_LINKS(default_file_externally_modified, 0), false, "default_file_externally_modified", 32, "Notes the external modification of attached files by printing a message.", 72, "../code/custom/4coder_base_commands.cpp", 39, 1798 }, { PROC_LINKS(default_file_externally_modified, 0), false, "default_file_externally_modified", 32, "Notes the external modification of attached files by printing a message.", 72, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1804 },
{ PROC_LINKS(default_startup, 0), false, "default_startup", 15, "Default command for responding to a startup event", 49, "../code/custom/4coder_default_hooks.cpp", 39, 7 }, { PROC_LINKS(default_startup, 0), false, "default_startup", 15, "Default command for responding to a startup event", 49, "c:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 7 },
{ PROC_LINKS(default_try_exit, 0), false, "default_try_exit", 16, "Default command for responding to a try-exit event", 50, "../code/custom/4coder_default_hooks.cpp", 39, 23 }, { PROC_LINKS(default_try_exit, 0), false, "default_try_exit", 16, "Default command for responding to a try-exit event", 50, "c:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 23 },
{ PROC_LINKS(default_view_input_handler, 0), false, "default_view_input_handler", 26, "Input consumption loop for default view behavior", 48, "../code/custom/4coder_default_hooks.cpp", 39, 57 }, { PROC_LINKS(default_view_input_handler, 0), false, "default_view_input_handler", 26, "Input consumption loop for default view behavior", 48, "c:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 51 },
{ PROC_LINKS(delete_alpha_numeric_boundary, 0), false, "delete_alpha_numeric_boundary", 29, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "../code/custom/4coder_base_commands.cpp", 39, 162 }, { PROC_LINKS(delete_alpha_numeric_boundary, 0), false, "delete_alpha_numeric_boundary", 29, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 173 },
{ PROC_LINKS(delete_char, 0), false, "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "../code/custom/4coder_base_commands.cpp", 39, 79 }, { PROC_LINKS(delete_char, 0), false, "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 79 },
{ PROC_LINKS(delete_current_scope, 0), false, "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "../code/custom/4coder_scope_commands.cpp", 40, 112 }, { PROC_LINKS(delete_current_scope, 0), false, "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 112 },
{ PROC_LINKS(delete_file_query, 0), false, "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "../code/custom/4coder_base_commands.cpp", 39, 1221 }, { PROC_LINKS(delete_file_query, 0), false, "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1230 },
{ PROC_LINKS(delete_line, 0), false, "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "../code/custom/4coder_base_commands.cpp", 39, 1396 }, { PROC_LINKS(delete_line, 0), false, "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1402 },
{ PROC_LINKS(delete_range, 0), false, "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "../code/custom/4coder_base_commands.cpp", 39, 134 }, { PROC_LINKS(delete_range, 0), false, "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 145 },
{ PROC_LINKS(duplicate_line, 0), false, "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "../code/custom/4coder_base_commands.cpp", 39, 1382 }, { PROC_LINKS(duplicate_line, 0), false, "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1388 },
{ PROC_LINKS(execute_any_cli, 0), false, "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "../code/custom/4coder_cli_command.cpp", 37, 22 }, { PROC_LINKS(execute_any_cli, 0), false, "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "c:\\4ed\\code\\custom\\4coder_cli_command.cpp", 41, 22 },
{ PROC_LINKS(execute_previous_cli, 0), false, "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "../code/custom/4coder_cli_command.cpp", 37, 7 }, { PROC_LINKS(execute_previous_cli, 0), false, "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "c:\\4ed\\code\\custom\\4coder_cli_command.cpp", 41, 7 },
{ PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "../code/custom/4coder_base_commands.cpp", 39, 740 }, { PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 749 },
{ PROC_LINKS(goto_beginning_of_file, 0), false, "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "../code/custom/4coder_helper.cpp", 32, 2184 }, { PROC_LINKS(goto_beginning_of_file, 0), false, "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2184 },
{ PROC_LINKS(goto_end_of_file, 0), false, "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "../code/custom/4coder_helper.cpp", 32, 2192 }, { PROC_LINKS(goto_end_of_file, 0), false, "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2192 },
{ PROC_LINKS(goto_first_jump, 0), false, "goto_first_jump", 15, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "../code/custom/4coder_jump_sticky.cpp", 37, 523 }, { PROC_LINKS(goto_first_jump, 0), false, "goto_first_jump", 15, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 525 },
{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), false, "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "../code/custom/4coder_jump_sticky.cpp", 37, 540 }, { PROC_LINKS(goto_first_jump_same_panel_sticky, 0), false, "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 542 },
{ PROC_LINKS(goto_jump_at_cursor, 0), false, "goto_jump_at_cursor", 19, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "../code/custom/4coder_jump_sticky.cpp", 37, 346 }, { PROC_LINKS(goto_jump_at_cursor, 0), false, "goto_jump_at_cursor", 19, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 348 },
{ PROC_LINKS(goto_jump_at_cursor_same_panel, 0), false, "goto_jump_at_cursor_same_panel", 30, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "../code/custom/4coder_jump_sticky.cpp", 37, 373 }, { PROC_LINKS(goto_jump_at_cursor_same_panel, 0), false, "goto_jump_at_cursor_same_panel", 30, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 375 },
{ PROC_LINKS(goto_line, 0), false, "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "../code/custom/4coder_base_commands.cpp", 39, 748 }, { PROC_LINKS(goto_line, 0), false, "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 757 },
{ PROC_LINKS(goto_next_jump, 0), false, "goto_next_jump", 14, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "../code/custom/4coder_jump_sticky.cpp", 37, 462 }, { PROC_LINKS(goto_next_jump, 0), false, "goto_next_jump", 14, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 464 },
{ PROC_LINKS(goto_next_jump_no_skips, 0), false, "goto_next_jump_no_skips", 23, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "../code/custom/4coder_jump_sticky.cpp", 37, 492 }, { PROC_LINKS(goto_next_jump_no_skips, 0), false, "goto_next_jump_no_skips", 23, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 494 },
{ PROC_LINKS(goto_prev_jump, 0), false, "goto_prev_jump", 14, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "../code/custom/4coder_jump_sticky.cpp", 37, 479 }, { PROC_LINKS(goto_prev_jump, 0), false, "goto_prev_jump", 14, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 481 },
{ PROC_LINKS(goto_prev_jump_no_skips, 0), false, "goto_prev_jump_no_skips", 23, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "../code/custom/4coder_jump_sticky.cpp", 37, 509 }, { PROC_LINKS(goto_prev_jump_no_skips, 0), false, "goto_prev_jump_no_skips", 23, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 511 },
{ PROC_LINKS(hide_filebar, 0), false, "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "../code/custom/4coder_base_commands.cpp", 39, 651 }, { PROC_LINKS(hide_filebar, 0), false, "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 660 },
{ PROC_LINKS(hide_scrollbar, 0), false, "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "../code/custom/4coder_base_commands.cpp", 39, 637 }, { PROC_LINKS(hide_scrollbar, 0), false, "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 646 },
{ PROC_LINKS(hms_demo_tutorial, 0), false, "hms_demo_tutorial", 17, "Tutorial for built in 4coder bindings and features.", 51, "../code/custom/4coder_tutorial.cpp", 34, 869 }, { PROC_LINKS(hms_demo_tutorial, 0), false, "hms_demo_tutorial", 17, "Tutorial for built in 4coder bindings and features.", 51, "c:\\4ed\\code\\custom\\4coder_tutorial.cpp", 38, 869 },
{ PROC_LINKS(if0_off, 0), false, "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "../code/custom/4coder_combined_write_commands.cpp", 49, 70 }, { PROC_LINKS(if0_off, 0), false, "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 70 },
{ PROC_LINKS(if_read_only_goto_position, 0), false, "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, "../code/custom/4coder_jump_sticky.cpp", 37, 562 }, { PROC_LINKS(if_read_only_goto_position, 0), false, "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, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 564 },
{ PROC_LINKS(if_read_only_goto_position_same_panel, 0), false, "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, "../code/custom/4coder_jump_sticky.cpp", 37, 579 }, { PROC_LINKS(if_read_only_goto_position_same_panel, 0), false, "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, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 581 },
{ PROC_LINKS(increase_face_size, 0), false, "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "../code/custom/4coder_base_commands.cpp", 39, 673 }, { PROC_LINKS(increase_face_size, 0), false, "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 682 },
{ PROC_LINKS(interactive_kill_buffer, 0), true, "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "../code/custom/4coder_lists.cpp", 31, 515 }, { PROC_LINKS(interactive_kill_buffer, 0), true, "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 520 },
{ PROC_LINKS(interactive_new, 0), true, "interactive_new", 15, "Interactively creates a new file.", 33, "../code/custom/4coder_lists.cpp", 31, 597 }, { PROC_LINKS(interactive_new, 0), true, "interactive_new", 15, "Interactively creates a new file.", 33, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 661 },
{ PROC_LINKS(interactive_open, 0), true, "interactive_open", 16, "Interactively opens a file.", 27, "../code/custom/4coder_lists.cpp", 31, 634 }, { PROC_LINKS(interactive_open, 0), true, "interactive_open", 16, "Interactively opens a file.", 27, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 715 },
{ PROC_LINKS(interactive_open_or_new, 0), true, "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "../code/custom/4coder_lists.cpp", 31, 563 }, { PROC_LINKS(interactive_open_or_new, 0), true, "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 612 },
{ PROC_LINKS(interactive_switch_buffer, 0), true, "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "../code/custom/4coder_lists.cpp", 31, 505 }, { PROC_LINKS(interactive_switch_buffer, 0), true, "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 510 },
{ PROC_LINKS(jump_to_definition, 0), true, "jump_to_definition", 18, "List all definitions in the code index and jump to one chosen by the user.", 74, "../code/custom/4coder_code_index_listers.cpp", 44, 12 }, { PROC_LINKS(jump_to_definition, 0), true, "jump_to_definition", 18, "List all definitions in the code index and jump to one chosen by the user.", 74, "c:\\4ed\\code\\custom\\4coder_code_index_listers.cpp", 48, 12 },
{ PROC_LINKS(keyboard_macro_finish_recording, 0), false, "keyboard_macro_finish_recording", 31, "Stop macro recording, do nothing if macro recording is not already started", 74, "../code/custom/4coder_keyboard_macro.cpp", 40, 57 }, { PROC_LINKS(keyboard_macro_finish_recording, 0), false, "keyboard_macro_finish_recording", 31, "Stop macro recording, do nothing if macro recording is not already started", 74, "c:\\4ed\\code\\custom\\4coder_keyboard_macro.cpp", 44, 54 },
{ PROC_LINKS(keyboard_macro_replay, 0), false, "keyboard_macro_replay", 21, "Replay the most recently recorded keyboard macro", 48, "../code/custom/4coder_keyboard_macro.cpp", 40, 80 }, { PROC_LINKS(keyboard_macro_replay, 0), false, "keyboard_macro_replay", 21, "Replay the most recently recorded keyboard macro", 48, "c:\\4ed\\code\\custom\\4coder_keyboard_macro.cpp", 44, 77 },
{ PROC_LINKS(keyboard_macro_start_recording, 0), false, "keyboard_macro_start_recording", 30, "Start macro recording, do nothing if macro recording is already started", 71, "../code/custom/4coder_keyboard_macro.cpp", 40, 44 }, { PROC_LINKS(keyboard_macro_start_recording, 0), false, "keyboard_macro_start_recording", 30, "Start macro recording, do nothing if macro recording is already started", 71, "c:\\4ed\\code\\custom\\4coder_keyboard_macro.cpp", 44, 41 },
{ PROC_LINKS(kill_buffer, 0), false, "kill_buffer", 11, "Kills the current buffer.", 25, "../code/custom/4coder_base_commands.cpp", 39, 1542 }, { PROC_LINKS(kill_buffer, 0), false, "kill_buffer", 11, "Kills the current buffer.", 25, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1548 },
{ PROC_LINKS(kill_tutorial, 0), false, "kill_tutorial", 13, "If there is an active tutorial, kill it.", 40, "../code/custom/4coder_tutorial.cpp", 34, 9 }, { PROC_LINKS(kill_tutorial, 0), false, "kill_tutorial", 13, "If there is an active tutorial, kill it.", 40, "c:\\4ed\\code\\custom\\4coder_tutorial.cpp", 38, 9 },
{ PROC_LINKS(left_adjust_view, 0), false, "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "../code/custom/4coder_base_commands.cpp", 39, 211 }, { PROC_LINKS(left_adjust_view, 0), false, "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 222 },
{ PROC_LINKS(list_all_functions_all_buffers, 0), false, "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "../code/custom/4coder_function_list.cpp", 39, 295 }, { PROC_LINKS(list_all_functions_all_buffers, 0), false, "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "c:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 296 },
{ PROC_LINKS(list_all_functions_all_buffers_lister, 0), false, "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "../code/custom/4coder_function_list.cpp", 39, 301 }, { PROC_LINKS(list_all_functions_all_buffers_lister, 0), false, "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "c:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 302 },
{ PROC_LINKS(list_all_functions_current_buffer, 0), false, "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "../code/custom/4coder_function_list.cpp", 39, 267 }, { PROC_LINKS(list_all_functions_current_buffer, 0), false, "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "c:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 267 },
{ PROC_LINKS(list_all_functions_current_buffer_lister, 0), false, "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "../code/custom/4coder_function_list.cpp", 39, 277 }, { PROC_LINKS(list_all_functions_current_buffer_lister, 0), false, "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "c:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 277 },
{ PROC_LINKS(list_all_locations, 0), false, "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "../code/custom/4coder_search.cpp", 32, 162 }, { PROC_LINKS(list_all_locations, 0), false, "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 165 },
{ PROC_LINKS(list_all_locations_case_insensitive, 0), false, "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "../code/custom/4coder_search.cpp", 32, 174 }, { PROC_LINKS(list_all_locations_case_insensitive, 0), false, "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 177 },
{ PROC_LINKS(list_all_locations_of_identifier, 0), false, "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "../code/custom/4coder_search.cpp", 32, 186 }, { PROC_LINKS(list_all_locations_of_identifier, 0), false, "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 189 },
{ PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), false, "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "../code/custom/4coder_search.cpp", 32, 192 }, { PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), false, "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 195 },
{ PROC_LINKS(list_all_locations_of_selection, 0), false, "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "../code/custom/4coder_search.cpp", 32, 198 }, { PROC_LINKS(list_all_locations_of_selection, 0), false, "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 201 },
{ PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), false, "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "../code/custom/4coder_search.cpp", 32, 204 }, { PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), false, "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 207 },
{ PROC_LINKS(list_all_locations_of_type_definition, 0), false, "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "../code/custom/4coder_search.cpp", 32, 210 }, { PROC_LINKS(list_all_locations_of_type_definition, 0), false, "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 213 },
{ PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), false, "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "../code/custom/4coder_search.cpp", 32, 218 }, { PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), false, "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 221 },
{ PROC_LINKS(list_all_substring_locations, 0), false, "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "../code/custom/4coder_search.cpp", 32, 168 }, { PROC_LINKS(list_all_substring_locations, 0), false, "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 171 },
{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), false, "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "../code/custom/4coder_search.cpp", 32, 180 }, { PROC_LINKS(list_all_substring_locations_case_insensitive, 0), false, "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 183 },
{ PROC_LINKS(load_project, 0), false, "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "../code/custom/4coder_project_commands.cpp", 42, 862 }, { PROC_LINKS(load_project, 0), false, "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 862 },
{ PROC_LINKS(load_themes_default_folder, 0), false, "load_themes_default_folder", 26, "Loads all the theme files in the default theme folder.", 54, "../code/custom/4coder_default_framework.cpp", 43, 457 }, { PROC_LINKS(load_theme_current_buffer, 0), false, "load_theme_current_buffer", 25, "Parse the current buffer as a theme file and add the theme to the theme list. If the buffer has a .4coder postfix in it's name, it is removed when the name is saved.", 165, "c:\\4ed\\code\\custom\\4coder_config.cpp", 36, 1622 },
{ PROC_LINKS(load_themes_hot_directory, 0), false, "load_themes_hot_directory", 25, "Loads all the theme files in the current hot directory.", 55, "../code/custom/4coder_default_framework.cpp", 43, 469 }, { PROC_LINKS(load_themes_default_folder, 0), false, "load_themes_default_folder", 26, "Loads all the theme files in the default theme folder.", 54, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 457 },
{ PROC_LINKS(make_directory_query, 0), false, "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "../code/custom/4coder_base_commands.cpp", 39, 1336 }, { PROC_LINKS(load_themes_hot_directory, 0), false, "load_themes_hot_directory", 25, "Loads all the theme files in the current hot directory.", 55, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 469 },
{ PROC_LINKS(miblo_decrement_basic, 0), false, "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "../code/custom/4coder_miblo_numbers.cpp", 39, 44 }, { PROC_LINKS(make_directory_query, 0), false, "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1342 },
{ PROC_LINKS(miblo_decrement_time_stamp, 0), false, "miblo_decrement_time_stamp", 26, "Decrement a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "../code/custom/4coder_miblo_numbers.cpp", 39, 237 }, { PROC_LINKS(miblo_decrement_basic, 0), false, "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 44 },
{ PROC_LINKS(miblo_decrement_time_stamp_minute, 0), false, "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "../code/custom/4coder_miblo_numbers.cpp", 39, 249 }, { PROC_LINKS(miblo_decrement_time_stamp, 0), false, "miblo_decrement_time_stamp", 26, "Decrement a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 237 },
{ PROC_LINKS(miblo_increment_basic, 0), false, "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "../code/custom/4coder_miblo_numbers.cpp", 39, 29 }, { PROC_LINKS(miblo_decrement_time_stamp_minute, 0), false, "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 249 },
{ PROC_LINKS(miblo_increment_time_stamp, 0), false, "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "../code/custom/4coder_miblo_numbers.cpp", 39, 231 }, { PROC_LINKS(miblo_increment_basic, 0), false, "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 29 },
{ PROC_LINKS(miblo_increment_time_stamp_minute, 0), false, "miblo_increment_time_stamp_minute", 33, "Increment a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "../code/custom/4coder_miblo_numbers.cpp", 39, 243 }, { PROC_LINKS(miblo_increment_time_stamp, 0), false, "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 231 },
{ PROC_LINKS(mouse_wheel_change_face_size, 0), false, "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "../code/custom/4coder_base_commands.cpp", 39, 695 }, { PROC_LINKS(miblo_increment_time_stamp_minute, 0), false, "miblo_increment_time_stamp_minute", 33, "Increment a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 243 },
{ PROC_LINKS(mouse_wheel_scroll, 0), false, "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "../code/custom/4coder_base_commands.cpp", 39, 265 }, { PROC_LINKS(mouse_wheel_change_face_size, 0), false, "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 704 },
{ PROC_LINKS(move_down, 0), false, "move_down", 9, "Moves the cursor down one line.", 31, "../code/custom/4coder_base_commands.cpp", 39, 338 }, { PROC_LINKS(mouse_wheel_scroll, 0), false, "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 276 },
{ PROC_LINKS(move_down_10, 0), false, "move_down_10", 12, "Moves the cursor down ten lines.", 32, "../code/custom/4coder_base_commands.cpp", 39, 350 }, { PROC_LINKS(move_down, 0), false, "move_down", 9, "Moves the cursor down one line.", 31, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 347 },
{ PROC_LINKS(move_down_textual, 0), false, "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "../code/custom/4coder_base_commands.cpp", 39, 356 }, { PROC_LINKS(move_down_10, 0), false, "move_down_10", 12, "Moves the cursor down ten lines.", 32, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 359 },
{ PROC_LINKS(move_down_to_blank_line, 0), false, "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "../code/custom/4coder_base_commands.cpp", 39, 409 }, { PROC_LINKS(move_down_textual, 0), false, "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 365 },
{ PROC_LINKS(move_down_to_blank_line_end, 0), false, "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "../code/custom/4coder_base_commands.cpp", 39, 433 }, { PROC_LINKS(move_down_to_blank_line, 0), false, "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 418 },
{ PROC_LINKS(move_down_to_blank_line_skip_whitespace, 0), false, "move_down_to_blank_line_skip_whitespace", 39, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "../code/custom/4coder_base_commands.cpp", 39, 421 }, { PROC_LINKS(move_down_to_blank_line_end, 0), false, "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 442 },
{ PROC_LINKS(move_left, 0), false, "move_left", 9, "Moves the cursor one character to the left.", 43, "../code/custom/4coder_base_commands.cpp", 39, 439 }, { PROC_LINKS(move_down_to_blank_line_skip_whitespace, 0), false, "move_down_to_blank_line_skip_whitespace", 39, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 430 },
{ PROC_LINKS(move_left_alpha_numeric_boundary, 0), false, "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "../code/custom/4coder_base_commands.cpp", 39, 516 }, { PROC_LINKS(move_left, 0), false, "move_left", 9, "Moves the cursor one character to the left.", 43, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 448 },
{ PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), false, "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "../code/custom/4coder_base_commands.cpp", 39, 530 }, { PROC_LINKS(move_left_alpha_numeric_boundary, 0), false, "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 525 },
{ PROC_LINKS(move_left_token_boundary, 0), false, "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "../code/custom/4coder_base_commands.cpp", 39, 488 }, { PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), false, "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 539 },
{ PROC_LINKS(move_left_whitespace_boundary, 0), false, "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "../code/custom/4coder_base_commands.cpp", 39, 473 }, { PROC_LINKS(move_left_token_boundary, 0), false, "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 497 },
{ PROC_LINKS(move_left_whitespace_or_token_boundary, 0), false, "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "../code/custom/4coder_base_commands.cpp", 39, 502 }, { PROC_LINKS(move_left_whitespace_boundary, 0), false, "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 482 },
{ PROC_LINKS(move_line_down, 0), false, "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "../code/custom/4coder_base_commands.cpp", 39, 1376 }, { PROC_LINKS(move_left_whitespace_or_token_boundary, 0), false, "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 511 },
{ PROC_LINKS(move_line_up, 0), false, "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "../code/custom/4coder_base_commands.cpp", 39, 1370 }, { PROC_LINKS(move_line_down, 0), false, "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1382 },
{ PROC_LINKS(move_right, 0), false, "move_right", 10, "Moves the cursor one character to the right.", 44, "../code/custom/4coder_base_commands.cpp", 39, 447 }, { PROC_LINKS(move_line_up, 0), false, "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1376 },
{ PROC_LINKS(move_right_alpha_numeric_boundary, 0), false, "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "../code/custom/4coder_base_commands.cpp", 39, 509 }, { PROC_LINKS(move_right, 0), false, "move_right", 10, "Moves the cursor one character to the right.", 44, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 456 },
{ PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), false, "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "../code/custom/4coder_base_commands.cpp", 39, 523 }, { PROC_LINKS(move_right_alpha_numeric_boundary, 0), false, "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 518 },
{ PROC_LINKS(move_right_token_boundary, 0), false, "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "../code/custom/4coder_base_commands.cpp", 39, 481 }, { PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), false, "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 532 },
{ PROC_LINKS(move_right_whitespace_boundary, 0), false, "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "../code/custom/4coder_base_commands.cpp", 39, 465 }, { PROC_LINKS(move_right_token_boundary, 0), false, "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 490 },
{ PROC_LINKS(move_right_whitespace_or_token_boundary, 0), false, "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "../code/custom/4coder_base_commands.cpp", 39, 495 }, { PROC_LINKS(move_right_whitespace_boundary, 0), false, "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 474 },
{ PROC_LINKS(move_up, 0), false, "move_up", 7, "Moves the cursor up one line.", 29, "../code/custom/4coder_base_commands.cpp", 39, 332 }, { PROC_LINKS(move_right_whitespace_or_token_boundary, 0), false, "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 504 },
{ PROC_LINKS(move_up_10, 0), false, "move_up_10", 10, "Moves the cursor up ten lines.", 30, "../code/custom/4coder_base_commands.cpp", 39, 344 }, { PROC_LINKS(move_up, 0), false, "move_up", 7, "Moves the cursor up one line.", 29, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 341 },
{ PROC_LINKS(move_up_to_blank_line, 0), false, "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "../code/custom/4coder_base_commands.cpp", 39, 403 }, { PROC_LINKS(move_up_10, 0), false, "move_up_10", 10, "Moves the cursor up ten lines.", 30, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 353 },
{ PROC_LINKS(move_up_to_blank_line_end, 0), false, "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "../code/custom/4coder_base_commands.cpp", 39, 427 }, { PROC_LINKS(move_up_to_blank_line, 0), false, "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 412 },
{ PROC_LINKS(move_up_to_blank_line_skip_whitespace, 0), false, "move_up_to_blank_line_skip_whitespace", 37, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "../code/custom/4coder_base_commands.cpp", 39, 415 }, { PROC_LINKS(move_up_to_blank_line_end, 0), false, "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 436 },
{ PROC_LINKS(open_all_code, 0), false, "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "../code/custom/4coder_project_commands.cpp", 42, 848 }, { PROC_LINKS(move_up_to_blank_line_skip_whitespace, 0), false, "move_up_to_blank_line_skip_whitespace", 37, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 424 },
{ PROC_LINKS(open_all_code_recursive, 0), false, "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "../code/custom/4coder_project_commands.cpp", 42, 854 }, { PROC_LINKS(open_all_code, 0), false, "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 848 },
{ PROC_LINKS(open_file_in_quotes, 0), false, "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "../code/custom/4coder_base_commands.cpp", 39, 1461 }, { PROC_LINKS(open_all_code_recursive, 0), false, "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 854 },
{ PROC_LINKS(open_in_other, 0), false, "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "../code/custom/4coder_base_commands.cpp", 39, 1792 }, { PROC_LINKS(open_file_in_quotes, 0), false, "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1467 },
{ PROC_LINKS(open_long_braces, 0), false, "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "../code/custom/4coder_combined_write_commands.cpp", 49, 46 }, { PROC_LINKS(open_in_other, 0), false, "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1798 },
{ PROC_LINKS(open_long_braces_break, 0), false, "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "../code/custom/4coder_combined_write_commands.cpp", 49, 62 }, { PROC_LINKS(open_long_braces, 0), false, "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 46 },
{ PROC_LINKS(open_long_braces_semicolon, 0), false, "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "../code/custom/4coder_combined_write_commands.cpp", 49, 54 }, { PROC_LINKS(open_long_braces_break, 0), false, "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 62 },
{ PROC_LINKS(open_matching_file_cpp, 0), false, "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "../code/custom/4coder_base_commands.cpp", 39, 1493 }, { PROC_LINKS(open_long_braces_semicolon, 0), false, "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 54 },
{ PROC_LINKS(open_panel_hsplit, 0), false, "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "../code/custom/4coder_default_framework.cpp", 43, 310 }, { PROC_LINKS(open_matching_file_cpp, 0), false, "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1499 },
{ PROC_LINKS(open_panel_vsplit, 0), false, "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "../code/custom/4coder_default_framework.cpp", 43, 300 }, { PROC_LINKS(open_panel_hsplit, 0), false, "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 310 },
{ PROC_LINKS(page_down, 0), false, "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "../code/custom/4coder_base_commands.cpp", 39, 374 }, { PROC_LINKS(open_panel_vsplit, 0), false, "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 300 },
{ PROC_LINKS(page_up, 0), false, "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "../code/custom/4coder_base_commands.cpp", 39, 366 }, { PROC_LINKS(page_down, 0), false, "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 383 },
{ PROC_LINKS(paste, 0), false, "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "../code/custom/4coder_clipboard.cpp", 35, 39 }, { PROC_LINKS(page_up, 0), false, "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 375 },
{ PROC_LINKS(paste_and_indent, 0), false, "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "../code/custom/4coder_clipboard.cpp", 35, 110 }, { PROC_LINKS(paste, 0), false, "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 39 },
{ PROC_LINKS(paste_next, 0), false, "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "../code/custom/4coder_clipboard.cpp", 35, 71 }, { PROC_LINKS(paste_and_indent, 0), false, "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 113 },
{ PROC_LINKS(paste_next_and_indent, 0), false, "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "../code/custom/4coder_clipboard.cpp", 35, 117 }, { PROC_LINKS(paste_next, 0), false, "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 72 },
{ PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "../code/custom/4coder_scope_commands.cpp", 40, 106 }, { PROC_LINKS(paste_next_and_indent, 0), false, "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 120 },
{ PROC_LINKS(profile_clear, 0), false, "profile_clear", 13, "Clear all profiling information from 4coder's self profiler.", 60, "../code/custom/4coder_profile.cpp", 33, 226 }, { PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 106 },
{ PROC_LINKS(profile_disable, 0), false, "profile_disable", 15, "Prevent 4coder's self profiler from gathering new profiling information.", 72, "../code/custom/4coder_profile.cpp", 33, 219 }, { PROC_LINKS(profile_clear, 0), false, "profile_clear", 13, "Clear all profiling information from 4coder's self profiler.", 60, "c:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 226 },
{ PROC_LINKS(profile_enable, 0), false, "profile_enable", 14, "Allow 4coder's self profiler to gather new profiling information.", 65, "../code/custom/4coder_profile.cpp", 33, 212 }, { PROC_LINKS(profile_disable, 0), false, "profile_disable", 15, "Prevent 4coder's self profiler from gathering new profiling information.", 72, "c:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 219 },
{ PROC_LINKS(profile_inspect, 0), true, "profile_inspect", 15, "Inspect all currently collected profiling information in 4coder's self profiler.", 80, "../code/custom/4coder_profile_inspect.cpp", 41, 886 }, { PROC_LINKS(profile_enable, 0), false, "profile_enable", 14, "Allow 4coder's self profiler to gather new profiling information.", 65, "c:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 212 },
{ PROC_LINKS(project_command_lister, 0), false, "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "../code/custom/4coder_project_commands.cpp", 42, 1289 }, { PROC_LINKS(profile_inspect, 0), true, "profile_inspect", 15, "Inspect all currently collected profiling information in 4coder's self profiler.", 80, "c:\\4ed\\code\\custom\\4coder_profile_inspect.cpp", 45, 886 },
{ PROC_LINKS(project_fkey_command, 0), false, "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "../code/custom/4coder_project_commands.cpp", 42, 870 }, { PROC_LINKS(project_command_lister, 0), false, "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1289 },
{ PROC_LINKS(project_go_to_root_directory, 0), false, "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "../code/custom/4coder_project_commands.cpp", 42, 896 }, { PROC_LINKS(project_fkey_command, 0), false, "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 870 },
{ PROC_LINKS(query_replace, 0), false, "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "../code/custom/4coder_base_commands.cpp", 39, 1149 }, { PROC_LINKS(project_go_to_root_directory, 0), false, "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 896 },
{ PROC_LINKS(query_replace_identifier, 0), false, "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "../code/custom/4coder_base_commands.cpp", 39, 1170 }, { PROC_LINKS(query_replace, 0), false, "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1158 },
{ PROC_LINKS(query_replace_selection, 0), false, "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "../code/custom/4coder_base_commands.cpp", 39, 1186 }, { PROC_LINKS(query_replace_identifier, 0), false, "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1179 },
{ PROC_LINKS(redo, 0), false, "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "../code/custom/4coder_base_commands.cpp", 39, 1631 }, { PROC_LINKS(query_replace_selection, 0), false, "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1195 },
{ PROC_LINKS(redo_all_buffers, 0), false, "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "../code/custom/4coder_base_commands.cpp", 39, 1716 }, { PROC_LINKS(redo, 0), false, "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1637 },
{ PROC_LINKS(rename_file_query, 0), false, "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "../code/custom/4coder_base_commands.cpp", 39, 1298 }, { PROC_LINKS(redo_all_buffers, 0), false, "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1722 },
{ PROC_LINKS(reopen, 0), false, "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "../code/custom/4coder_base_commands.cpp", 39, 1560 }, { PROC_LINKS(rename_file_query, 0), false, "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1307 },
{ PROC_LINKS(replace_in_all_buffers, 0), false, "replace_in_all_buffers", 22, "Queries the user for a needle and string. Replaces all occurences of needle with string in all editable buffers.", 112, "../code/custom/4coder_base_commands.cpp", 39, 1059 }, { PROC_LINKS(reopen, 0), false, "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1566 },
{ PROC_LINKS(replace_in_buffer, 0), false, "replace_in_buffer", 17, "Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.", 109, "../code/custom/4coder_base_commands.cpp", 39, 1050 }, { PROC_LINKS(replace_in_all_buffers, 0), false, "replace_in_all_buffers", 22, "Queries the user for a needle and string. Replaces all occurences of needle with string in all editable buffers.", 112, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1068 },
{ PROC_LINKS(replace_in_range, 0), false, "replace_in_range", 16, "Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.", 150, "../code/custom/4coder_base_commands.cpp", 39, 1041 }, { PROC_LINKS(replace_in_buffer, 0), false, "replace_in_buffer", 17, "Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.", 109, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1059 },
{ PROC_LINKS(reverse_search, 0), false, "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "../code/custom/4coder_base_commands.cpp", 39, 982 }, { PROC_LINKS(replace_in_range, 0), false, "replace_in_range", 16, "Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.", 150, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1050 },
{ PROC_LINKS(reverse_search_identifier, 0), false, "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "../code/custom/4coder_base_commands.cpp", 39, 994 }, { PROC_LINKS(reverse_search, 0), false, "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 991 },
{ PROC_LINKS(save, 0), false, "save", 4, "Saves the current buffer.", 25, "../code/custom/4coder_base_commands.cpp", 39, 1550 }, { PROC_LINKS(reverse_search_identifier, 0), false, "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1003 },
{ PROC_LINKS(save_all_dirty_buffers, 0), false, "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "../code/custom/4coder_default_framework.cpp", 43, 382 }, { PROC_LINKS(save, 0), false, "save", 4, "Saves the current buffer.", 25, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1556 },
{ PROC_LINKS(save_to_query, 0), false, "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "../code/custom/4coder_base_commands.cpp", 39, 1265 }, { PROC_LINKS(save_all_dirty_buffers, 0), false, "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 382 },
{ PROC_LINKS(search, 0), false, "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "../code/custom/4coder_base_commands.cpp", 39, 976 }, { PROC_LINKS(save_to_query, 0), false, "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1274 },
{ PROC_LINKS(search_identifier, 0), false, "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "../code/custom/4coder_base_commands.cpp", 39, 988 }, { PROC_LINKS(search, 0), false, "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 985 },
{ PROC_LINKS(seek_beginning_of_line, 0), false, "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "../code/custom/4coder_helper.cpp", 32, 2172 }, { PROC_LINKS(search_identifier, 0), false, "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 997 },
{ PROC_LINKS(seek_beginning_of_textual_line, 0), false, "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "../code/custom/4coder_helper.cpp", 32, 2160 }, { PROC_LINKS(seek_beginning_of_line, 0), false, "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2172 },
{ PROC_LINKS(seek_end_of_line, 0), false, "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "../code/custom/4coder_helper.cpp", 32, 2178 }, { PROC_LINKS(seek_beginning_of_textual_line, 0), false, "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2160 },
{ PROC_LINKS(seek_end_of_textual_line, 0), false, "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "../code/custom/4coder_helper.cpp", 32, 2166 }, { PROC_LINKS(seek_end_of_line, 0), false, "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2178 },
{ PROC_LINKS(select_all, 0), false, "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "../code/custom/4coder_base_commands.cpp", 39, 539 }, { PROC_LINKS(seek_end_of_textual_line, 0), false, "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2166 },
{ PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "../code/custom/4coder_scope_commands.cpp", 40, 57 }, { PROC_LINKS(select_all, 0), false, "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 548 },
{ PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "If a scope is selected, find first scope that starts after the selected scope. Otherwise find the first scope that starts after the cursor.", 139, "../code/custom/4coder_scope_commands.cpp", 40, 66 }, { PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 57 },
{ PROC_LINKS(select_prev_scope_absolute, 0), false, "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "../code/custom/4coder_scope_commands.cpp", 40, 82 }, { PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "If a scope is selected, find first scope that starts after the selected scope. Otherwise find the first scope that starts after the cursor.", 139, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 66 },
{ PROC_LINKS(select_prev_top_most_scope, 0), false, "select_prev_top_most_scope", 26, "Finds the first scope that starts before the cursor, then finds the top most scope that contains that scope.", 108, "../code/custom/4coder_scope_commands.cpp", 40, 99 }, { PROC_LINKS(select_prev_scope_absolute, 0), false, "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 82 },
{ PROC_LINKS(select_surrounding_scope, 0), false, "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "../code/custom/4coder_scope_commands.cpp", 40, 27 }, { PROC_LINKS(select_prev_top_most_scope, 0), false, "select_prev_top_most_scope", 26, "Finds the first scope that starts before the cursor, then finds the top most scope that contains that scope.", 108, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 99 },
{ PROC_LINKS(select_surrounding_scope_maximal, 0), false, "select_surrounding_scope_maximal", 32, "Selects the top-most scope that surrounds the cursor.", 53, "../code/custom/4coder_scope_commands.cpp", 40, 39 }, { PROC_LINKS(select_surrounding_scope, 0), false, "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 27 },
{ PROC_LINKS(set_eol_mode_from_contents, 0), false, "set_eol_mode_from_contents", 26, "Sets the buffer's line ending mode to match the contents of the buffer.", 71, "../code/custom/4coder_eol.cpp", 29, 125 }, { PROC_LINKS(select_surrounding_scope_maximal, 0), false, "select_surrounding_scope_maximal", 32, "Selects the top-most scope that surrounds the cursor.", 53, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 39 },
{ PROC_LINKS(set_eol_mode_to_binary, 0), false, "set_eol_mode_to_binary", 22, "Puts the buffer in bin line ending mode.", 40, "../code/custom/4coder_eol.cpp", 29, 112 }, { PROC_LINKS(set_eol_mode_from_contents, 0), false, "set_eol_mode_from_contents", 26, "Sets the buffer's line ending mode to match the contents of the buffer.", 71, "c:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 125 },
{ PROC_LINKS(set_eol_mode_to_crlf, 0), false, "set_eol_mode_to_crlf", 20, "Puts the buffer in crlf line ending mode.", 41, "../code/custom/4coder_eol.cpp", 29, 86 }, { PROC_LINKS(set_eol_mode_to_binary, 0), false, "set_eol_mode_to_binary", 22, "Puts the buffer in bin line ending mode.", 40, "c:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 112 },
{ PROC_LINKS(set_eol_mode_to_lf, 0), false, "set_eol_mode_to_lf", 18, "Puts the buffer in lf line ending mode.", 39, "../code/custom/4coder_eol.cpp", 29, 99 }, { PROC_LINKS(set_eol_mode_to_crlf, 0), false, "set_eol_mode_to_crlf", 20, "Puts the buffer in crlf line ending mode.", 41, "c:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 86 },
{ PROC_LINKS(set_mark, 0), false, "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "../code/custom/4coder_base_commands.cpp", 39, 115 }, { PROC_LINKS(set_eol_mode_to_lf, 0), false, "set_eol_mode_to_lf", 18, "Puts the buffer in lf line ending mode.", 39, "c:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 99 },
{ PROC_LINKS(set_mode_to_notepad_like, 0), false, "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "../code/custom/4coder_default_framework.cpp", 43, 427 }, { PROC_LINKS(set_mark, 0), false, "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 126 },
{ PROC_LINKS(set_mode_to_original, 0), false, "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "../code/custom/4coder_default_framework.cpp", 43, 421 }, { PROC_LINKS(set_mode_to_notepad_like, 0), false, "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 427 },
{ PROC_LINKS(setup_build_bat, 0), false, "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "../code/custom/4coder_project_commands.cpp", 42, 1237 }, { PROC_LINKS(set_mode_to_original, 0), false, "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 421 },
{ PROC_LINKS(setup_build_bat_and_sh, 0), false, "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "../code/custom/4coder_project_commands.cpp", 42, 1249 }, { PROC_LINKS(setup_build_bat, 0), false, "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1237 },
{ PROC_LINKS(setup_build_sh, 0), false, "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "../code/custom/4coder_project_commands.cpp", 42, 1243 }, { PROC_LINKS(setup_build_bat_and_sh, 0), false, "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1249 },
{ PROC_LINKS(setup_new_project, 0), false, "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "../code/custom/4coder_project_commands.cpp", 42, 1230 }, { PROC_LINKS(setup_build_sh, 0), false, "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1243 },
{ PROC_LINKS(show_filebar, 0), false, "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "../code/custom/4coder_base_commands.cpp", 39, 644 }, { PROC_LINKS(setup_new_project, 0), false, "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1230 },
{ PROC_LINKS(show_scrollbar, 0), false, "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "../code/custom/4coder_base_commands.cpp", 39, 630 }, { PROC_LINKS(show_filebar, 0), false, "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 653 },
{ PROC_LINKS(show_the_log_graph, 0), true, "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "../code/custom/4coder_log_parser.cpp", 36, 994 }, { PROC_LINKS(show_scrollbar, 0), false, "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 639 },
{ PROC_LINKS(snipe_backward_whitespace_or_token_boundary, 0), false, "snipe_backward_whitespace_or_token_boundary", 43, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "../code/custom/4coder_base_commands.cpp", 39, 179 }, { PROC_LINKS(show_the_log_graph, 0), true, "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "c:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 994 },
{ PROC_LINKS(snipe_forward_whitespace_or_token_boundary, 0), false, "snipe_forward_whitespace_or_token_boundary", 42, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "../code/custom/4coder_base_commands.cpp", 39, 187 }, { PROC_LINKS(snipe_backward_whitespace_or_token_boundary, 0), false, "snipe_backward_whitespace_or_token_boundary", 43, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 190 },
{ PROC_LINKS(snippet_lister, 0), true, "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "../code/custom/4coder_combined_write_commands.cpp", 49, 237 }, { PROC_LINKS(snipe_forward_whitespace_or_token_boundary, 0), false, "snipe_forward_whitespace_or_token_boundary", 42, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 198 },
{ PROC_LINKS(suppress_mouse, 0), false, "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "../code/custom/4coder_default_framework.cpp", 43, 403 }, { PROC_LINKS(snippet_lister, 0), true, "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 237 },
{ PROC_LINKS(swap_panels, 0), false, "swap_panels", 11, "Swaps the active panel with it's sibling.", 41, "../code/custom/4coder_base_commands.cpp", 39, 1518 }, { PROC_LINKS(suppress_mouse, 0), false, "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 403 },
{ PROC_LINKS(theme_lister, 0), true, "theme_lister", 12, "Opens an interactive list of all registered themes.", 51, "../code/custom/4coder_lists.cpp", 31, 692 }, { PROC_LINKS(swap_panels, 0), false, "swap_panels", 11, "Swaps the active panel with it's sibling.", 41, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1524 },
{ PROC_LINKS(to_lowercase, 0), false, "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "../code/custom/4coder_base_commands.cpp", 39, 565 }, { PROC_LINKS(test_double_backspace, 0), false, "test_double_backspace", 21, "Made for testing purposes (I should have deleted this if you are reading it let me know)", 88, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 115 },
{ PROC_LINKS(to_uppercase, 0), false, "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "../code/custom/4coder_base_commands.cpp", 39, 552 }, { PROC_LINKS(theme_lister, 0), true, "theme_lister", 12, "Opens an interactive list of all registered themes.", 51, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 785 },
{ PROC_LINKS(toggle_filebar, 0), false, "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "../code/custom/4coder_base_commands.cpp", 39, 658 }, { PROC_LINKS(to_lowercase, 0), false, "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 574 },
{ PROC_LINKS(toggle_fps_meter, 0), false, "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "../code/custom/4coder_base_commands.cpp", 39, 667 }, { PROC_LINKS(to_uppercase, 0), false, "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 561 },
{ PROC_LINKS(toggle_fullscreen, 0), false, "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "../code/custom/4coder_default_framework.cpp", 43, 451 }, { PROC_LINKS(toggle_filebar, 0), false, "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 667 },
{ PROC_LINKS(toggle_highlight_enclosing_scopes, 0), false, "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "../code/custom/4coder_default_framework.cpp", 43, 439 }, { PROC_LINKS(toggle_fps_meter, 0), false, "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 676 },
{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), false, "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "../code/custom/4coder_default_framework.cpp", 43, 433 }, { PROC_LINKS(toggle_fullscreen, 0), false, "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 451 },
{ PROC_LINKS(toggle_line_numbers, 0), false, "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "../code/custom/4coder_base_commands.cpp", 39, 721 }, { PROC_LINKS(toggle_highlight_enclosing_scopes, 0), false, "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 439 },
{ PROC_LINKS(toggle_line_wrap, 0), false, "toggle_line_wrap", 16, "Toggles the line wrap setting on this buffer.", 45, "../code/custom/4coder_base_commands.cpp", 39, 727 }, { PROC_LINKS(toggle_highlight_line_at_cursor, 0), false, "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 433 },
{ PROC_LINKS(toggle_mouse, 0), false, "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "../code/custom/4coder_default_framework.cpp", 43, 415 }, { PROC_LINKS(toggle_line_numbers, 0), false, "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 730 },
{ PROC_LINKS(toggle_paren_matching_helper, 0), false, "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "../code/custom/4coder_default_framework.cpp", 43, 445 }, { PROC_LINKS(toggle_line_wrap, 0), false, "toggle_line_wrap", 16, "Toggles the line wrap setting on this buffer.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 736 },
{ PROC_LINKS(toggle_show_whitespace, 0), false, "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "../code/custom/4coder_base_commands.cpp", 39, 712 }, { PROC_LINKS(toggle_mouse, 0), false, "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 415 },
{ PROC_LINKS(toggle_virtual_whitespace, 0), false, "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "../code/custom/4coder_code_index.cpp", 36, 1160 }, { PROC_LINKS(toggle_paren_matching_helper, 0), false, "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 445 },
{ PROC_LINKS(tutorial_maximize, 0), false, "tutorial_maximize", 17, "Expand the tutorial window", 26, "../code/custom/4coder_tutorial.cpp", 34, 20 }, { PROC_LINKS(toggle_show_whitespace, 0), false, "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 721 },
{ PROC_LINKS(tutorial_minimize, 0), false, "tutorial_minimize", 17, "Shrink the tutorial window", 26, "../code/custom/4coder_tutorial.cpp", 34, 34 }, { PROC_LINKS(toggle_virtual_whitespace, 0), false, "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "c:\\4ed\\code\\custom\\4coder_code_index.cpp", 40, 1170 },
{ PROC_LINKS(uncomment_line, 0), false, "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "../code/custom/4coder_combined_write_commands.cpp", 49, 137 }, { PROC_LINKS(tutorial_maximize, 0), false, "tutorial_maximize", 17, "Expand the tutorial window", 26, "c:\\4ed\\code\\custom\\4coder_tutorial.cpp", 38, 20 },
{ PROC_LINKS(undo, 0), false, "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "../code/custom/4coder_base_commands.cpp", 39, 1618 }, { PROC_LINKS(tutorial_minimize, 0), false, "tutorial_minimize", 17, "Shrink the tutorial window", 26, "c:\\4ed\\code\\custom\\4coder_tutorial.cpp", 38, 34 },
{ PROC_LINKS(undo_all_buffers, 0), false, "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "../code/custom/4coder_base_commands.cpp", 39, 1645 }, { PROC_LINKS(uncomment_line, 0), false, "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 137 },
{ PROC_LINKS(view_buffer_other_panel, 0), false, "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "../code/custom/4coder_base_commands.cpp", 39, 1506 }, { PROC_LINKS(undo, 0), false, "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1624 },
{ PROC_LINKS(view_jump_list_with_lister, 0), false, "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "../code/custom/4coder_jump_lister.cpp", 37, 59 }, { PROC_LINKS(undo_all_buffers, 0), false, "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1651 },
{ PROC_LINKS(word_complete, 0), false, "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "../code/custom/4coder_search.cpp", 32, 392 }, { PROC_LINKS(view_buffer_other_panel, 0), false, "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1512 },
{ PROC_LINKS(word_complete_drop_down, 0), false, "word_complete_drop_down", 23, "Word complete with drop down menu.", 34, "../code/custom/4coder_search.cpp", 32, 639 }, { PROC_LINKS(view_jump_list_with_lister, 0), false, "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "c:\\4ed\\code\\custom\\4coder_jump_lister.cpp", 41, 59 },
{ PROC_LINKS(write_block, 0), false, "write_block", 11, "At the cursor, insert a block comment.", 38, "../code/custom/4coder_combined_write_commands.cpp", 49, 94 }, { PROC_LINKS(word_complete, 0), false, "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 395 },
{ PROC_LINKS(write_hack, 0), false, "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "../code/custom/4coder_combined_write_commands.cpp", 49, 82 }, { PROC_LINKS(word_complete_drop_down, 0), false, "word_complete_drop_down", 23, "Word complete with drop down menu.", 34, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 642 },
{ PROC_LINKS(write_note, 0), false, "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "../code/custom/4coder_combined_write_commands.cpp", 49, 88 }, { PROC_LINKS(write_block, 0), false, "write_block", 11, "At the cursor, insert a block comment.", 38, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 94 },
{ PROC_LINKS(write_space, 0), false, "write_space", 11, "Inserts an underscore.", 22, "../code/custom/4coder_base_commands.cpp", 39, 67 }, { PROC_LINKS(write_hack, 0), false, "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 82 },
{ PROC_LINKS(write_text_and_auto_indent, 0), false, "write_text_and_auto_indent", 26, "Inserts text and auto-indents the line on which the cursor sits if any of the text contains 'layout punctuation' such as ;:{}()[]# and new lines.", 145, "../code/custom/4coder_auto_indent.cpp", 37, 395 }, { PROC_LINKS(write_note, 0), false, "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 88 },
{ PROC_LINKS(write_text_input, 0), false, "write_text_input", 16, "Inserts whatever text was used to trigger this command.", 55, "../code/custom/4coder_base_commands.cpp", 39, 59 }, { PROC_LINKS(write_space, 0), false, "write_space", 11, "Inserts a space.", 16, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 67 },
{ PROC_LINKS(write_todo, 0), false, "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "../code/custom/4coder_combined_write_commands.cpp", 49, 76 }, { PROC_LINKS(write_text_and_auto_indent, 0), false, "write_text_and_auto_indent", 26, "Inserts text and auto-indents the line on which the cursor sits if any of the text contains 'layout punctuation' such as ;:{}()[]# and new lines.", 145, "c:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 427 },
{ PROC_LINKS(write_underscore, 0), false, "write_underscore", 16, "Inserts an underscore.", 22, "../code/custom/4coder_base_commands.cpp", 39, 73 }, { PROC_LINKS(write_text_input, 0), false, "write_text_input", 16, "Inserts whatever text was used to trigger this command.", 55, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 59 },
{ PROC_LINKS(write_zero_struct, 0), false, "write_zero_struct", 17, "At the cursor, insert a ' = {};'.", 33, "../code/custom/4coder_combined_write_commands.cpp", 49, 100 }, { PROC_LINKS(write_todo, 0), false, "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 76 },
{ PROC_LINKS(write_underscore, 0), false, "write_underscore", 16, "Inserts an underscore.", 22, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 73 },
{ PROC_LINKS(write_zero_struct, 0), false, "write_zero_struct", 17, "At the cursor, insert a ' = {};'.", 33, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 100 },
}; };
static i32 fcoder_metacmd_ID_allow_mouse = 0; static i32 fcoder_metacmd_ID_allow_mouse = 0;
static i32 fcoder_metacmd_ID_auto_indent_line_at_cursor = 1; static i32 fcoder_metacmd_ID_auto_indent_line_at_cursor = 1;
@ -571,143 +575,145 @@ static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier
static i32 fcoder_metacmd_ID_list_all_substring_locations = 87; static i32 fcoder_metacmd_ID_list_all_substring_locations = 87;
static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 88; static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 88;
static i32 fcoder_metacmd_ID_load_project = 89; static i32 fcoder_metacmd_ID_load_project = 89;
static i32 fcoder_metacmd_ID_load_themes_default_folder = 90; static i32 fcoder_metacmd_ID_load_theme_current_buffer = 90;
static i32 fcoder_metacmd_ID_load_themes_hot_directory = 91; static i32 fcoder_metacmd_ID_load_themes_default_folder = 91;
static i32 fcoder_metacmd_ID_make_directory_query = 92; static i32 fcoder_metacmd_ID_load_themes_hot_directory = 92;
static i32 fcoder_metacmd_ID_miblo_decrement_basic = 93; static i32 fcoder_metacmd_ID_make_directory_query = 93;
static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 94; static i32 fcoder_metacmd_ID_miblo_decrement_basic = 94;
static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 95; static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 95;
static i32 fcoder_metacmd_ID_miblo_increment_basic = 96; static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 96;
static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 97; static i32 fcoder_metacmd_ID_miblo_increment_basic = 97;
static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 98; static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 98;
static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 99; static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 99;
static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 100; static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 100;
static i32 fcoder_metacmd_ID_move_down = 101; static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 101;
static i32 fcoder_metacmd_ID_move_down_10 = 102; static i32 fcoder_metacmd_ID_move_down = 102;
static i32 fcoder_metacmd_ID_move_down_textual = 103; static i32 fcoder_metacmd_ID_move_down_10 = 103;
static i32 fcoder_metacmd_ID_move_down_to_blank_line = 104; static i32 fcoder_metacmd_ID_move_down_textual = 104;
static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 105; static i32 fcoder_metacmd_ID_move_down_to_blank_line = 105;
static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 106; static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 106;
static i32 fcoder_metacmd_ID_move_left = 107; static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 107;
static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 108; static i32 fcoder_metacmd_ID_move_left = 108;
static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 109; static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 109;
static i32 fcoder_metacmd_ID_move_left_token_boundary = 110; static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 110;
static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 111; static i32 fcoder_metacmd_ID_move_left_token_boundary = 111;
static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 112; static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 112;
static i32 fcoder_metacmd_ID_move_line_down = 113; static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 113;
static i32 fcoder_metacmd_ID_move_line_up = 114; static i32 fcoder_metacmd_ID_move_line_down = 114;
static i32 fcoder_metacmd_ID_move_right = 115; static i32 fcoder_metacmd_ID_move_line_up = 115;
static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 116; static i32 fcoder_metacmd_ID_move_right = 116;
static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 117; static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 117;
static i32 fcoder_metacmd_ID_move_right_token_boundary = 118; static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 118;
static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 119; static i32 fcoder_metacmd_ID_move_right_token_boundary = 119;
static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 120; static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 120;
static i32 fcoder_metacmd_ID_move_up = 121; static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 121;
static i32 fcoder_metacmd_ID_move_up_10 = 122; static i32 fcoder_metacmd_ID_move_up = 122;
static i32 fcoder_metacmd_ID_move_up_to_blank_line = 123; static i32 fcoder_metacmd_ID_move_up_10 = 123;
static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 124; static i32 fcoder_metacmd_ID_move_up_to_blank_line = 124;
static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 125; static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 125;
static i32 fcoder_metacmd_ID_open_all_code = 126; static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 126;
static i32 fcoder_metacmd_ID_open_all_code_recursive = 127; static i32 fcoder_metacmd_ID_open_all_code = 127;
static i32 fcoder_metacmd_ID_open_file_in_quotes = 128; static i32 fcoder_metacmd_ID_open_all_code_recursive = 128;
static i32 fcoder_metacmd_ID_open_in_other = 129; static i32 fcoder_metacmd_ID_open_file_in_quotes = 129;
static i32 fcoder_metacmd_ID_open_long_braces = 130; static i32 fcoder_metacmd_ID_open_in_other = 130;
static i32 fcoder_metacmd_ID_open_long_braces_break = 131; static i32 fcoder_metacmd_ID_open_long_braces = 131;
static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 132; static i32 fcoder_metacmd_ID_open_long_braces_break = 132;
static i32 fcoder_metacmd_ID_open_matching_file_cpp = 133; static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 133;
static i32 fcoder_metacmd_ID_open_panel_hsplit = 134; static i32 fcoder_metacmd_ID_open_matching_file_cpp = 134;
static i32 fcoder_metacmd_ID_open_panel_vsplit = 135; static i32 fcoder_metacmd_ID_open_panel_hsplit = 135;
static i32 fcoder_metacmd_ID_page_down = 136; static i32 fcoder_metacmd_ID_open_panel_vsplit = 136;
static i32 fcoder_metacmd_ID_page_up = 137; static i32 fcoder_metacmd_ID_page_down = 137;
static i32 fcoder_metacmd_ID_paste = 138; static i32 fcoder_metacmd_ID_page_up = 138;
static i32 fcoder_metacmd_ID_paste_and_indent = 139; static i32 fcoder_metacmd_ID_paste = 139;
static i32 fcoder_metacmd_ID_paste_next = 140; static i32 fcoder_metacmd_ID_paste_and_indent = 140;
static i32 fcoder_metacmd_ID_paste_next_and_indent = 141; static i32 fcoder_metacmd_ID_paste_next = 141;
static i32 fcoder_metacmd_ID_place_in_scope = 142; static i32 fcoder_metacmd_ID_paste_next_and_indent = 142;
static i32 fcoder_metacmd_ID_profile_clear = 143; static i32 fcoder_metacmd_ID_place_in_scope = 143;
static i32 fcoder_metacmd_ID_profile_disable = 144; static i32 fcoder_metacmd_ID_profile_clear = 144;
static i32 fcoder_metacmd_ID_profile_enable = 145; static i32 fcoder_metacmd_ID_profile_disable = 145;
static i32 fcoder_metacmd_ID_profile_inspect = 146; static i32 fcoder_metacmd_ID_profile_enable = 146;
static i32 fcoder_metacmd_ID_project_command_lister = 147; static i32 fcoder_metacmd_ID_profile_inspect = 147;
static i32 fcoder_metacmd_ID_project_fkey_command = 148; static i32 fcoder_metacmd_ID_project_command_lister = 148;
static i32 fcoder_metacmd_ID_project_go_to_root_directory = 149; static i32 fcoder_metacmd_ID_project_fkey_command = 149;
static i32 fcoder_metacmd_ID_query_replace = 150; static i32 fcoder_metacmd_ID_project_go_to_root_directory = 150;
static i32 fcoder_metacmd_ID_query_replace_identifier = 151; static i32 fcoder_metacmd_ID_query_replace = 151;
static i32 fcoder_metacmd_ID_query_replace_selection = 152; static i32 fcoder_metacmd_ID_query_replace_identifier = 152;
static i32 fcoder_metacmd_ID_redo = 153; static i32 fcoder_metacmd_ID_query_replace_selection = 153;
static i32 fcoder_metacmd_ID_redo_all_buffers = 154; static i32 fcoder_metacmd_ID_redo = 154;
static i32 fcoder_metacmd_ID_rename_file_query = 155; static i32 fcoder_metacmd_ID_redo_all_buffers = 155;
static i32 fcoder_metacmd_ID_reopen = 156; static i32 fcoder_metacmd_ID_rename_file_query = 156;
static i32 fcoder_metacmd_ID_replace_in_all_buffers = 157; static i32 fcoder_metacmd_ID_reopen = 157;
static i32 fcoder_metacmd_ID_replace_in_buffer = 158; static i32 fcoder_metacmd_ID_replace_in_all_buffers = 158;
static i32 fcoder_metacmd_ID_replace_in_range = 159; static i32 fcoder_metacmd_ID_replace_in_buffer = 159;
static i32 fcoder_metacmd_ID_reverse_search = 160; static i32 fcoder_metacmd_ID_replace_in_range = 160;
static i32 fcoder_metacmd_ID_reverse_search_identifier = 161; static i32 fcoder_metacmd_ID_reverse_search = 161;
static i32 fcoder_metacmd_ID_save = 162; static i32 fcoder_metacmd_ID_reverse_search_identifier = 162;
static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 163; static i32 fcoder_metacmd_ID_save = 163;
static i32 fcoder_metacmd_ID_save_to_query = 164; static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 164;
static i32 fcoder_metacmd_ID_search = 165; static i32 fcoder_metacmd_ID_save_to_query = 165;
static i32 fcoder_metacmd_ID_search_identifier = 166; static i32 fcoder_metacmd_ID_search = 166;
static i32 fcoder_metacmd_ID_seek_beginning_of_line = 167; static i32 fcoder_metacmd_ID_search_identifier = 167;
static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 168; static i32 fcoder_metacmd_ID_seek_beginning_of_line = 168;
static i32 fcoder_metacmd_ID_seek_end_of_line = 169; static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 169;
static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 170; static i32 fcoder_metacmd_ID_seek_end_of_line = 170;
static i32 fcoder_metacmd_ID_select_all = 171; static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 171;
static i32 fcoder_metacmd_ID_select_next_scope_absolute = 172; static i32 fcoder_metacmd_ID_select_all = 172;
static i32 fcoder_metacmd_ID_select_next_scope_after_current = 173; static i32 fcoder_metacmd_ID_select_next_scope_absolute = 173;
static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 174; static i32 fcoder_metacmd_ID_select_next_scope_after_current = 174;
static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 175; static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 175;
static i32 fcoder_metacmd_ID_select_surrounding_scope = 176; static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 176;
static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 177; static i32 fcoder_metacmd_ID_select_surrounding_scope = 177;
static i32 fcoder_metacmd_ID_set_eol_mode_from_contents = 178; static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 178;
static i32 fcoder_metacmd_ID_set_eol_mode_to_binary = 179; static i32 fcoder_metacmd_ID_set_eol_mode_from_contents = 179;
static i32 fcoder_metacmd_ID_set_eol_mode_to_crlf = 180; static i32 fcoder_metacmd_ID_set_eol_mode_to_binary = 180;
static i32 fcoder_metacmd_ID_set_eol_mode_to_lf = 181; static i32 fcoder_metacmd_ID_set_eol_mode_to_crlf = 181;
static i32 fcoder_metacmd_ID_set_mark = 182; static i32 fcoder_metacmd_ID_set_eol_mode_to_lf = 182;
static i32 fcoder_metacmd_ID_set_mode_to_notepad_like = 183; static i32 fcoder_metacmd_ID_set_mark = 183;
static i32 fcoder_metacmd_ID_set_mode_to_original = 184; static i32 fcoder_metacmd_ID_set_mode_to_notepad_like = 184;
static i32 fcoder_metacmd_ID_setup_build_bat = 185; static i32 fcoder_metacmd_ID_set_mode_to_original = 185;
static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 186; static i32 fcoder_metacmd_ID_setup_build_bat = 186;
static i32 fcoder_metacmd_ID_setup_build_sh = 187; static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 187;
static i32 fcoder_metacmd_ID_setup_new_project = 188; static i32 fcoder_metacmd_ID_setup_build_sh = 188;
static i32 fcoder_metacmd_ID_show_filebar = 189; static i32 fcoder_metacmd_ID_setup_new_project = 189;
static i32 fcoder_metacmd_ID_show_scrollbar = 190; static i32 fcoder_metacmd_ID_show_filebar = 190;
static i32 fcoder_metacmd_ID_show_the_log_graph = 191; static i32 fcoder_metacmd_ID_show_scrollbar = 191;
static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 192; static i32 fcoder_metacmd_ID_show_the_log_graph = 192;
static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 193; static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 193;
static i32 fcoder_metacmd_ID_snippet_lister = 194; static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 194;
static i32 fcoder_metacmd_ID_suppress_mouse = 195; static i32 fcoder_metacmd_ID_snippet_lister = 195;
static i32 fcoder_metacmd_ID_swap_panels = 196; static i32 fcoder_metacmd_ID_suppress_mouse = 196;
static i32 fcoder_metacmd_ID_theme_lister = 197; static i32 fcoder_metacmd_ID_swap_panels = 197;
static i32 fcoder_metacmd_ID_to_lowercase = 198; static i32 fcoder_metacmd_ID_test_double_backspace = 198;
static i32 fcoder_metacmd_ID_to_uppercase = 199; static i32 fcoder_metacmd_ID_theme_lister = 199;
static i32 fcoder_metacmd_ID_toggle_filebar = 200; static i32 fcoder_metacmd_ID_to_lowercase = 200;
static i32 fcoder_metacmd_ID_toggle_fps_meter = 201; static i32 fcoder_metacmd_ID_to_uppercase = 201;
static i32 fcoder_metacmd_ID_toggle_fullscreen = 202; static i32 fcoder_metacmd_ID_toggle_filebar = 202;
static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 203; static i32 fcoder_metacmd_ID_toggle_fps_meter = 203;
static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 204; static i32 fcoder_metacmd_ID_toggle_fullscreen = 204;
static i32 fcoder_metacmd_ID_toggle_line_numbers = 205; static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 205;
static i32 fcoder_metacmd_ID_toggle_line_wrap = 206; static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 206;
static i32 fcoder_metacmd_ID_toggle_mouse = 207; static i32 fcoder_metacmd_ID_toggle_line_numbers = 207;
static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 208; static i32 fcoder_metacmd_ID_toggle_line_wrap = 208;
static i32 fcoder_metacmd_ID_toggle_show_whitespace = 209; static i32 fcoder_metacmd_ID_toggle_mouse = 209;
static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 210; static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 210;
static i32 fcoder_metacmd_ID_tutorial_maximize = 211; static i32 fcoder_metacmd_ID_toggle_show_whitespace = 211;
static i32 fcoder_metacmd_ID_tutorial_minimize = 212; static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 212;
static i32 fcoder_metacmd_ID_uncomment_line = 213; static i32 fcoder_metacmd_ID_tutorial_maximize = 213;
static i32 fcoder_metacmd_ID_undo = 214; static i32 fcoder_metacmd_ID_tutorial_minimize = 214;
static i32 fcoder_metacmd_ID_undo_all_buffers = 215; static i32 fcoder_metacmd_ID_uncomment_line = 215;
static i32 fcoder_metacmd_ID_view_buffer_other_panel = 216; static i32 fcoder_metacmd_ID_undo = 216;
static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 217; static i32 fcoder_metacmd_ID_undo_all_buffers = 217;
static i32 fcoder_metacmd_ID_word_complete = 218; static i32 fcoder_metacmd_ID_view_buffer_other_panel = 218;
static i32 fcoder_metacmd_ID_word_complete_drop_down = 219; static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 219;
static i32 fcoder_metacmd_ID_write_block = 220; static i32 fcoder_metacmd_ID_word_complete = 220;
static i32 fcoder_metacmd_ID_write_hack = 221; static i32 fcoder_metacmd_ID_word_complete_drop_down = 221;
static i32 fcoder_metacmd_ID_write_note = 222; static i32 fcoder_metacmd_ID_write_block = 222;
static i32 fcoder_metacmd_ID_write_space = 223; static i32 fcoder_metacmd_ID_write_hack = 223;
static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 224; static i32 fcoder_metacmd_ID_write_note = 224;
static i32 fcoder_metacmd_ID_write_text_input = 225; static i32 fcoder_metacmd_ID_write_space = 225;
static i32 fcoder_metacmd_ID_write_todo = 226; static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 226;
static i32 fcoder_metacmd_ID_write_underscore = 227; static i32 fcoder_metacmd_ID_write_text_input = 227;
static i32 fcoder_metacmd_ID_write_zero_struct = 228; static i32 fcoder_metacmd_ID_write_todo = 228;
static i32 fcoder_metacmd_ID_write_underscore = 229;
static i32 fcoder_metacmd_ID_write_zero_struct = 230;
#endif #endif

View File

@ -25,12 +25,14 @@ vtable->buffer_line_y_difference = buffer_line_y_difference;
vtable->buffer_line_shift_y = buffer_line_shift_y; vtable->buffer_line_shift_y = buffer_line_shift_y;
vtable->buffer_pos_at_relative_xy = buffer_pos_at_relative_xy; vtable->buffer_pos_at_relative_xy = buffer_pos_at_relative_xy;
vtable->buffer_relative_box_of_pos = buffer_relative_box_of_pos; vtable->buffer_relative_box_of_pos = buffer_relative_box_of_pos;
vtable->buffer_padded_box_of_pos = buffer_padded_box_of_pos;
vtable->buffer_relative_character_from_pos = buffer_relative_character_from_pos; vtable->buffer_relative_character_from_pos = buffer_relative_character_from_pos;
vtable->buffer_pos_from_relative_character = buffer_pos_from_relative_character; vtable->buffer_pos_from_relative_character = buffer_pos_from_relative_character;
vtable->view_line_y_difference = view_line_y_difference; vtable->view_line_y_difference = view_line_y_difference;
vtable->view_line_shift_y = view_line_shift_y; vtable->view_line_shift_y = view_line_shift_y;
vtable->view_pos_at_relative_xy = view_pos_at_relative_xy; vtable->view_pos_at_relative_xy = view_pos_at_relative_xy;
vtable->view_relative_box_of_pos = view_relative_box_of_pos; vtable->view_relative_box_of_pos = view_relative_box_of_pos;
vtable->view_padded_box_of_pos = view_padded_box_of_pos;
vtable->view_relative_character_from_pos = view_relative_character_from_pos; vtable->view_relative_character_from_pos = view_relative_character_from_pos;
vtable->view_pos_from_relative_character = view_pos_from_relative_character; vtable->view_pos_from_relative_character = view_pos_from_relative_character;
vtable->buffer_exists = buffer_exists; vtable->buffer_exists = buffer_exists;
@ -90,7 +92,6 @@ vtable->view_set_buffer_scroll = view_set_buffer_scroll;
vtable->view_set_mark = view_set_mark; vtable->view_set_mark = view_set_mark;
vtable->view_quit_ui = view_quit_ui; vtable->view_quit_ui = view_quit_ui;
vtable->view_set_buffer = view_set_buffer; vtable->view_set_buffer = view_set_buffer;
vtable->view_post_fade = view_post_fade;
vtable->view_push_context = view_push_context; vtable->view_push_context = view_push_context;
vtable->view_pop_context = view_pop_context; vtable->view_pop_context = view_pop_context;
vtable->view_alter_context = view_alter_context; vtable->view_alter_context = view_alter_context;
@ -154,6 +155,7 @@ vtable->try_release_face = try_release_face;
vtable->push_hot_directory = push_hot_directory; vtable->push_hot_directory = push_hot_directory;
vtable->set_hot_directory = set_hot_directory; vtable->set_hot_directory = set_hot_directory;
vtable->send_exit_signal = send_exit_signal; vtable->send_exit_signal = send_exit_signal;
vtable->hard_exit = hard_exit;
vtable->set_window_title = set_window_title; vtable->set_window_title = set_window_title;
vtable->draw_string_oriented = draw_string_oriented; vtable->draw_string_oriented = draw_string_oriented;
vtable->get_string_advance = get_string_advance; vtable->get_string_advance = get_string_advance;
@ -167,6 +169,7 @@ vtable->text_layout_get_visible_range = text_layout_get_visible_range;
vtable->text_layout_line_on_screen = text_layout_line_on_screen; vtable->text_layout_line_on_screen = text_layout_line_on_screen;
vtable->text_layout_character_on_screen = text_layout_character_on_screen; vtable->text_layout_character_on_screen = text_layout_character_on_screen;
vtable->paint_text_color = paint_text_color; vtable->paint_text_color = paint_text_color;
vtable->paint_text_color_blend = paint_text_color_blend;
vtable->text_layout_free = text_layout_free; vtable->text_layout_free = text_layout_free;
vtable->draw_text_layout = draw_text_layout; vtable->draw_text_layout = draw_text_layout;
vtable->open_color_picker = open_color_picker; vtable->open_color_picker = open_color_picker;
@ -203,12 +206,14 @@ buffer_line_y_difference = vtable->buffer_line_y_difference;
buffer_line_shift_y = vtable->buffer_line_shift_y; buffer_line_shift_y = vtable->buffer_line_shift_y;
buffer_pos_at_relative_xy = vtable->buffer_pos_at_relative_xy; buffer_pos_at_relative_xy = vtable->buffer_pos_at_relative_xy;
buffer_relative_box_of_pos = vtable->buffer_relative_box_of_pos; buffer_relative_box_of_pos = vtable->buffer_relative_box_of_pos;
buffer_padded_box_of_pos = vtable->buffer_padded_box_of_pos;
buffer_relative_character_from_pos = vtable->buffer_relative_character_from_pos; buffer_relative_character_from_pos = vtable->buffer_relative_character_from_pos;
buffer_pos_from_relative_character = vtable->buffer_pos_from_relative_character; buffer_pos_from_relative_character = vtable->buffer_pos_from_relative_character;
view_line_y_difference = vtable->view_line_y_difference; view_line_y_difference = vtable->view_line_y_difference;
view_line_shift_y = vtable->view_line_shift_y; view_line_shift_y = vtable->view_line_shift_y;
view_pos_at_relative_xy = vtable->view_pos_at_relative_xy; view_pos_at_relative_xy = vtable->view_pos_at_relative_xy;
view_relative_box_of_pos = vtable->view_relative_box_of_pos; view_relative_box_of_pos = vtable->view_relative_box_of_pos;
view_padded_box_of_pos = vtable->view_padded_box_of_pos;
view_relative_character_from_pos = vtable->view_relative_character_from_pos; view_relative_character_from_pos = vtable->view_relative_character_from_pos;
view_pos_from_relative_character = vtable->view_pos_from_relative_character; view_pos_from_relative_character = vtable->view_pos_from_relative_character;
buffer_exists = vtable->buffer_exists; buffer_exists = vtable->buffer_exists;
@ -268,7 +273,6 @@ view_set_buffer_scroll = vtable->view_set_buffer_scroll;
view_set_mark = vtable->view_set_mark; view_set_mark = vtable->view_set_mark;
view_quit_ui = vtable->view_quit_ui; view_quit_ui = vtable->view_quit_ui;
view_set_buffer = vtable->view_set_buffer; view_set_buffer = vtable->view_set_buffer;
view_post_fade = vtable->view_post_fade;
view_push_context = vtable->view_push_context; view_push_context = vtable->view_push_context;
view_pop_context = vtable->view_pop_context; view_pop_context = vtable->view_pop_context;
view_alter_context = vtable->view_alter_context; view_alter_context = vtable->view_alter_context;
@ -332,6 +336,7 @@ try_release_face = vtable->try_release_face;
push_hot_directory = vtable->push_hot_directory; push_hot_directory = vtable->push_hot_directory;
set_hot_directory = vtable->set_hot_directory; set_hot_directory = vtable->set_hot_directory;
send_exit_signal = vtable->send_exit_signal; send_exit_signal = vtable->send_exit_signal;
hard_exit = vtable->hard_exit;
set_window_title = vtable->set_window_title; set_window_title = vtable->set_window_title;
draw_string_oriented = vtable->draw_string_oriented; draw_string_oriented = vtable->draw_string_oriented;
get_string_advance = vtable->get_string_advance; get_string_advance = vtable->get_string_advance;
@ -345,6 +350,7 @@ text_layout_get_visible_range = vtable->text_layout_get_visible_range;
text_layout_line_on_screen = vtable->text_layout_line_on_screen; text_layout_line_on_screen = vtable->text_layout_line_on_screen;
text_layout_character_on_screen = vtable->text_layout_character_on_screen; text_layout_character_on_screen = vtable->text_layout_character_on_screen;
paint_text_color = vtable->paint_text_color; paint_text_color = vtable->paint_text_color;
paint_text_color_blend = vtable->paint_text_color_blend;
text_layout_free = vtable->text_layout_free; text_layout_free = vtable->text_layout_free;
draw_text_layout = vtable->draw_text_layout; draw_text_layout = vtable->draw_text_layout;
open_color_picker = vtable->open_color_picker; open_color_picker = vtable->open_color_picker;

View File

@ -23,12 +23,14 @@
#define custom_buffer_line_shift_y_sig() Line_Shift_Vertical custom_buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift) #define custom_buffer_line_shift_y_sig() Line_Shift_Vertical custom_buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift)
#define custom_buffer_pos_at_relative_xy_sig() i64 custom_buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy) #define custom_buffer_pos_at_relative_xy_sig() i64 custom_buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy)
#define custom_buffer_relative_box_of_pos_sig() Rect_f32 custom_buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) #define custom_buffer_relative_box_of_pos_sig() Rect_f32 custom_buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos)
#define custom_buffer_padded_box_of_pos_sig() Rect_f32 custom_buffer_padded_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos)
#define custom_buffer_relative_character_from_pos_sig() i64 custom_buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) #define custom_buffer_relative_character_from_pos_sig() i64 custom_buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos)
#define custom_buffer_pos_from_relative_character_sig() i64 custom_buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character) #define custom_buffer_pos_from_relative_character_sig() i64 custom_buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character)
#define custom_view_line_y_difference_sig() f32 custom_view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b) #define custom_view_line_y_difference_sig() f32 custom_view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b)
#define custom_view_line_shift_y_sig() Line_Shift_Vertical custom_view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift) #define custom_view_line_shift_y_sig() Line_Shift_Vertical custom_view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift)
#define custom_view_pos_at_relative_xy_sig() i64 custom_view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy) #define custom_view_pos_at_relative_xy_sig() i64 custom_view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy)
#define custom_view_relative_box_of_pos_sig() Rect_f32 custom_view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos) #define custom_view_relative_box_of_pos_sig() Rect_f32 custom_view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos)
#define custom_view_padded_box_of_pos_sig() Rect_f32 custom_view_padded_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos)
#define custom_view_relative_character_from_pos_sig() i64 custom_view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos) #define custom_view_relative_character_from_pos_sig() i64 custom_view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos)
#define custom_view_pos_from_relative_character_sig() i64 custom_view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character) #define custom_view_pos_from_relative_character_sig() i64 custom_view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character)
#define custom_buffer_exists_sig() b32 custom_buffer_exists(Application_Links* app, Buffer_ID buffer_id) #define custom_buffer_exists_sig() b32 custom_buffer_exists(Application_Links* app, Buffer_ID buffer_id)
@ -88,7 +90,6 @@
#define custom_view_set_mark_sig() b32 custom_view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek) #define custom_view_set_mark_sig() b32 custom_view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek)
#define custom_view_quit_ui_sig() b32 custom_view_quit_ui(Application_Links* app, View_ID view_id) #define custom_view_quit_ui_sig() b32 custom_view_quit_ui(Application_Links* app, View_ID view_id)
#define custom_view_set_buffer_sig() b32 custom_view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags) #define custom_view_set_buffer_sig() b32 custom_view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags)
#define custom_view_post_fade_sig() b32 custom_view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, ARGB_Color color)
#define custom_view_push_context_sig() b32 custom_view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx) #define custom_view_push_context_sig() b32 custom_view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx)
#define custom_view_pop_context_sig() b32 custom_view_pop_context(Application_Links* app, View_ID view_id) #define custom_view_pop_context_sig() b32 custom_view_pop_context(Application_Links* app, View_ID view_id)
#define custom_view_alter_context_sig() b32 custom_view_alter_context(Application_Links* app, View_ID view_id, View_Context* ctx) #define custom_view_alter_context_sig() b32 custom_view_alter_context(Application_Links* app, View_ID view_id, View_Context* ctx)
@ -152,6 +153,7 @@
#define custom_push_hot_directory_sig() String_Const_u8 custom_push_hot_directory(Application_Links* app, Arena* arena) #define custom_push_hot_directory_sig() String_Const_u8 custom_push_hot_directory(Application_Links* app, Arena* arena)
#define custom_set_hot_directory_sig() void custom_set_hot_directory(Application_Links* app, String_Const_u8 string) #define custom_set_hot_directory_sig() void custom_set_hot_directory(Application_Links* app, String_Const_u8 string)
#define custom_send_exit_signal_sig() void custom_send_exit_signal(Application_Links* app) #define custom_send_exit_signal_sig() void custom_send_exit_signal(Application_Links* app)
#define custom_hard_exit_sig() void custom_hard_exit(Application_Links* app)
#define custom_set_window_title_sig() void custom_set_window_title(Application_Links* app, String_Const_u8 title) #define custom_set_window_title_sig() void custom_set_window_title(Application_Links* app, String_Const_u8 title)
#define custom_draw_string_oriented_sig() Vec2_f32 custom_draw_string_oriented(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta) #define custom_draw_string_oriented_sig() Vec2_f32 custom_draw_string_oriented(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta)
#define custom_get_string_advance_sig() f32 custom_get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str) #define custom_get_string_advance_sig() f32 custom_get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str)
@ -165,6 +167,7 @@
#define custom_text_layout_line_on_screen_sig() Range_f32 custom_text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number) #define custom_text_layout_line_on_screen_sig() Range_f32 custom_text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number)
#define custom_text_layout_character_on_screen_sig() Rect_f32 custom_text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos) #define custom_text_layout_character_on_screen_sig() Rect_f32 custom_text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos)
#define custom_paint_text_color_sig() void custom_paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color) #define custom_paint_text_color_sig() void custom_paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color)
#define custom_paint_text_color_blend_sig() void custom_paint_text_color_blend(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color, f32 blend)
#define custom_text_layout_free_sig() b32 custom_text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id) #define custom_text_layout_free_sig() b32 custom_text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id)
#define custom_draw_text_layout_sig() void custom_draw_text_layout(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color) #define custom_draw_text_layout_sig() void custom_draw_text_layout(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color)
#define custom_open_color_picker_sig() void custom_open_color_picker(Application_Links* app, Color_Picker* picker) #define custom_open_color_picker_sig() void custom_open_color_picker(Application_Links* app, Color_Picker* picker)
@ -197,12 +200,14 @@ typedef f32 custom_buffer_line_y_difference_type(Application_Links* app, Buffer_
typedef Line_Shift_Vertical custom_buffer_line_shift_y_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift); typedef Line_Shift_Vertical custom_buffer_line_shift_y_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift);
typedef i64 custom_buffer_pos_at_relative_xy_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy); typedef i64 custom_buffer_pos_at_relative_xy_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy);
typedef Rect_f32 custom_buffer_relative_box_of_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); typedef Rect_f32 custom_buffer_relative_box_of_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
typedef Rect_f32 custom_buffer_padded_box_of_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
typedef i64 custom_buffer_relative_character_from_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); typedef i64 custom_buffer_relative_character_from_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
typedef i64 custom_buffer_pos_from_relative_character_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character); typedef i64 custom_buffer_pos_from_relative_character_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character);
typedef f32 custom_view_line_y_difference_type(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b); typedef f32 custom_view_line_y_difference_type(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b);
typedef Line_Shift_Vertical custom_view_line_shift_y_type(Application_Links* app, View_ID view_id, i64 line, f32 y_shift); typedef Line_Shift_Vertical custom_view_line_shift_y_type(Application_Links* app, View_ID view_id, i64 line, f32 y_shift);
typedef i64 custom_view_pos_at_relative_xy_type(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy); typedef i64 custom_view_pos_at_relative_xy_type(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy);
typedef Rect_f32 custom_view_relative_box_of_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); typedef Rect_f32 custom_view_relative_box_of_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
typedef Rect_f32 custom_view_padded_box_of_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
typedef i64 custom_view_relative_character_from_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); typedef i64 custom_view_relative_character_from_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
typedef i64 custom_view_pos_from_relative_character_type(Application_Links* app, View_ID view_id, i64 base_line, i64 character); typedef i64 custom_view_pos_from_relative_character_type(Application_Links* app, View_ID view_id, i64 base_line, i64 character);
typedef b32 custom_buffer_exists_type(Application_Links* app, Buffer_ID buffer_id); typedef b32 custom_buffer_exists_type(Application_Links* app, Buffer_ID buffer_id);
@ -262,7 +267,6 @@ typedef b32 custom_view_set_buffer_scroll_type(Application_Links* app, View_ID v
typedef b32 custom_view_set_mark_type(Application_Links* app, View_ID view_id, Buffer_Seek seek); typedef b32 custom_view_set_mark_type(Application_Links* app, View_ID view_id, Buffer_Seek seek);
typedef b32 custom_view_quit_ui_type(Application_Links* app, View_ID view_id); typedef b32 custom_view_quit_ui_type(Application_Links* app, View_ID view_id);
typedef b32 custom_view_set_buffer_type(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags); typedef b32 custom_view_set_buffer_type(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags);
typedef b32 custom_view_post_fade_type(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, ARGB_Color color);
typedef b32 custom_view_push_context_type(Application_Links* app, View_ID view_id, View_Context* ctx); typedef b32 custom_view_push_context_type(Application_Links* app, View_ID view_id, View_Context* ctx);
typedef b32 custom_view_pop_context_type(Application_Links* app, View_ID view_id); typedef b32 custom_view_pop_context_type(Application_Links* app, View_ID view_id);
typedef b32 custom_view_alter_context_type(Application_Links* app, View_ID view_id, View_Context* ctx); typedef b32 custom_view_alter_context_type(Application_Links* app, View_ID view_id, View_Context* ctx);
@ -326,6 +330,7 @@ typedef b32 custom_try_release_face_type(Application_Links* app, Face_ID id, Fac
typedef String_Const_u8 custom_push_hot_directory_type(Application_Links* app, Arena* arena); typedef String_Const_u8 custom_push_hot_directory_type(Application_Links* app, Arena* arena);
typedef void custom_set_hot_directory_type(Application_Links* app, String_Const_u8 string); typedef void custom_set_hot_directory_type(Application_Links* app, String_Const_u8 string);
typedef void custom_send_exit_signal_type(Application_Links* app); typedef void custom_send_exit_signal_type(Application_Links* app);
typedef void custom_hard_exit_type(Application_Links* app);
typedef void custom_set_window_title_type(Application_Links* app, String_Const_u8 title); typedef void custom_set_window_title_type(Application_Links* app, String_Const_u8 title);
typedef Vec2_f32 custom_draw_string_oriented_type(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta); typedef Vec2_f32 custom_draw_string_oriented_type(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta);
typedef f32 custom_get_string_advance_type(Application_Links* app, Face_ID font_id, String_Const_u8 str); typedef f32 custom_get_string_advance_type(Application_Links* app, Face_ID font_id, String_Const_u8 str);
@ -339,6 +344,7 @@ typedef Range_i64 custom_text_layout_get_visible_range_type(Application_Links* a
typedef Range_f32 custom_text_layout_line_on_screen_type(Application_Links* app, Text_Layout_ID layout_id, i64 line_number); typedef Range_f32 custom_text_layout_line_on_screen_type(Application_Links* app, Text_Layout_ID layout_id, i64 line_number);
typedef Rect_f32 custom_text_layout_character_on_screen_type(Application_Links* app, Text_Layout_ID layout_id, i64 pos); typedef Rect_f32 custom_text_layout_character_on_screen_type(Application_Links* app, Text_Layout_ID layout_id, i64 pos);
typedef void custom_paint_text_color_type(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color); typedef void custom_paint_text_color_type(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color);
typedef void custom_paint_text_color_blend_type(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color, f32 blend);
typedef b32 custom_text_layout_free_type(Application_Links* app, Text_Layout_ID text_layout_id); typedef b32 custom_text_layout_free_type(Application_Links* app, Text_Layout_ID text_layout_id);
typedef void custom_draw_text_layout_type(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color); typedef void custom_draw_text_layout_type(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color);
typedef void custom_open_color_picker_type(Application_Links* app, Color_Picker* picker); typedef void custom_open_color_picker_type(Application_Links* app, Color_Picker* picker);
@ -372,12 +378,14 @@ custom_buffer_line_y_difference_type *buffer_line_y_difference;
custom_buffer_line_shift_y_type *buffer_line_shift_y; custom_buffer_line_shift_y_type *buffer_line_shift_y;
custom_buffer_pos_at_relative_xy_type *buffer_pos_at_relative_xy; custom_buffer_pos_at_relative_xy_type *buffer_pos_at_relative_xy;
custom_buffer_relative_box_of_pos_type *buffer_relative_box_of_pos; custom_buffer_relative_box_of_pos_type *buffer_relative_box_of_pos;
custom_buffer_padded_box_of_pos_type *buffer_padded_box_of_pos;
custom_buffer_relative_character_from_pos_type *buffer_relative_character_from_pos; custom_buffer_relative_character_from_pos_type *buffer_relative_character_from_pos;
custom_buffer_pos_from_relative_character_type *buffer_pos_from_relative_character; custom_buffer_pos_from_relative_character_type *buffer_pos_from_relative_character;
custom_view_line_y_difference_type *view_line_y_difference; custom_view_line_y_difference_type *view_line_y_difference;
custom_view_line_shift_y_type *view_line_shift_y; custom_view_line_shift_y_type *view_line_shift_y;
custom_view_pos_at_relative_xy_type *view_pos_at_relative_xy; custom_view_pos_at_relative_xy_type *view_pos_at_relative_xy;
custom_view_relative_box_of_pos_type *view_relative_box_of_pos; custom_view_relative_box_of_pos_type *view_relative_box_of_pos;
custom_view_padded_box_of_pos_type *view_padded_box_of_pos;
custom_view_relative_character_from_pos_type *view_relative_character_from_pos; custom_view_relative_character_from_pos_type *view_relative_character_from_pos;
custom_view_pos_from_relative_character_type *view_pos_from_relative_character; custom_view_pos_from_relative_character_type *view_pos_from_relative_character;
custom_buffer_exists_type *buffer_exists; custom_buffer_exists_type *buffer_exists;
@ -437,7 +445,6 @@ custom_view_set_buffer_scroll_type *view_set_buffer_scroll;
custom_view_set_mark_type *view_set_mark; custom_view_set_mark_type *view_set_mark;
custom_view_quit_ui_type *view_quit_ui; custom_view_quit_ui_type *view_quit_ui;
custom_view_set_buffer_type *view_set_buffer; custom_view_set_buffer_type *view_set_buffer;
custom_view_post_fade_type *view_post_fade;
custom_view_push_context_type *view_push_context; custom_view_push_context_type *view_push_context;
custom_view_pop_context_type *view_pop_context; custom_view_pop_context_type *view_pop_context;
custom_view_alter_context_type *view_alter_context; custom_view_alter_context_type *view_alter_context;
@ -501,6 +508,7 @@ custom_try_release_face_type *try_release_face;
custom_push_hot_directory_type *push_hot_directory; custom_push_hot_directory_type *push_hot_directory;
custom_set_hot_directory_type *set_hot_directory; custom_set_hot_directory_type *set_hot_directory;
custom_send_exit_signal_type *send_exit_signal; custom_send_exit_signal_type *send_exit_signal;
custom_hard_exit_type *hard_exit;
custom_set_window_title_type *set_window_title; custom_set_window_title_type *set_window_title;
custom_draw_string_oriented_type *draw_string_oriented; custom_draw_string_oriented_type *draw_string_oriented;
custom_get_string_advance_type *get_string_advance; custom_get_string_advance_type *get_string_advance;
@ -514,6 +522,7 @@ custom_text_layout_get_visible_range_type *text_layout_get_visible_range;
custom_text_layout_line_on_screen_type *text_layout_line_on_screen; custom_text_layout_line_on_screen_type *text_layout_line_on_screen;
custom_text_layout_character_on_screen_type *text_layout_character_on_screen; custom_text_layout_character_on_screen_type *text_layout_character_on_screen;
custom_paint_text_color_type *paint_text_color; custom_paint_text_color_type *paint_text_color;
custom_paint_text_color_blend_type *paint_text_color_blend;
custom_text_layout_free_type *text_layout_free; custom_text_layout_free_type *text_layout_free;
custom_draw_text_layout_type *draw_text_layout; custom_draw_text_layout_type *draw_text_layout;
custom_open_color_picker_type *open_color_picker; custom_open_color_picker_type *open_color_picker;
@ -548,12 +557,14 @@ internal f32 buffer_line_y_difference(Application_Links* app, Buffer_ID buffer_i
internal Line_Shift_Vertical buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift); internal Line_Shift_Vertical buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift);
internal i64 buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy); internal i64 buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy);
internal Rect_f32 buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); internal Rect_f32 buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
internal Rect_f32 buffer_padded_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
internal i64 buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); internal i64 buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
internal i64 buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character); internal i64 buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character);
internal f32 view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b); internal f32 view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b);
internal Line_Shift_Vertical view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift); internal Line_Shift_Vertical view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift);
internal i64 view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy); internal i64 view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy);
internal Rect_f32 view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); internal Rect_f32 view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
internal Rect_f32 view_padded_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
internal i64 view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); internal i64 view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
internal i64 view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character); internal i64 view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character);
internal b32 buffer_exists(Application_Links* app, Buffer_ID buffer_id); internal b32 buffer_exists(Application_Links* app, Buffer_ID buffer_id);
@ -613,7 +624,6 @@ internal b32 view_set_buffer_scroll(Application_Links* app, View_ID view_id, Buf
internal b32 view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek); internal b32 view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek);
internal b32 view_quit_ui(Application_Links* app, View_ID view_id); internal b32 view_quit_ui(Application_Links* app, View_ID view_id);
internal b32 view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags); internal b32 view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags);
internal b32 view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, ARGB_Color color);
internal b32 view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx); internal b32 view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx);
internal b32 view_pop_context(Application_Links* app, View_ID view_id); internal b32 view_pop_context(Application_Links* app, View_ID view_id);
internal b32 view_alter_context(Application_Links* app, View_ID view_id, View_Context* ctx); internal b32 view_alter_context(Application_Links* app, View_ID view_id, View_Context* ctx);
@ -677,6 +687,7 @@ internal b32 try_release_face(Application_Links* app, Face_ID id, Face_ID replac
internal String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena); internal String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena);
internal void set_hot_directory(Application_Links* app, String_Const_u8 string); internal void set_hot_directory(Application_Links* app, String_Const_u8 string);
internal void send_exit_signal(Application_Links* app); internal void send_exit_signal(Application_Links* app);
internal void hard_exit(Application_Links* app);
internal void set_window_title(Application_Links* app, String_Const_u8 title); internal void set_window_title(Application_Links* app, String_Const_u8 title);
internal Vec2_f32 draw_string_oriented(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta); internal Vec2_f32 draw_string_oriented(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta);
internal f32 get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str); internal f32 get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str);
@ -690,6 +701,7 @@ internal Range_i64 text_layout_get_visible_range(Application_Links* app, Text_La
internal Range_f32 text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number); internal Range_f32 text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number);
internal Rect_f32 text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos); internal Rect_f32 text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos);
internal void paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color); internal void paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color);
internal void paint_text_color_blend(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color, f32 blend);
internal b32 text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id); internal b32 text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id);
internal void draw_text_layout(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color); internal void draw_text_layout(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color);
internal void open_color_picker(Application_Links* app, Color_Picker* picker); internal void open_color_picker(Application_Links* app, Color_Picker* picker);
@ -724,12 +736,14 @@ global custom_buffer_line_y_difference_type *buffer_line_y_difference = 0;
global custom_buffer_line_shift_y_type *buffer_line_shift_y = 0; global custom_buffer_line_shift_y_type *buffer_line_shift_y = 0;
global custom_buffer_pos_at_relative_xy_type *buffer_pos_at_relative_xy = 0; global custom_buffer_pos_at_relative_xy_type *buffer_pos_at_relative_xy = 0;
global custom_buffer_relative_box_of_pos_type *buffer_relative_box_of_pos = 0; global custom_buffer_relative_box_of_pos_type *buffer_relative_box_of_pos = 0;
global custom_buffer_padded_box_of_pos_type *buffer_padded_box_of_pos = 0;
global custom_buffer_relative_character_from_pos_type *buffer_relative_character_from_pos = 0; global custom_buffer_relative_character_from_pos_type *buffer_relative_character_from_pos = 0;
global custom_buffer_pos_from_relative_character_type *buffer_pos_from_relative_character = 0; global custom_buffer_pos_from_relative_character_type *buffer_pos_from_relative_character = 0;
global custom_view_line_y_difference_type *view_line_y_difference = 0; global custom_view_line_y_difference_type *view_line_y_difference = 0;
global custom_view_line_shift_y_type *view_line_shift_y = 0; global custom_view_line_shift_y_type *view_line_shift_y = 0;
global custom_view_pos_at_relative_xy_type *view_pos_at_relative_xy = 0; global custom_view_pos_at_relative_xy_type *view_pos_at_relative_xy = 0;
global custom_view_relative_box_of_pos_type *view_relative_box_of_pos = 0; global custom_view_relative_box_of_pos_type *view_relative_box_of_pos = 0;
global custom_view_padded_box_of_pos_type *view_padded_box_of_pos = 0;
global custom_view_relative_character_from_pos_type *view_relative_character_from_pos = 0; global custom_view_relative_character_from_pos_type *view_relative_character_from_pos = 0;
global custom_view_pos_from_relative_character_type *view_pos_from_relative_character = 0; global custom_view_pos_from_relative_character_type *view_pos_from_relative_character = 0;
global custom_buffer_exists_type *buffer_exists = 0; global custom_buffer_exists_type *buffer_exists = 0;
@ -789,7 +803,6 @@ global custom_view_set_buffer_scroll_type *view_set_buffer_scroll = 0;
global custom_view_set_mark_type *view_set_mark = 0; global custom_view_set_mark_type *view_set_mark = 0;
global custom_view_quit_ui_type *view_quit_ui = 0; global custom_view_quit_ui_type *view_quit_ui = 0;
global custom_view_set_buffer_type *view_set_buffer = 0; global custom_view_set_buffer_type *view_set_buffer = 0;
global custom_view_post_fade_type *view_post_fade = 0;
global custom_view_push_context_type *view_push_context = 0; global custom_view_push_context_type *view_push_context = 0;
global custom_view_pop_context_type *view_pop_context = 0; global custom_view_pop_context_type *view_pop_context = 0;
global custom_view_alter_context_type *view_alter_context = 0; global custom_view_alter_context_type *view_alter_context = 0;
@ -853,6 +866,7 @@ global custom_try_release_face_type *try_release_face = 0;
global custom_push_hot_directory_type *push_hot_directory = 0; global custom_push_hot_directory_type *push_hot_directory = 0;
global custom_set_hot_directory_type *set_hot_directory = 0; global custom_set_hot_directory_type *set_hot_directory = 0;
global custom_send_exit_signal_type *send_exit_signal = 0; global custom_send_exit_signal_type *send_exit_signal = 0;
global custom_hard_exit_type *hard_exit = 0;
global custom_set_window_title_type *set_window_title = 0; global custom_set_window_title_type *set_window_title = 0;
global custom_draw_string_oriented_type *draw_string_oriented = 0; global custom_draw_string_oriented_type *draw_string_oriented = 0;
global custom_get_string_advance_type *get_string_advance = 0; global custom_get_string_advance_type *get_string_advance = 0;
@ -866,6 +880,7 @@ global custom_text_layout_get_visible_range_type *text_layout_get_visible_range
global custom_text_layout_line_on_screen_type *text_layout_line_on_screen = 0; global custom_text_layout_line_on_screen_type *text_layout_line_on_screen = 0;
global custom_text_layout_character_on_screen_type *text_layout_character_on_screen = 0; global custom_text_layout_character_on_screen_type *text_layout_character_on_screen = 0;
global custom_paint_text_color_type *paint_text_color = 0; global custom_paint_text_color_type *paint_text_color = 0;
global custom_paint_text_color_blend_type *paint_text_color_blend = 0;
global custom_text_layout_free_type *text_layout_free = 0; global custom_text_layout_free_type *text_layout_free = 0;
global custom_draw_text_layout_type *draw_text_layout = 0; global custom_draw_text_layout_type *draw_text_layout = 0;
global custom_open_color_picker_type *open_color_picker = 0; global custom_open_color_picker_type *open_color_picker = 0;

View File

@ -161,6 +161,15 @@ api_param(arena, call, "i64", "base_line");
api_param(arena, call, "i64", "pos"); api_param(arena, call, "i64", "pos");
} }
{ {
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("buffer_padded_box_of_pos"), string_u8_litexpr("Rect_f32"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "Buffer_ID", "buffer_id");
api_param(arena, call, "f32", "width");
api_param(arena, call, "Face_ID", "face_id");
api_param(arena, call, "i64", "base_line");
api_param(arena, call, "i64", "pos");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("buffer_relative_character_from_pos"), string_u8_litexpr("i64"), string_u8_litexpr("")); API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("buffer_relative_character_from_pos"), string_u8_litexpr("i64"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app"); api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "Buffer_ID", "buffer_id"); api_param(arena, call, "Buffer_ID", "buffer_id");
@ -207,6 +216,13 @@ api_param(arena, call, "i64", "base_line");
api_param(arena, call, "i64", "pos"); api_param(arena, call, "i64", "pos");
} }
{ {
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("view_padded_box_of_pos"), string_u8_litexpr("Rect_f32"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "View_ID", "view_id");
api_param(arena, call, "i64", "base_line");
api_param(arena, call, "i64", "pos");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("view_relative_character_from_pos"), string_u8_litexpr("i64"), string_u8_litexpr("")); API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("view_relative_character_from_pos"), string_u8_litexpr("i64"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app"); api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "View_ID", "view_id"); api_param(arena, call, "View_ID", "view_id");
@ -890,6 +906,10 @@ API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("send_e
api_param(arena, call, "Application_Links*", "app"); api_param(arena, call, "Application_Links*", "app");
} }
{ {
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("hard_exit"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_window_title"), string_u8_litexpr("void"), string_u8_litexpr("")); API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_window_title"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app"); api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "String_Const_u8", "title"); api_param(arena, call, "String_Const_u8", "title");
@ -968,7 +988,7 @@ api_param(arena, call, "i64", "pos");
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("paint_text_color"), string_u8_litexpr("void"), string_u8_litexpr("")); API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("paint_text_color"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app"); api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "Text_Layout_ID", "layout_id"); api_param(arena, call, "Text_Layout_ID", "layout_id");
api_param(arena, call, "Interval_i64", "range"); api_param(arena, call, "Range_i64", "range");
api_param(arena, call, "ARGB_Color", "color"); api_param(arena, call, "ARGB_Color", "color");
} }
{ {

View File

@ -23,12 +23,14 @@ api(custom) function f32 buffer_line_y_difference(Application_Links* app, Buffer
api(custom) function Line_Shift_Vertical buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift); api(custom) function Line_Shift_Vertical buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift);
api(custom) function i64 buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy); api(custom) function i64 buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy);
api(custom) function Rect_f32 buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); api(custom) function Rect_f32 buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
api(custom) function Rect_f32 buffer_padded_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
api(custom) function i64 buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); api(custom) function i64 buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
api(custom) function i64 buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character); api(custom) function i64 buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character);
api(custom) function f32 view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b); api(custom) function f32 view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b);
api(custom) function Line_Shift_Vertical view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift); api(custom) function Line_Shift_Vertical view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift);
api(custom) function i64 view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy); api(custom) function i64 view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy);
api(custom) function Rect_f32 view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); api(custom) function Rect_f32 view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
api(custom) function Rect_f32 view_padded_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
api(custom) function i64 view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); api(custom) function i64 view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
api(custom) function i64 view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character); api(custom) function i64 view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character);
api(custom) function b32 buffer_exists(Application_Links* app, Buffer_ID buffer_id); api(custom) function b32 buffer_exists(Application_Links* app, Buffer_ID buffer_id);
@ -88,7 +90,6 @@ api(custom) function b32 view_set_buffer_scroll(Application_Links* app, View_ID
api(custom) function b32 view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek); api(custom) function b32 view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek);
api(custom) function b32 view_quit_ui(Application_Links* app, View_ID view_id); api(custom) function b32 view_quit_ui(Application_Links* app, View_ID view_id);
api(custom) function b32 view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags); api(custom) function b32 view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags);
api(custom) function b32 view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, ARGB_Color color);
api(custom) function b32 view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx); api(custom) function b32 view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx);
api(custom) function b32 view_pop_context(Application_Links* app, View_ID view_id); api(custom) function b32 view_pop_context(Application_Links* app, View_ID view_id);
api(custom) function b32 view_alter_context(Application_Links* app, View_ID view_id, View_Context* ctx); api(custom) function b32 view_alter_context(Application_Links* app, View_ID view_id, View_Context* ctx);
@ -152,6 +153,7 @@ api(custom) function b32 try_release_face(Application_Links* app, Face_ID id, Fa
api(custom) function String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena); api(custom) function String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena);
api(custom) function void set_hot_directory(Application_Links* app, String_Const_u8 string); api(custom) function void set_hot_directory(Application_Links* app, String_Const_u8 string);
api(custom) function void send_exit_signal(Application_Links* app); api(custom) function void send_exit_signal(Application_Links* app);
api(custom) function void hard_exit(Application_Links* app);
api(custom) function void set_window_title(Application_Links* app, String_Const_u8 title); api(custom) function void set_window_title(Application_Links* app, String_Const_u8 title);
api(custom) function Vec2_f32 draw_string_oriented(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta); api(custom) function Vec2_f32 draw_string_oriented(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta);
api(custom) function f32 get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str); api(custom) function f32 get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str);
@ -165,6 +167,7 @@ api(custom) function Range_i64 text_layout_get_visible_range(Application_Links*
api(custom) function Range_f32 text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number); api(custom) function Range_f32 text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number);
api(custom) function Rect_f32 text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos); api(custom) function Rect_f32 text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos);
api(custom) function void paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color); api(custom) function void paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color);
api(custom) function void paint_text_color_blend(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color, f32 blend);
api(custom) function b32 text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id); api(custom) function b32 text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id);
api(custom) function void draw_text_layout(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color); api(custom) function void draw_text_layout(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color);
api(custom) function void open_color_picker(Application_Links* app, Color_Picker* picker); api(custom) function void open_color_picker(Application_Links* app, Color_Picker* picker);

View File

@ -43,447 +43,453 @@ lexeme_table_lookup(u64 *hash_array, String_Const_u8 *key_array,
} }
#endif #endif
u64 main_keys_hash_array[121] = { u64 cpp_main_keys_hash_array[124] = {
0x3165da52e461ac3f,0x0000000000000000,0x3165da52f92661bd,0x0000000000000000, 0x26092f2f0215ece3,0x0000000000000000,0x5ce5a2eda58b1f23,0xb2d6c5c6769fa3a3,
0x0000000000000000,0x0000000000000000,0x3165da52f9fa6ddb,0xbfc3c777d05a650b, 0xb9ddf454bfe26d23,0x0000000000000000,0xcd0f6cfa687dd553,0x0000000000000000,
0x3165da52ea1d2cb3,0x0000000000000000,0x0000000000000000,0x0000000000000000, 0x0000000000000000,0x5ce5a2e0c5100279,0x5ce5a2ede7babb3d,0x0000000000000000,
0x0000000000000000,0xa47e4b3347ca768b,0xa47e4b0d60643265,0xf9ddaa09147bac4d, 0x0000000000000000,0x6f6d951cb7cb582d,0x0e10b5f7624a6565,0xf889fe35be4428e3,
0x95351611c4501ef3,0x0000000000000000,0x0000000000000000,0xa47e4b33693ada65, 0x6f6d951cb404483f,0x26092f2f02f1c5ef,0x0000000000000000,0xe2b3ddb2fb5b2e6b,
0x0000000000000000,0xdb05013ca08bb8f1,0xf9ddaa091485019b,0xbfc3dfcbf5462bb3, 0x0000000000000000,0x6f6d951cb4ea937d,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0x3165da52f85e6961,0x0000000000000000,0xdb0563922ce5394d, 0x0000000000000000,0x0e10b1af23a24eb5,0x5ce5a2f3706ea43f,0x0000000000000000,
0x0000000000000000,0xa47e4b334bfc993f,0xdb02e2748a4d7e43,0x0000000000000000, 0xb2d6ca88b991d451,0xe2b3ddb2fb5a20a9,0x0000000000000000,0x26092f2f02d33cab,
0xb4c81ca554c806f3,0x0000000000000000,0x3165da52e0f88b5b,0x501eeeb814fbf821, 0x0000000000000000,0x0000000000000000,0x5ce5a2e66f839a73,0x0000000000000000,
0x0000000000000000,0xdb0503951fae6cc1,0x0000000000000000,0x0000000000000000, 0x5ce5a2eda5890521,0x0000000000000000,0x6f6d951cb4228ddb,0x6f6d951cba73c8ab,
0xbfc3de349dfab331,0x0000000000000000,0x0000000000000000,0x3165da52f092830f, 0xb9ddf454bfe26e41,0xd50b424c05eec7e9,0x8557f78510d2bb43,0x0000000000000000,
0xa47e4b300b3f05d3,0xbfc3dfcbf546362d,0xdb05125809d1c12f,0x0000000000000000, 0x0000000000000000,0x26092f2f020b132d,0x0000000000000000,0x0000000000000000,
0xed66c2eeb45a9c73,0x0000000000000000,0xf9ddaa0914eaa03f,0x77f5a2bcd06af3a3, 0xe2b3ddb2fb5bc1c9,0x0000000000000000,0x8ef935ae0949ace3,0x0000000000000000,
0xa47e4b0cab3b440f,0x0000000000000000,0x0000000000000000,0x3165da52ebde8871, 0x0000000000000000,0x0000000000000000,0x0000000000000000,0x26092f2f02d2781b,
0xa47e4b0cab0869b5,0x3165da52e5b576b7,0x0000000000000000,0x0000000000000000, 0x26092f2f02e7a15d,0xb2d6c74182f6a66d,0x0000000000000000,0x0000000000000000,
0xa47e4b336935d383,0x0000000000000000,0x0000000000000000,0xa47e4b30efc0220b, 0x0000000000000000,0x0000000000000000,0x0000000000000000,0x26092f2f02e78453,
0x0000000000000000,0x0000000000000000,0x501eeeb814fabe67,0xbfc3dfefa2fc3a77, 0xe2b3ddb2fb5bd5b5,0xb2d6c74182f6a7e9,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0xf9ddaa0914bb0bf9, 0xb2d6c6c7361150b5,0x5ce5a2e0b306cde5,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0xf9ddaa09148a58bb,0x0000000000000000,0xdb02e323971f6e8d, 0x0000000000000000,0x0000000000000000,0x5ce5a2e7e5c24db3,0x26092f2f0216583b,
0x501eeeb814fa0161,0xa9cef01e4d45a29b,0x501eeeb814fb939f,0x0000000000000000, 0x0e101bb85ac205ad,0x6f6d951cacb1aa35,0x0000000000000000,0x0000000000000000,
0xdb0517ba16b3ab83,0xbfc3dfb0ab021849,0xdb0541265bb691e9,0xbfc3df66cacb41a5, 0x0000000000000000,0x5ce5a2e197faf9d9,0xe2b3ddb2fb5baba1,0x6f6d951cba402e7b,
0xa47e4b325526bb31,0x0000000000000000,0xeca54fbddbbe35d5,0xa47e4b3347a263d3, 0x26092f2f02e1d2eb,0x0000000000000000,0x73a9345f7aa71363,0x0000000000000000,
0x0000000000000000,0x77e3dcb62d4753c1,0xdb05aa39286523b1,0x0000000000000000, 0x0e10b66610117f15,0x0000000000000000,0xe95e136b18f58763,0x0e10078c941fcafb,
0xf9ddaa0914b809a1,0x0000000000000000,0xc6f60bbdf7c8c073,0x3165da52e44f8393, 0x0000000000000000,0x0000000000000000,0x5ce5a2f37530abf3,0xb2d6c68c37b0f1f7,
0x0000000000000000,0x0000000000000000,0xa47e4b32f4f66927,0x0000000000000000, 0x5ce5a2e7e4364fe9,0x5ce5a2f37536698d,0x0000000000000000,0x0000000000000000,
0xf9ddaa0914dd4631,0x0000000000000000,0xa47e4b322642ad51,0x0000000000000000, 0x5ce5a2e049adcf39,0x0000000000000000,0x0000000000000000,0x0e100efea5987c03,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0x0000000000000000, 0x6f6d951c847de2fb,0x0e106caf9da9bbbd,0x0e109bd9232f3723,0x0000000000000000,
0xa47e4b335ea331b5,0x0000000000000000,0x0000000000000000,0x0000000000000000, 0x6f6d951c86ec6929,0x0000000000000000,0x0000000000000000,0x0e114d6868e6156b,
0xdb0545d45d35a161,0xeca54fbddbbe34ff,0x44a0daa872c59baf,0x0000000000000000, 0x6f6d951c8f3e1899,0x0e105b1fdc2b41ad,0xb2d6c5dc5a9a53e5,0x0000000000000000,
0xf9ddaa0914c5876b,0x0000000000000000,0x501eeeb814fa0b79,0xf9ddaa0914df8d85, 0x0000000000000000,0x0000000000000000,0x26092f2f0212aa4b,0x0000000000000000,
0xf9ddaa0914b167f3, 0x0000000000000000,0x0000000000000000,0x5ce5a2f37ca36a8b,0xcd1ba7f6b56d6ce3,
}; };
u8 main_keys_key_array_0[] = {0x63,0x61,0x74,0x63,0x68,}; u8 cpp_main_keys_key_array_0[] = {0x74,0x72,0x75,0x65,};
u8 main_keys_key_array_2[] = {0x75,0x6e,0x69,0x6f,0x6e,}; u8 cpp_main_keys_key_array_2[] = {0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 main_keys_key_array_6[] = {0x75,0x73,0x69,0x6e,0x67,}; u8 cpp_main_keys_key_array_3[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,};
u8 main_keys_key_array_7[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,}; u8 cpp_main_keys_key_array_4[] = {0x64,0x6f,};
u8 main_keys_key_array_8[] = {0x66,0x6c,0x6f,0x61,0x74,}; u8 cpp_main_keys_key_array_6[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,};
u8 main_keys_key_array_13[] = {0x73,0x74,0x61,0x74,0x69,0x63,}; u8 cpp_main_keys_key_array_9[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,};
u8 main_keys_key_array_14[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,}; u8 cpp_main_keys_key_array_10[] = {0x70,0x75,0x62,0x6c,0x69,0x63,};
u8 main_keys_key_array_15[] = {0x74,0x72,0x75,0x65,}; u8 cpp_main_keys_key_array_13[] = {0x63,0x6c,0x61,0x73,0x73,};
u8 main_keys_key_array_16[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; u8 cpp_main_keys_key_array_14[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,};
u8 main_keys_key_array_19[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,}; u8 cpp_main_keys_key_array_15[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_21[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,}; u8 cpp_main_keys_key_array_16[] = {0x63,0x61,0x74,0x63,0x68,};
u8 main_keys_key_array_22[] = {0x74,0x68,0x69,0x73,}; u8 cpp_main_keys_key_array_17[] = {0x67,0x6f,0x74,0x6f,};
u8 main_keys_key_array_23[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,}; u8 cpp_main_keys_key_array_19[] = {0x61,0x73,0x6d,};
u8 main_keys_key_array_25[] = {0x77,0x68,0x69,0x6c,0x65,}; u8 cpp_main_keys_key_array_21[] = {0x62,0x72,0x65,0x61,0x6b,};
u8 main_keys_key_array_27[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,}; u8 cpp_main_keys_key_array_25[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,};
u8 main_keys_key_array_29[] = {0x73,0x77,0x69,0x74,0x63,0x68,}; u8 cpp_main_keys_key_array_26[] = {0x73,0x77,0x69,0x74,0x63,0x68,};
u8 main_keys_key_array_30[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,}; u8 cpp_main_keys_key_array_28[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,};
u8 main_keys_key_array_32[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; u8 cpp_main_keys_key_array_29[] = {0x74,0x72,0x79,};
u8 main_keys_key_array_34[] = {0x62,0x72,0x65,0x61,0x6b,}; u8 cpp_main_keys_key_array_31[] = {0x65,0x6c,0x73,0x65,};
u8 main_keys_key_array_35[] = {0x74,0x72,0x79,}; u8 cpp_main_keys_key_array_34[] = {0x72,0x65,0x74,0x75,0x72,0x6e,};
u8 main_keys_key_array_37[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,}; u8 cpp_main_keys_key_array_36[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,};
u8 main_keys_key_array_40[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,}; u8 cpp_main_keys_key_array_38[] = {0x63,0x6f,0x6e,0x73,0x74,};
u8 main_keys_key_array_43[] = {0x73,0x68,0x6f,0x72,0x74,}; u8 cpp_main_keys_key_array_39[] = {0x66,0x61,0x6c,0x73,0x65,};
u8 main_keys_key_array_44[] = {0x74,0x79,0x70,0x65,0x69,0x64,}; u8 cpp_main_keys_key_array_40[] = {0x69,0x66,};
u8 main_keys_key_array_45[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,}; u8 cpp_main_keys_key_array_41[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,};
u8 main_keys_key_array_46[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,}; u8 cpp_main_keys_key_array_42[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,};
u8 main_keys_key_array_48[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,}; u8 cpp_main_keys_key_array_45[] = {0x74,0x68,0x69,0x73,};
u8 main_keys_key_array_50[] = {0x67,0x6f,0x74,0x6f,}; u8 cpp_main_keys_key_array_48[] = {0x69,0x6e,0x74,};
u8 main_keys_key_array_51[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,}; u8 cpp_main_keys_key_array_50[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_52[] = {0x65,0x78,0x70,0x6f,0x72,0x74,}; u8 cpp_main_keys_key_array_55[] = {0x65,0x6e,0x75,0x6d,};
u8 main_keys_key_array_55[] = {0x66,0x61,0x6c,0x73,0x65,}; u8 cpp_main_keys_key_array_56[] = {0x63,0x68,0x61,0x72,};
u8 main_keys_key_array_56[] = {0x65,0x78,0x74,0x65,0x72,0x6e,}; u8 cpp_main_keys_key_array_57[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,};
u8 main_keys_key_array_57[] = {0x63,0x6c,0x61,0x73,0x73,}; u8 cpp_main_keys_key_array_63[] = {0x63,0x61,0x73,0x65,};
u8 main_keys_key_array_60[] = {0x73,0x69,0x67,0x6e,0x65,0x64,}; u8 cpp_main_keys_key_array_64[] = {0x66,0x6f,0x72,};
u8 main_keys_key_array_63[] = {0x70,0x75,0x62,0x6c,0x69,0x63,}; u8 cpp_main_keys_key_array_65[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,};
u8 main_keys_key_array_66[] = {0x69,0x6e,0x74,}; u8 cpp_main_keys_key_array_68[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,};
u8 main_keys_key_array_67[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,}; u8 cpp_main_keys_key_array_69[] = {0x64,0x65,0x6c,0x65,0x74,0x65,};
u8 main_keys_key_array_71[] = {0x63,0x68,0x61,0x72,}; u8 cpp_main_keys_key_array_74[] = {0x65,0x78,0x74,0x65,0x72,0x6e,};
u8 main_keys_key_array_73[] = {0x6c,0x6f,0x6e,0x67,}; u8 cpp_main_keys_key_array_75[] = {0x6c,0x6f,0x6e,0x67,};
u8 main_keys_key_array_75[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,}; u8 cpp_main_keys_key_array_76[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,};
u8 main_keys_key_array_76[] = {0x66,0x6f,0x72,}; u8 cpp_main_keys_key_array_77[] = {0x77,0x68,0x69,0x6c,0x65,};
u8 main_keys_key_array_77[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,}; u8 cpp_main_keys_key_array_81[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,};
u8 main_keys_key_array_78[] = {0x6e,0x65,0x77,}; u8 cpp_main_keys_key_array_82[] = {0x6e,0x65,0x77,};
u8 main_keys_key_array_80[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,}; u8 cpp_main_keys_key_array_83[] = {0x66,0x6c,0x6f,0x61,0x74,};
u8 main_keys_key_array_81[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,}; u8 cpp_main_keys_key_array_84[] = {0x62,0x6f,0x6f,0x6c,};
u8 main_keys_key_array_82[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,}; u8 cpp_main_keys_key_array_86[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_83[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,}; u8 cpp_main_keys_key_array_88[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,};
u8 main_keys_key_array_84[] = {0x64,0x65,0x6c,0x65,0x74,0x65,}; u8 cpp_main_keys_key_array_90[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_86[] = {0x69,0x66,}; u8 cpp_main_keys_key_array_91[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,};
u8 main_keys_key_array_87[] = {0x73,0x74,0x72,0x75,0x63,0x74,}; u8 cpp_main_keys_key_array_94[] = {0x73,0x74,0x72,0x75,0x63,0x74,};
u8 main_keys_key_array_89[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,}; u8 cpp_main_keys_key_array_95[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,};
u8 main_keys_key_array_90[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,}; u8 cpp_main_keys_key_array_96[] = {0x65,0x78,0x70,0x6f,0x72,0x74,};
u8 main_keys_key_array_92[] = {0x63,0x61,0x73,0x65,}; u8 cpp_main_keys_key_array_97[] = {0x73,0x74,0x61,0x74,0x69,0x63,};
u8 main_keys_key_array_94[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,}; u8 cpp_main_keys_key_array_100[] = {0x66,0x72,0x69,0x65,0x6e,0x64,};
u8 main_keys_key_array_95[] = {0x63,0x6f,0x6e,0x73,0x74,}; u8 cpp_main_keys_key_array_103[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,};
u8 main_keys_key_array_98[] = {0x66,0x72,0x69,0x65,0x6e,0x64,}; u8 cpp_main_keys_key_array_104[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 main_keys_key_array_100[] = {0x65,0x6c,0x73,0x65,}; u8 cpp_main_keys_key_array_105[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,};
u8 main_keys_key_array_102[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,}; u8 cpp_main_keys_key_array_106[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 main_keys_key_array_108[] = {0x72,0x65,0x74,0x75,0x72,0x6e,}; u8 cpp_main_keys_key_array_108[] = {0x73,0x68,0x6f,0x72,0x74,};
u8 main_keys_key_array_112[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,}; u8 cpp_main_keys_key_array_111[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,};
u8 main_keys_key_array_113[] = {0x64,0x6f,}; u8 cpp_main_keys_key_array_112[] = {0x75,0x6e,0x69,0x6f,0x6e,};
u8 main_keys_key_array_114[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,}; u8 cpp_main_keys_key_array_113[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,};
u8 main_keys_key_array_116[] = {0x62,0x6f,0x6f,0x6c,}; u8 cpp_main_keys_key_array_114[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,};
u8 main_keys_key_array_118[] = {0x61,0x73,0x6d,}; u8 cpp_main_keys_key_array_118[] = {0x76,0x6f,0x69,0x64,};
u8 main_keys_key_array_119[] = {0x65,0x6e,0x75,0x6d,}; u8 cpp_main_keys_key_array_122[] = {0x74,0x79,0x70,0x65,0x69,0x64,};
u8 main_keys_key_array_120[] = {0x76,0x6f,0x69,0x64,}; u8 cpp_main_keys_key_array_123[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,};
String_Const_u8 main_keys_key_array[121] = { String_Const_u8 cpp_main_keys_key_array[124] = {
{main_keys_key_array_0, 5}, {cpp_main_keys_key_array_0, 4},
{0, 0}, {0, 0},
{main_keys_key_array_2, 5}, {cpp_main_keys_key_array_2, 6},
{cpp_main_keys_key_array_3, 7},
{cpp_main_keys_key_array_4, 2},
{0, 0},
{cpp_main_keys_key_array_6, 9},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_9, 6},
{cpp_main_keys_key_array_10, 6},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_13, 5},
{cpp_main_keys_key_array_14, 8},
{cpp_main_keys_key_array_15, 11},
{cpp_main_keys_key_array_16, 5},
{cpp_main_keys_key_array_17, 4},
{0, 0},
{cpp_main_keys_key_array_19, 3},
{0, 0},
{cpp_main_keys_key_array_21, 5},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_6, 5}, {cpp_main_keys_key_array_25, 8},
{main_keys_key_array_7, 7}, {cpp_main_keys_key_array_26, 6},
{main_keys_key_array_8, 5}, {0, 0},
{cpp_main_keys_key_array_28, 7},
{cpp_main_keys_key_array_29, 3},
{0, 0},
{cpp_main_keys_key_array_31, 4},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_34, 6},
{0, 0},
{cpp_main_keys_key_array_36, 6},
{0, 0},
{cpp_main_keys_key_array_38, 5},
{cpp_main_keys_key_array_39, 5},
{cpp_main_keys_key_array_40, 2},
{cpp_main_keys_key_array_41, 13},
{cpp_main_keys_key_array_42, 12},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_45, 4},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_48, 3},
{0, 0},
{cpp_main_keys_key_array_50, 12},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_13, 6}, {cpp_main_keys_key_array_55, 4},
{main_keys_key_array_14, 6}, {cpp_main_keys_key_array_56, 4},
{main_keys_key_array_15, 4}, {cpp_main_keys_key_array_57, 7},
{main_keys_key_array_16, 12},
{0, 0},
{0, 0},
{main_keys_key_array_19, 6},
{0, 0},
{main_keys_key_array_21, 8},
{main_keys_key_array_22, 4},
{main_keys_key_array_23, 7},
{0, 0},
{main_keys_key_array_25, 5},
{0, 0},
{main_keys_key_array_27, 8},
{0, 0},
{main_keys_key_array_29, 6},
{main_keys_key_array_30, 8},
{0, 0},
{main_keys_key_array_32, 11},
{0, 0},
{main_keys_key_array_34, 5},
{main_keys_key_array_35, 3},
{0, 0},
{main_keys_key_array_37, 8},
{0, 0},
{0, 0},
{main_keys_key_array_40, 7},
{0, 0},
{0, 0},
{main_keys_key_array_43, 5},
{main_keys_key_array_44, 6},
{main_keys_key_array_45, 7},
{main_keys_key_array_46, 8},
{0, 0},
{main_keys_key_array_48, 16},
{0, 0},
{main_keys_key_array_50, 4},
{main_keys_key_array_51, 9},
{main_keys_key_array_52, 6},
{0, 0},
{0, 0},
{main_keys_key_array_55, 5},
{main_keys_key_array_56, 6},
{main_keys_key_array_57, 5},
{0, 0},
{0, 0},
{main_keys_key_array_60, 6},
{0, 0},
{0, 0},
{main_keys_key_array_63, 6},
{0, 0},
{0, 0},
{main_keys_key_array_66, 3},
{main_keys_key_array_67, 7},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_71, 4},
{0, 0},
{main_keys_key_array_73, 4},
{0, 0},
{main_keys_key_array_75, 8},
{main_keys_key_array_76, 3},
{main_keys_key_array_77, 12},
{main_keys_key_array_78, 3},
{0, 0},
{main_keys_key_array_80, 8},
{main_keys_key_array_81, 7},
{main_keys_key_array_82, 8},
{main_keys_key_array_83, 7},
{main_keys_key_array_84, 6},
{0, 0},
{main_keys_key_array_86, 2},
{main_keys_key_array_87, 6},
{0, 0},
{main_keys_key_array_89, 9},
{main_keys_key_array_90, 8},
{0, 0},
{main_keys_key_array_92, 4},
{0, 0},
{main_keys_key_array_94, 10},
{main_keys_key_array_95, 5},
{0, 0},
{0, 0},
{main_keys_key_array_98, 6},
{0, 0},
{main_keys_key_array_100, 4},
{0, 0},
{main_keys_key_array_102, 6},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_108, 6}, {cpp_main_keys_key_array_63, 4},
{cpp_main_keys_key_array_64, 3},
{cpp_main_keys_key_array_65, 7},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_68, 7},
{cpp_main_keys_key_array_69, 6},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_112, 8},
{main_keys_key_array_113, 2},
{main_keys_key_array_114, 13},
{0, 0}, {0, 0},
{main_keys_key_array_116, 4}, {cpp_main_keys_key_array_74, 6},
{cpp_main_keys_key_array_75, 4},
{cpp_main_keys_key_array_76, 8},
{cpp_main_keys_key_array_77, 5},
{0, 0}, {0, 0},
{main_keys_key_array_118, 3}, {0, 0},
{main_keys_key_array_119, 4}, {0, 0},
{main_keys_key_array_120, 4}, {cpp_main_keys_key_array_81, 6},
{cpp_main_keys_key_array_82, 3},
{cpp_main_keys_key_array_83, 5},
{cpp_main_keys_key_array_84, 4},
{0, 0},
{cpp_main_keys_key_array_86, 10},
{0, 0},
{cpp_main_keys_key_array_88, 8},
{0, 0},
{cpp_main_keys_key_array_90, 16},
{cpp_main_keys_key_array_91, 8},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_94, 6},
{cpp_main_keys_key_array_95, 7},
{cpp_main_keys_key_array_96, 6},
{cpp_main_keys_key_array_97, 6},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_100, 6},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_103, 8},
{cpp_main_keys_key_array_104, 5},
{cpp_main_keys_key_array_105, 8},
{cpp_main_keys_key_array_106, 8},
{0, 0},
{cpp_main_keys_key_array_108, 5},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_111, 8},
{cpp_main_keys_key_array_112, 5},
{cpp_main_keys_key_array_113, 8},
{cpp_main_keys_key_array_114, 7},
{0, 0},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_118, 4},
{0, 0},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_122, 6},
{cpp_main_keys_key_array_123, 9},
}; };
Lexeme_Table_Value main_keys_value_array[121] = { Lexeme_Table_Value cpp_main_keys_value_array[124] = {
{4, TokenCppKind_Catch},
{0, 0},
{4, TokenCppKind_Union},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Using},
{4, TokenCppKind_Virtual},
{4, TokenCppKind_Float},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Static},
{4, TokenCppKind_Inline},
{8, TokenCppKind_LiteralTrue}, {8, TokenCppKind_LiteralTrue},
{4, TokenCppKind_DynamicCast},
{0, 0},
{0, 0},
{4, TokenCppKind_SizeOf},
{0, 0},
{4, TokenCppKind_Template},
{4, TokenCppKind_This},
{4, TokenCppKind_AlignAs},
{0, 0},
{4, TokenCppKind_While},
{0, 0},
{4, TokenCppKind_Typename},
{0, 0},
{4, TokenCppKind_Switch},
{4, TokenCppKind_Explicit},
{0, 0},
{4, TokenCppKind_StaticCast},
{0, 0},
{4, TokenCppKind_Break},
{4, TokenCppKind_Try},
{0, 0},
{4, TokenCppKind_DeclType},
{0, 0},
{0, 0},
{4, TokenCppKind_Private},
{0, 0},
{0, 0},
{4, TokenCppKind_Short},
{4, TokenCppKind_TypeID},
{4, TokenCppKind_AlignOf},
{4, TokenCppKind_NoExcept},
{0, 0},
{4, TokenCppKind_ReinterpretCast},
{0, 0},
{4, TokenCppKind_Goto},
{4, TokenCppKind_Protected},
{4, TokenCppKind_Export},
{0, 0},
{0, 0},
{8, TokenCppKind_LiteralFalse},
{4, TokenCppKind_Extern},
{4, TokenCppKind_Class},
{0, 0},
{0, 0}, {0, 0},
{4, TokenCppKind_Signed}, {4, TokenCppKind_Signed},
{4, TokenCppKind_Virtual},
{4, TokenCppKind_Do},
{0, 0},
{4, TokenCppKind_Protected},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{4, TokenCppKind_Double},
{4, TokenCppKind_Public}, {4, TokenCppKind_Public},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{4, TokenCppKind_Int}, {4, TokenCppKind_Class},
{4, TokenCppKind_Default}, {4, TokenCppKind_Template},
{4, TokenCppKind_StaticCast},
{4, TokenCppKind_Catch},
{4, TokenCppKind_Goto},
{0, 0}, {0, 0},
{4, TokenCppKind_Asm},
{0, 0}, {0, 0},
{0, 0}, {4, TokenCppKind_Break},
{4, TokenCppKind_Char},
{0, 0},
{4, TokenCppKind_Long},
{0, 0},
{4, TokenCppKind_Continue},
{4, TokenCppKind_For},
{4, TokenCppKind_ThreadLocal},
{4, TokenCppKind_New},
{0, 0},
{4, TokenCppKind_Unsigned},
{4, TokenCppKind_NullPtr},
{4, TokenCppKind_Operator},
{4, TokenCppKind_Typedef},
{4, TokenCppKind_Delete},
{0, 0},
{4, TokenCppKind_If},
{4, TokenCppKind_Struct},
{0, 0},
{4, TokenCppKind_Namespace},
{4, TokenCppKind_Register},
{0, 0},
{4, TokenCppKind_Case},
{0, 0},
{4, TokenCppKind_ConstCast},
{4, TokenCppKind_Const},
{0, 0},
{0, 0},
{4, TokenCppKind_Friend},
{0, 0},
{4, TokenCppKind_Else},
{0, 0},
{4, TokenCppKind_Double},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Return},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{4, TokenCppKind_Volatile}, {4, TokenCppKind_Volatile},
{4, TokenCppKind_Do}, {4, TokenCppKind_Switch},
{4, TokenCppKind_StaticAssert},
{0, 0}, {0, 0},
{4, TokenCppKind_Typedef},
{4, TokenCppKind_Try},
{0, 0},
{4, TokenCppKind_Else},
{0, 0},
{0, 0},
{4, TokenCppKind_Return},
{0, 0},
{4, TokenCppKind_SizeOf},
{0, 0},
{4, TokenCppKind_Const},
{8, TokenCppKind_LiteralFalse},
{4, TokenCppKind_If},
{4, TokenCppKind_StaticAssert},
{4, TokenCppKind_ThreadLocal},
{0, 0},
{0, 0},
{4, TokenCppKind_This},
{0, 0},
{0, 0},
{4, TokenCppKind_Int},
{0, 0},
{4, TokenCppKind_DynamicCast},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Enum},
{4, TokenCppKind_Char},
{4, TokenCppKind_AlignAs},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Case},
{4, TokenCppKind_For},
{4, TokenCppKind_AlignOf},
{0, 0},
{0, 0},
{4, TokenCppKind_Default},
{4, TokenCppKind_Delete},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Extern},
{4, TokenCppKind_Long},
{4, TokenCppKind_Register},
{4, TokenCppKind_While},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Inline},
{4, TokenCppKind_New},
{4, TokenCppKind_Float},
{4, TokenCppKind_Bool}, {4, TokenCppKind_Bool},
{0, 0}, {0, 0},
{4, TokenCppKind_Asm}, {4, TokenCppKind_ConstCast},
{4, TokenCppKind_Enum}, {0, 0},
{4, TokenCppKind_Operator},
{0, 0},
{4, TokenCppKind_ReinterpretCast},
{4, TokenCppKind_Explicit},
{0, 0},
{0, 0},
{4, TokenCppKind_Struct},
{4, TokenCppKind_NullPtr},
{4, TokenCppKind_Export},
{4, TokenCppKind_Static},
{0, 0},
{0, 0},
{4, TokenCppKind_Friend},
{0, 0},
{0, 0},
{4, TokenCppKind_Continue},
{4, TokenCppKind_Using},
{4, TokenCppKind_DeclType},
{4, TokenCppKind_Unsigned},
{0, 0},
{4, TokenCppKind_Short},
{0, 0},
{0, 0},
{4, TokenCppKind_Typename},
{4, TokenCppKind_Union},
{4, TokenCppKind_NoExcept},
{4, TokenCppKind_Private},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Void}, {4, TokenCppKind_Void},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_TypeID},
{4, TokenCppKind_Namespace},
}; };
i32 main_keys_slot_count = 121; i32 cpp_main_keys_slot_count = 124;
u64 main_keys_seed = 0x32a240442a6e221f; u64 cpp_main_keys_seed = 0x8546da5e0b8a4494;
u64 pp_directives_hash_array[25] = { u64 cpp_pp_directives_hash_array[25] = {
0xa8f3b0d79807b793,0x808ba552d670368f,0x0000000000000000,0x808ba54dc047d94b, 0xa9c93e3b092cb44d,0x0000000000000000,0x0dd88216be8f0f45,0x0000000000000000,
0x3b97f7088cbf95df,0x7fd91d3d238e04c9,0x0000000000000000,0x7fd91d3dac09e067, 0x0dd88216bc8af78d,0x92a889595c683c55,0xdab9e300145b906f,0x92a889577e972a4b,
0x0000000000000000,0x0000000000000000,0xa8f3beab5b880ad3,0x0000000000000000, 0x0000000000000000,0x0dd88216bb8053ff,0x0000000000000000,0x0dd88216bd573601,
0x3b97f7088cbffd3b,0x3b97f7088cdab44b,0x79521904bb682f3f,0x0000000000000000, 0x0000000000000000,0xdab9e300142a071d,0x0000000000000000,0xa9c93ef34054fce1,
0x0000000000000000,0x7fd91d3d978c615f,0x808ba553ad911e19,0x0000000000000000, 0x0dd88216a4783a45,0xdab9e300145b9a25,0x92a889595b4a2105,0x0000000000000000,
0x808ba54ef8496067,0x7fd91d3d2fe85067,0x7fd91d3d97a21607,0x0000000000000000, 0x86d1d427e10cd86d,0x0000000000000000,0x92a889590753d01d,0x0000000000000000,
0x0000000000000000, 0x0000000000000000,
}; };
u8 pp_directives_key_array_0[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,}; u8 cpp_pp_directives_key_array_0[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,};
u8 pp_directives_key_array_1[] = {0x70,0x72,0x61,0x67,0x6d,0x61,}; u8 cpp_pp_directives_key_array_2[] = {0x69,0x66,0x64,0x65,0x66,};
u8 pp_directives_key_array_3[] = {0x64,0x65,0x66,0x69,0x6e,0x65,}; u8 cpp_pp_directives_key_array_4[] = {0x65,0x6e,0x64,0x69,0x66,};
u8 pp_directives_key_array_4[] = {0x65,0x6c,0x69,0x66,}; u8 cpp_pp_directives_key_array_5[] = {0x69,0x66,0x6e,0x64,0x65,0x66,};
u8 pp_directives_key_array_5[] = {0x75,0x73,0x69,0x6e,0x67,}; u8 cpp_pp_directives_key_array_6[] = {0x65,0x6c,0x73,0x65,};
u8 pp_directives_key_array_7[] = {0x69,0x66,0x64,0x65,0x66,}; u8 cpp_pp_directives_key_array_7[] = {0x70,0x72,0x61,0x67,0x6d,0x61,};
u8 pp_directives_key_array_10[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,}; u8 cpp_pp_directives_key_array_9[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 pp_directives_key_array_12[] = {0x65,0x6c,0x73,0x65,}; u8 cpp_pp_directives_key_array_11[] = {0x65,0x72,0x72,0x6f,0x72,};
u8 pp_directives_key_array_13[] = {0x6c,0x69,0x6e,0x65,}; u8 cpp_pp_directives_key_array_13[] = {0x6c,0x69,0x6e,0x65,};
u8 pp_directives_key_array_14[] = {0x69,0x66,}; u8 cpp_pp_directives_key_array_15[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,};
u8 pp_directives_key_array_17[] = {0x65,0x6e,0x64,0x69,0x66,}; u8 cpp_pp_directives_key_array_16[] = {0x75,0x6e,0x64,0x65,0x66,};
u8 pp_directives_key_array_18[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,}; u8 cpp_pp_directives_key_array_17[] = {0x65,0x6c,0x69,0x66,};
u8 pp_directives_key_array_20[] = {0x69,0x66,0x6e,0x64,0x65,0x66,}; u8 cpp_pp_directives_key_array_18[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,};
u8 pp_directives_key_array_21[] = {0x75,0x6e,0x64,0x65,0x66,}; u8 cpp_pp_directives_key_array_20[] = {0x69,0x66,};
u8 pp_directives_key_array_22[] = {0x65,0x72,0x72,0x6f,0x72,}; u8 cpp_pp_directives_key_array_22[] = {0x64,0x65,0x66,0x69,0x6e,0x65,};
String_Const_u8 pp_directives_key_array[25] = { String_Const_u8 cpp_pp_directives_key_array[25] = {
{pp_directives_key_array_0, 7}, {cpp_pp_directives_key_array_0, 7},
{pp_directives_key_array_1, 6},
{0, 0}, {0, 0},
{pp_directives_key_array_3, 6}, {cpp_pp_directives_key_array_2, 5},
{pp_directives_key_array_4, 4},
{pp_directives_key_array_5, 5},
{0, 0}, {0, 0},
{pp_directives_key_array_7, 5}, {cpp_pp_directives_key_array_4, 5},
{cpp_pp_directives_key_array_5, 6},
{cpp_pp_directives_key_array_6, 4},
{cpp_pp_directives_key_array_7, 6},
{0, 0}, {0, 0},
{cpp_pp_directives_key_array_9, 5},
{0, 0}, {0, 0},
{pp_directives_key_array_10, 7}, {cpp_pp_directives_key_array_11, 5},
{0, 0}, {0, 0},
{pp_directives_key_array_12, 4}, {cpp_pp_directives_key_array_13, 4},
{pp_directives_key_array_13, 4},
{pp_directives_key_array_14, 2},
{0, 0}, {0, 0},
{cpp_pp_directives_key_array_15, 7},
{cpp_pp_directives_key_array_16, 5},
{cpp_pp_directives_key_array_17, 4},
{cpp_pp_directives_key_array_18, 6},
{0, 0}, {0, 0},
{pp_directives_key_array_17, 5}, {cpp_pp_directives_key_array_20, 2},
{pp_directives_key_array_18, 6},
{0, 0}, {0, 0},
{pp_directives_key_array_20, 6}, {cpp_pp_directives_key_array_22, 6},
{pp_directives_key_array_21, 5},
{pp_directives_key_array_22, 5},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
}; };
Lexeme_Table_Value pp_directives_value_array[25] = { Lexeme_Table_Value cpp_pp_directives_value_array[25] = {
{5, TokenCppKind_PPInclude}, {5, TokenCppKind_PPVersion},
{5, TokenCppKind_PPPragma},
{0, 0},
{5, TokenCppKind_PPDefine},
{5, TokenCppKind_PPElIf},
{5, TokenCppKind_PPUsing},
{0, 0}, {0, 0},
{5, TokenCppKind_PPIfDef}, {5, TokenCppKind_PPIfDef},
{0, 0}, {0, 0},
{0, 0},
{5, TokenCppKind_PPVersion},
{0, 0},
{5, TokenCppKind_PPElse},
{5, TokenCppKind_PPLine},
{5, TokenCppKind_PPIf},
{0, 0},
{0, 0},
{5, TokenCppKind_PPEndIf}, {5, TokenCppKind_PPEndIf},
{5, TokenCppKind_PPImport},
{0, 0},
{5, TokenCppKind_PPIfNDef}, {5, TokenCppKind_PPIfNDef},
{5, TokenCppKind_PPUndef}, {5, TokenCppKind_PPElse},
{5, TokenCppKind_PPPragma},
{0, 0},
{5, TokenCppKind_PPUsing},
{0, 0},
{5, TokenCppKind_PPError}, {5, TokenCppKind_PPError},
{0, 0}, {0, 0},
{5, TokenCppKind_PPLine},
{0, 0},
{5, TokenCppKind_PPInclude},
{5, TokenCppKind_PPUndef},
{5, TokenCppKind_PPElIf},
{5, TokenCppKind_PPImport},
{0, 0},
{5, TokenCppKind_PPIf},
{0, 0},
{5, TokenCppKind_PPDefine},
{0, 0},
{0, 0}, {0, 0},
}; };
i32 pp_directives_slot_count = 25; i32 cpp_pp_directives_slot_count = 25;
u64 pp_directives_seed = 0x8848fb3caaf5d4d5; u64 cpp_pp_directives_seed = 0x6e8a1011f7d8dd90;
u64 pp_keys_hash_array[2] = { u64 cpp_pp_keys_hash_array[2] = {
0x0000000000000000,0x72743f437c9f847d, 0x56dd32803fcaa4ab,0x0000000000000000,
}; };
u8 pp_keys_key_array_1[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,}; u8 cpp_pp_keys_key_array_0[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,};
String_Const_u8 pp_keys_key_array[2] = { String_Const_u8 cpp_pp_keys_key_array[2] = {
{cpp_pp_keys_key_array_0, 7},
{0, 0}, {0, 0},
{pp_keys_key_array_1, 7},
}; };
Lexeme_Table_Value pp_keys_value_array[2] = { Lexeme_Table_Value cpp_pp_keys_value_array[2] = {
{0, 0},
{4, TokenCppKind_PPDefined}, {4, TokenCppKind_PPDefined},
{0, 0},
}; };
i32 pp_keys_slot_count = 2; i32 cpp_pp_keys_slot_count = 2;
u64 pp_keys_seed = 0x71428d58f01a7eed; u64 cpp_pp_keys_seed = 0xbb7907ea1860ef2c;
struct Lex_State_Cpp{ struct Lex_State_Cpp{
u32 flags_ZF0; u32 flags_ZF0;
u32 flags_KF0; u32 flags_KF0;
@ -971,14 +977,14 @@ token.size = (i64)(state.ptr - state.emit_ptr);
token.flags = state.flags_KB0; token.flags = state.flags_KB0;
do{ do{
if (HasFlag(state.flags_KB0, 0x1)){ if (HasFlag(state.flags_KB0, 0x1)){
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_keys_hash_array, pp_keys_key_array, pp_keys_value_array, pp_keys_slot_count, pp_keys_seed, state.emit_ptr, token.size); Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_pp_keys_hash_array, cpp_pp_keys_key_array, cpp_pp_keys_value_array, cpp_pp_keys_slot_count, cpp_pp_keys_seed, state.emit_ptr, token.size);
if (lookup.found_match){ if (lookup.found_match){
token.kind = lookup.base_kind; token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind; token.sub_kind = lookup.sub_kind;
break; break;
} }
} }
Lexeme_Table_Lookup lookup = lexeme_table_lookup(main_keys_hash_array, main_keys_key_array, main_keys_value_array, main_keys_slot_count, main_keys_seed, state.emit_ptr, token.size); Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_main_keys_hash_array, cpp_main_keys_key_array, cpp_main_keys_value_array, cpp_main_keys_slot_count, cpp_main_keys_seed, state.emit_ptr, token.size);
if (lookup.found_match){ if (lookup.found_match){
token.kind = lookup.base_kind; token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind; token.sub_kind = lookup.sub_kind;
@ -1014,14 +1020,14 @@ token.size = (i64)(state.ptr - state.emit_ptr);
token.flags = state.flags_KB0; token.flags = state.flags_KB0;
do{ do{
if (HasFlag(state.flags_KB0, 0x1)){ if (HasFlag(state.flags_KB0, 0x1)){
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_keys_hash_array, pp_keys_key_array, pp_keys_value_array, pp_keys_slot_count, pp_keys_seed, state.emit_ptr, token.size); Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_pp_keys_hash_array, cpp_pp_keys_key_array, cpp_pp_keys_value_array, cpp_pp_keys_slot_count, cpp_pp_keys_seed, state.emit_ptr, token.size);
if (lookup.found_match){ if (lookup.found_match){
token.kind = lookup.base_kind; token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind; token.sub_kind = lookup.sub_kind;
break; break;
} }
} }
Lexeme_Table_Lookup lookup = lexeme_table_lookup(main_keys_hash_array, main_keys_key_array, main_keys_value_array, main_keys_slot_count, main_keys_seed, state.emit_ptr, token.size); Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_main_keys_hash_array, cpp_main_keys_key_array, cpp_main_keys_value_array, cpp_main_keys_slot_count, cpp_main_keys_seed, state.emit_ptr, token.size);
if (lookup.found_match){ if (lookup.found_match){
token.kind = lookup.base_kind; token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind; token.sub_kind = lookup.sub_kind;
@ -2760,7 +2766,7 @@ token.pos = (i64)(state.emit_ptr - state.base);
token.size = (i64)(state.ptr - state.emit_ptr); token.size = (i64)(state.ptr - state.emit_ptr);
token.flags = state.flags_KB0; token.flags = state.flags_KB0;
do{ do{
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_directives_hash_array, pp_directives_key_array, pp_directives_value_array, pp_directives_slot_count, pp_directives_seed, state.delim_first, (state.delim_one_past_last - state.delim_first)); Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_pp_directives_hash_array, cpp_pp_directives_key_array, cpp_pp_directives_value_array, cpp_pp_directives_slot_count, cpp_pp_directives_seed, state.delim_first, (state.delim_one_past_last - state.delim_first));
if (lookup.found_match){ if (lookup.found_match){
token.kind = lookup.base_kind; token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind; token.sub_kind = lookup.sub_kind;
@ -2797,7 +2803,7 @@ token.pos = (i64)(state.emit_ptr - state.base);
token.size = (i64)(state.ptr - state.emit_ptr); token.size = (i64)(state.ptr - state.emit_ptr);
token.flags = state.flags_KB0; token.flags = state.flags_KB0;
do{ do{
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_directives_hash_array, pp_directives_key_array, pp_directives_value_array, pp_directives_slot_count, pp_directives_seed, state.delim_first, (state.delim_one_past_last - state.delim_first)); Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_pp_directives_hash_array, cpp_pp_directives_key_array, cpp_pp_directives_value_array, cpp_pp_directives_slot_count, cpp_pp_directives_seed, state.delim_first, (state.delim_one_past_last - state.delim_first));
if (lookup.found_match){ if (lookup.found_match){
token.kind = lookup.base_kind; token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind; token.sub_kind = lookup.sub_kind;

View File

@ -1130,7 +1130,6 @@ build_language_model(void){
sm_case_eof_peek(emit); sm_case_eof_peek(emit);
} }
sm_fallback(comment_line); sm_fallback(comment_line);
} }
// BOTTOM // BOTTOM

View File

@ -2700,7 +2700,7 @@ opt_key_layout(Arena *arena, Keyword_Set keywords, i32 slot_count, u64 seed){
else{ else{
run_length += 1; run_length += 1;
layout.error_score += run_length; layout.error_score += run_length;
max_run_length = max(max_run_length, run_length); max_run_length = Max(max_run_length, run_length);
} }
} }
i32 total_run_length = run_length; i32 total_run_length = run_length;
@ -2711,7 +2711,7 @@ opt_key_layout(Arena *arena, Keyword_Set keywords, i32 slot_count, u64 seed){
else{ else{
layout.error_score += run_length; layout.error_score += run_length;
total_run_length += 1; total_run_length += 1;
max_run_length = max(max_run_length, total_run_length); max_run_length = Max(max_run_length, total_run_length);
} }
} }
layout.max_single_error_score = max_run_length; layout.max_single_error_score = max_run_length;
@ -3181,7 +3181,7 @@ gen_keyword_table(Arena *scratch, Token_Kind_Set tokens, Keyword_Set keywords, F
Temp_Memory temp = begin_temp(scratch); Temp_Memory temp = begin_temp(scratch);
Keyword_Layout key_layout = opt_key_layout(scratch, keywords); Keyword_Layout key_layout = opt_key_layout(scratch, keywords);
fprintf(out, "u64 %.*s_hash_array[%d] = {\n", fprintf(out, "u64 " LANG_NAME_LOWER_STR "_%.*s_hash_array[%d] = {\n",
string_expand(keywords.pretty_name), key_layout.slot_count); string_expand(keywords.pretty_name), key_layout.slot_count);
for (i32 i = 0; i < key_layout.slot_count; i += 1){ for (i32 i = 0; i < key_layout.slot_count; i += 1){
if (key_layout.slots[i] == 0){ if (key_layout.slots[i] == 0){
@ -3198,7 +3198,7 @@ gen_keyword_table(Arena *scratch, Token_Kind_Set tokens, Keyword_Set keywords, F
for (i32 i = 0; i < key_layout.slot_count; i += 1){ for (i32 i = 0; i < key_layout.slot_count; i += 1){
if (key_layout.slots[i] != 0){ if (key_layout.slots[i] != 0){
fprintf(out, "u8 %.*s_key_array_%d[] = {", fprintf(out, "u8 " LANG_NAME_LOWER_STR "_%.*s_key_array_%d[] = {",
string_expand(keywords.pretty_name), i); string_expand(keywords.pretty_name), i);
String_Const_u8 lexeme = key_layout.slots[i]->lexeme; String_Const_u8 lexeme = key_layout.slots[i]->lexeme;
for (u64 j = 0; j < lexeme.size; j += 1){ for (u64 j = 0; j < lexeme.size; j += 1){
@ -3208,20 +3208,20 @@ gen_keyword_table(Arena *scratch, Token_Kind_Set tokens, Keyword_Set keywords, F
} }
} }
fprintf(out, "String_Const_u8 %.*s_key_array[%d] = {\n", fprintf(out, "String_Const_u8 " LANG_NAME_LOWER_STR "_%.*s_key_array[%d] = {\n",
string_expand(keywords.pretty_name), key_layout.slot_count); string_expand(keywords.pretty_name), key_layout.slot_count);
for (i32 i = 0; i < key_layout.slot_count; i += 1){ for (i32 i = 0; i < key_layout.slot_count; i += 1){
if (key_layout.slots[i] == 0){ if (key_layout.slots[i] == 0){
fprintf(out, "{0, 0},\n"); fprintf(out, "{0, 0},\n");
} }
else{ else{
fprintf(out, "{%.*s_key_array_%d, %llu},\n", fprintf(out, "{" LANG_NAME_LOWER_STR "_%.*s_key_array_%d, %llu},\n",
string_expand(keywords.pretty_name), i, key_layout.slots[i]->lexeme.size); string_expand(keywords.pretty_name), i, key_layout.slots[i]->lexeme.size);
} }
} }
fprintf(out, "};\n"); fprintf(out, "};\n");
fprintf(out, "Lexeme_Table_Value %.*s_value_array[%d] = {\n", fprintf(out, "Lexeme_Table_Value " LANG_NAME_LOWER_STR "_%.*s_value_array[%d] = {\n",
string_expand(keywords.pretty_name), key_layout.slot_count); string_expand(keywords.pretty_name), key_layout.slot_count);
for (i32 i = 0; i < key_layout.slot_count; i += 1){ for (i32 i = 0; i < key_layout.slot_count; i += 1){
if (key_layout.slots[i] == 0){ if (key_layout.slots[i] == 0){
@ -3245,9 +3245,9 @@ gen_keyword_table(Arena *scratch, Token_Kind_Set tokens, Keyword_Set keywords, F
} }
fprintf(out, "};\n"); fprintf(out, "};\n");
fprintf(out, "i32 %.*s_slot_count = %d;\n", fprintf(out, "i32 " LANG_NAME_LOWER_STR "_%.*s_slot_count = %d;\n",
string_expand(keywords.pretty_name), key_layout.slot_count); string_expand(keywords.pretty_name), key_layout.slot_count);
fprintf(out, "u64 %.*s_seed = 0x%016llx;\n", fprintf(out, "u64 " LANG_NAME_LOWER_STR "_%.*s_seed = 0x%016llx;\n",
string_expand(keywords.pretty_name), key_layout.seed); string_expand(keywords.pretty_name), key_layout.seed);
end_temp(temp); end_temp(temp);
@ -3453,8 +3453,12 @@ gen_SLOW_action_list__cont_flow(Arena *scratch, Token_Kind_Set tokens, Flag_Set
{ {
Keyword_Set *keywords = handler->keywords; Keyword_Set *keywords = handler->keywords;
fprintf(out, "Lexeme_Table_Lookup lookup = " fprintf(out, "Lexeme_Table_Lookup lookup = "
"lexeme_table_lookup(%.*s_hash_array, %.*s_key_array, " "lexeme_table_lookup("
"%.*s_value_array, %.*s_slot_count, %.*s_seed, " LANG_NAME_LOWER_STR "_%.*s_hash_array, "
LANG_NAME_LOWER_STR "_%.*s_key_array, "
LANG_NAME_LOWER_STR "_%.*s_value_array, "
LANG_NAME_LOWER_STR "_%.*s_slot_count, "
LANG_NAME_LOWER_STR "_%.*s_seed, "
"state.emit_ptr, token.size);\n", "state.emit_ptr, token.size);\n",
string_expand(keywords->pretty_name), string_expand(keywords->pretty_name),
string_expand(keywords->pretty_name), string_expand(keywords->pretty_name),
@ -3477,8 +3481,12 @@ gen_SLOW_action_list__cont_flow(Arena *scratch, Token_Kind_Set tokens, Flag_Set
{ {
Keyword_Set *keywords = handler->keywords; Keyword_Set *keywords = handler->keywords;
fprintf(out, "Lexeme_Table_Lookup lookup = " fprintf(out, "Lexeme_Table_Lookup lookup = "
"lexeme_table_lookup(%.*s_hash_array, %.*s_key_array, " "lexeme_table_lookup("
"%.*s_value_array, %.*s_slot_count, %.*s_seed, " LANG_NAME_LOWER_STR "_%.*s_hash_array, "
LANG_NAME_LOWER_STR "_%.*s_key_array, "
LANG_NAME_LOWER_STR "_%.*s_value_array, "
LANG_NAME_LOWER_STR "_%.*s_slot_count, "
LANG_NAME_LOWER_STR "_%.*s_seed, "
"state.delim_first, (state.delim_one_past_last - state.delim_first));\n", "state.delim_first, (state.delim_one_past_last - state.delim_first));\n",
string_expand(keywords->pretty_name), string_expand(keywords->pretty_name),
string_expand(keywords->pretty_name), string_expand(keywords->pretty_name),

View File

@ -384,6 +384,39 @@ doc_custom_api__buffer(Arena *arena, API_Definition *api_def, Doc_Cluster *clust
//////////////////////////////// ////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "buffer_padded_box_of_pos", &func)){
doc_function_brief(arena, &func, "Compute the rectangle around a character at a particular byte position, relative to the top left corner of a given line");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "buffer_id");
doc_text(arena, params, "the id of the buffer who's layout will be measured");
doc_function_param(arena, &func, "width");
doc_text(arena, params, "the width parameter of the layout, passed to layout rules as a recommended wrap point");
doc_function_param(arena, &func, "face_id");
doc_text(arena, params, "the face parameter of the layout, passed to layout rules as a recommended face");
doc_function_param(arena, &func, "base_line");
doc_text(arena, params, "the line number of the line that serves as the relative starting point of the measurement");
doc_function_param(arena, &func, "pos");
doc_text(arena, params, "the absolute byte index of the position to query");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "the rectangle around a character in the layout that is closest to including the given query position in it's span, with coordinates set relative to the top left corner of the base line, on success, when the buffer exists and contains the base line and query position, cleared to zero otherwise");
// details
Doc_Block *det = doc_function_details(arena, &func);
doc_text(arena, det, "Line numbers are 1 based.");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "buffer_relative_character_from_pos", &func)){ if (begin_doc_call(arena, cluster, api_def, "buffer_relative_character_from_pos", &func)){
doc_function_brief(arena, &func, "Compute a character index relative to a particular lines first character"); doc_function_brief(arena, &func, "Compute a character index relative to a particular lines first character");
@ -627,6 +660,39 @@ doc_custom_api__buffer(Arena *arena, API_Definition *api_def, Doc_Cluster *clust
//////////////////////////////// ////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "buffer_set_layout", &func)){
doc_function_brief(arena, &func, "Set the layout function of a buffer");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "buffer_id");
doc_text(arena, params, "the id of the buffer to be modified");
doc_function_param(arena, &func, "layout_func");
doc_text(arena, params, "the new layout function for the buffer's layout");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "non-zero on success, when the buffer exists, otherwise zero");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "buffer_clear_layout_cache", &func)){
doc_function_brief(arena, &func, "Clear all the layout information cached in the buffer");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "buffer_id");
doc_text(arena, params, "the id of the buffer to be modified");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "buffer_get_layout", &func)){ if (begin_doc_call(arena, cluster, api_def, "buffer_get_layout", &func)){
doc_function_brief(arena, &func, "Retrieve the layout rule of a buffer"); doc_function_brief(arena, &func, "Retrieve the layout rule of a buffer");

View File

@ -1174,6 +1174,16 @@ doc_custom_api__global(Arena *arena, API_Definition *api_def, Doc_Cluster *clust
//////////////////////////////// ////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "hard_exit", &func)){
doc_function_brief(arena, &func, "Exits 4coder at the end of the frame, no matter what; for instance, call from the exit signal handler to actual exit 4coder.");
// params
doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "set_window_title", &func)){ if (begin_doc_call(arena, cluster, api_def, "set_window_title", &func)){
doc_function_brief(arena, &func, "Set the title of the 4coder window"); doc_function_brief(arena, &func, "Set the title of the 4coder window");

View File

@ -60,6 +60,8 @@ int main(void){
API_Definition *api_def = api_get_api(&def_list, string_u8_litexpr("custom")); API_Definition *api_def = api_get_api(&def_list, string_u8_litexpr("custom"));
Doc_Cluster *cluster = doc_custom_api(&arena, api_def); Doc_Cluster *cluster = doc_custom_api(&arena, api_def);
doc_api_check_full_coverage(&arena, cluster, api_def);
for (Doc_Log *node = cluster->first_log; for (Doc_Log *node = cluster->first_log;
node != 0; node != 0;
node = node->next){ node = node->next){

View File

@ -133,6 +133,33 @@ doc_custom_api__view(Arena *arena, API_Definition *api_def, Doc_Cluster *cluster
//////////////////////////////// ////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "view_padded_box_of_pos", &func)){
doc_function_brief(arena, &func, "Compute the rectangle around a character at a particular byte position, relative to the top left corner of a given line");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "view_id");
doc_text(arena, params, "the id of the view who's layout will be measured");
doc_function_param(arena, &func, "base_line");
doc_text(arena, params, "the line number of the line that serves as the relative starting point of the measurement");
doc_function_param(arena, &func, "pos");
doc_text(arena, params, "the absolute byte index of the position to query");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "the rectangle around a character in the layout that is closest to including the given query position in it's span, with coordinates set relative to the top left corner of the base line, on success, when the view exists and contains the base line and query position, cleared to zero otherwise");
// details
Doc_Block *det = doc_function_details(arena, &func);
doc_text(arena, det, "Line numbers are 1 based.");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "view_relative_character_from_pos", &func)){ if (begin_doc_call(arena, cluster, api_def, "view_relative_character_from_pos", &func)){
doc_function_brief(arena, &func, "Compute a character index relative to a particular lines first character"); doc_function_brief(arena, &func, "Compute a character index relative to a particular lines first character");
@ -888,13 +915,6 @@ doc_custom_api__view(Arena *arena, API_Definition *api_def, Doc_Cluster *cluster
//////////////////////////////// ////////////////////////////////
// TODO(allen): remove view_post_fade
if (begin_doc_call(arena, cluster, api_def, "view_post_fade", &func)){
doc_function_brief(arena, &func, "Plans to deprecate - do not rely on this call!");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "view_push_context", &func)){ if (begin_doc_call(arena, cluster, api_def, "view_push_context", &func)){
doc_function_brief(arena, &func, "Push a view's stack of context details with a pointer to the new values for the context"); doc_function_brief(arena, &func, "Push a view's stack of context details with a pointer to the new values for the context");

View File

@ -155,4 +155,19 @@ doc_function_add_related(Arena *arena, Doc_Block *rel, char *name){
content->page_link = SCu8(name); content->page_link = SCu8(name);
} }
////////////////////////////////
function void
doc_api_check_full_coverage(Arena *arena, Doc_Cluster *cluster, API_Definition *api_def){
for (API_Call *call = api_def->first_call;
call != 0;
call = call->next){
String_Const_u8 name = call->name;
Doc_Page *page = doc_get_page(cluster, name);
if (page == 0){
doc_errorf(arena, cluster, "missing documentation for %.*s", string_expand(name));
}
}
}
// BOTTOM // BOTTOM

641
metal/4ed_metal_render.mm Normal file
View File

@ -0,0 +1,641 @@
/* 4coder Metal render implementation */
#undef clamp
#undef function
#import <simd/simd.h>
#import <MetalKit/MetalKit.h>
#define function static
////////////////////////////////
struct Metal_Buffer{
Node node;
id<MTLBuffer> buffer;
u32 size;
u64 last_reuse_time;
};
////////////////////////////////
typedef id<MTLTexture> Metal_Texture;
// NOTE(yuval): This is a locator used to describe where a specific slot is located.
union Metal_Texture_Slot_Locator{
u32 packed;
struct{
u16 bucket_index;
u16 slot_index;
};
};
// NOTE(yuval): This is the ACTUAL texture slot. Each slot contains the texture handle, the slot locator, and a pointer to the next slot in the free list (in case the slot if not occupied).
struct Metal_Texture_Slot{
// NOTE(yuval): This is a pointer to the next texture in the free texture slots list
Metal_Texture_Slot *next;
Metal_Texture texture;
Metal_Texture_Slot_Locator locator;
};
global_const u32 metal__texture_slots_per_bucket = 256;
// NOTE(yuval): This a bucket of ACTUAL texture slots.
struct Metal_Texture_Slot_Bucket{
Metal_Texture_Slot_Bucket *next;
Metal_Texture_Slot slots[metal__texture_slots_per_bucket];
};
// NOTE(yuval): This a struct contaning all texture slot buckets and a list of the currently free slots.
struct Metal_Texture_Slot_List{
Metal_Texture_Slot_Bucket *first_bucket;
Metal_Texture_Slot_Bucket *last_bucket;
u16 bucket_count;
Metal_Texture_Slot *first_free_slot;
Metal_Texture_Slot *last_free_slot;
};
global_const u32 metal__invalid_texture_slot_locator = (u32)-1;
////////////////////////////////
@interface Metal_Renderer : NSObject<MTKViewDelegate>
- (nonnull instancetype)initWithMetalKitView:(nonnull MTKView*)mtkView target:(Render_Target*)target;
- (u32)get_texture_of_dim:(Vec3_i32)dim kind:(Texture_Kind)kind;
- (b32)fill_texture:(u32)texture kind:(Texture_Kind)kind pos:(Vec3_i32)p dim:(Vec3_i32)dim data:(void*)data;
- (void)bind_texture:(u32)handle encoder:(id<MTLRenderCommandEncoder>)render_encoder;
- (Metal_Texture_Slot*)get_texture_slot_at_locator:(Metal_Texture_Slot_Locator)locator;
- (Metal_Texture_Slot*)get_texture_slot_at_handle:(u32)handle;
- (Metal_Buffer*)get_reusable_buffer_with_size:(NSUInteger)size;
- (void)add_reusable_buffer:(Metal_Buffer*)buffer;
@end
////////////////////////////////
global_const char *metal__shaders_source = R"(
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
////////////////////////////////
typedef struct{
float2 xy [[attribute(0)]];
float3 uvw [[attribute(1)]];
uint32_t color [[attribute(2)]];
float half_thickness [[attribute(3)]];
} Vertex;
// NOTE(yuval): Vertex shader outputs and fragment shader inputs
typedef struct{
// NOTE(yuval): Vertex shader output
float4 position [[position]];
// NOTE(yuval): Fragment shader inputs
float4 color;
float3 uvw;
float2 xy;
float2 adjusted_half_dim;
float half_thickness;
} Rasterizer_Data;
////////////////////////////////
vertex Rasterizer_Data
vertex_shader(Vertex in [[stage_in]],
constant float4x4 &proj [[buffer(1)]]){
Rasterizer_Data out;
// NOTE(yuval): Calculate position in NDC
out.position = proj * float4(in.xy, 0.0, 1.0);
// NOTE(yuval): Convert color to float4 format
out.color.b = ((float((in.color ) & 0xFFu)) / 255.0);
out.color.g = ((float((in.color >> 8u) & 0xFFu)) / 255.0);
out.color.r = ((float((in.color >> 16u) & 0xFFu)) / 255.0);
out.color.a = ((float((in.color >> 24u) & 0xFFu)) / 255.0);
// NOTE(yuval): Pass uvw coordinates to the fragment shader
out.uvw = in.uvw;
// NOTE(yuval): Calculate adjusted half dim
float2 center = in.uvw.xy;
float2 half_dim = abs(in.xy - center);
out.adjusted_half_dim = (half_dim - in.uvw.zz + float2(0.5, 0.5));
// NOTE(yuval): Pass half_thickness to the fragment shader
out.half_thickness = in.half_thickness;
// NOTE(yuval): Pass xy to the fragment shader
out.xy = in.xy;
return(out);
}
////////////////////////////////
float
rectangle_sd(float2 p, float2 b){
float2 d = (abs(p) - b);
float result = (length(max(d, float2(0.0, 0.0))) + min(max(d.x, d.y), 0.0));
return(result);
}
fragment float4
fragment_shader(Rasterizer_Data in [[stage_in]],
texture2d_array<half> in_texture [[texture(0)]]){
float has_thickness = step(0.49, in.half_thickness);
float does_not_have_thickness = (1.0 - has_thickness);
constexpr sampler texture_sampler(coord::normalized, min_filter::linear, mag_filter::linear, mip_filter::linear);
half sample_value = in_texture.sample(texture_sampler, in.uvw.xy, in.uvw.z).r;
sample_value *= does_not_have_thickness;
float2 center = in.uvw.xy;
float roundness = in.uvw.z;
float sd = rectangle_sd(in.xy - center, in.adjusted_half_dim);
sd = sd - roundness;
sd = (abs(sd + in.half_thickness) - in.half_thickness);
float shape_value = (1.0 - smoothstep(-1.0, 0.0, sd));
shape_value *= has_thickness;
float4 out_color = float4(in.color.xyz, in.color.a * (sample_value + shape_value));
return(out_color);
}
)";
////////////////////////////////
function Metal_Buffer*
metal__make_buffer(u32 size, id<MTLDevice> device){
Metal_Buffer *result = (Metal_Buffer*)malloc(sizeof(Metal_Buffer));
// NOTE(yuval): Create the vertex buffer
MTLResourceOptions options = MTLCPUCacheModeWriteCombined|MTLResourceStorageModeManaged;
result->buffer = [device newBufferWithLength:size options:options];
result->size = size;
// NOTE(yuval): Set the last_reuse_time to the current time
result->last_reuse_time = system_now_time();
return result;
}
////////////////////////////////
@implementation Metal_Renderer{
Render_Target *_target;
id<MTLDevice> _device;
id<MTLRenderPipelineState> _pipeline_state;
id<MTLCommandQueue> _command_queue;
id<MTLCaptureScope> _capture_scope;
Node _buffer_cache;
u64 _last_buffer_cache_purge_time;
Metal_Texture_Slot_List _texture_slots;
}
- (nonnull instancetype)initWithMetalKitView:(nonnull MTKView*)mtk_view target:(Render_Target*)target{
self = [super init];
if (self == nil){
return(nil);
}
_target = target;
NSError *error = nil;
_device = mtk_view.device;
// NOTE(yuval): Compile the shaders
id<MTLFunction> vertex_function = nil;
id<MTLFunction> fragment_function = nil;
{
NSString *shaders_source_str = [NSString stringWithUTF8String:metal__shaders_source];
MTLCompileOptions *options = [[MTLCompileOptions alloc] init];
options.fastMathEnabled = YES;
id<MTLLibrary> shader_library = [_device newLibraryWithSource:shaders_source_str
options:options error:&error];
vertex_function = [shader_library newFunctionWithName:@"vertex_shader"];
fragment_function = [shader_library newFunctionWithName:@"fragment_shader"];
[options release];
}
Assert(error == nil);
Assert((vertex_function != nil) && (fragment_function != nil));
// NOTE(yuval): Configure the pipeline descriptor
{
MTLVertexDescriptor *vertexDescriptor = [MTLVertexDescriptor vertexDescriptor];
vertexDescriptor.attributes[0].offset = OffsetOfMember(Render_Vertex, xy);
vertexDescriptor.attributes[0].format = MTLVertexFormatFloat2; // position
vertexDescriptor.attributes[0].bufferIndex = 0;
vertexDescriptor.attributes[1].offset = OffsetOfMember(Render_Vertex, uvw);
vertexDescriptor.attributes[1].format = MTLVertexFormatFloat3; // texCoords
vertexDescriptor.attributes[1].bufferIndex = 0;
vertexDescriptor.attributes[2].offset = OffsetOfMember(Render_Vertex, color);
vertexDescriptor.attributes[2].format = MTLVertexFormatUInt; // color
vertexDescriptor.attributes[2].bufferIndex = 0;
vertexDescriptor.attributes[3].offset = OffsetOfMember(Render_Vertex, half_thickness);
vertexDescriptor.attributes[3].format = MTLVertexFormatFloat; // position
vertexDescriptor.attributes[3].bufferIndex = 0;
vertexDescriptor.layouts[0].stepRate = 1;
vertexDescriptor.layouts[0].stepFunction = MTLVertexStepFunctionPerVertex;
vertexDescriptor.layouts[0].stride = sizeof(Render_Vertex);
MTLRenderPipelineDescriptor *pipeline_state_descriptor = [[MTLRenderPipelineDescriptor alloc] init];
pipeline_state_descriptor.label = @"4coder Metal Renderer Pipeline";
pipeline_state_descriptor.vertexFunction = vertex_function;
pipeline_state_descriptor.fragmentFunction = fragment_function;
pipeline_state_descriptor.vertexDescriptor = vertexDescriptor;
pipeline_state_descriptor.colorAttachments[0].pixelFormat = mtk_view.colorPixelFormat;
pipeline_state_descriptor.colorAttachments[0].blendingEnabled = YES;
pipeline_state_descriptor.colorAttachments[0].alphaBlendOperation = MTLBlendOperationAdd;
pipeline_state_descriptor.colorAttachments[0].rgbBlendOperation = MTLBlendOperationAdd;
pipeline_state_descriptor.colorAttachments[0].sourceRGBBlendFactor = MTLBlendFactorSourceAlpha;
pipeline_state_descriptor.colorAttachments[0].destinationRGBBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
pipeline_state_descriptor.colorAttachments[0].sourceAlphaBlendFactor = MTLBlendFactorOne;
pipeline_state_descriptor.colorAttachments[0].destinationAlphaBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
_pipeline_state = [_device newRenderPipelineStateWithDescriptor:pipeline_state_descriptor
error:&error];
}
Assert(error == nil);
// NOTE(yuval): Create the command queue
_command_queue = [_device newCommandQueue];
// NOTE(yuval): Initialize buffer caching
dll_init_sentinel(&_buffer_cache);
_last_buffer_cache_purge_time = system_now_time();
// NOTE(yuval): Initialize the texture slot list
block_zero_struct(&_texture_slots);
// NOTE(yuval): Create the fallback texture
_target->fallback_texture_id = [self get_texture_of_dim:V3i32(2, 2, 1)
kind:TextureKind_Mono];
u8 white_block[] = {0xFF, 0xFF, 0xFF, 0xFF};
[self fill_texture:_target->fallback_texture_id
kind:TextureKind_Mono
pos:V3i32(0, 0, 0)
dim:V3i32(2, 2, 1)
data:white_block];
// NOTE(yuval): Create a capture scope for gpu frame capture
_capture_scope = [[MTLCaptureManager sharedCaptureManager]
newCaptureScopeWithDevice:_device];
_capture_scope.label = @"4coder Metal Capture Scope";
return(self);
}
- (void)mtkView:(nonnull MTKView*)view drawableSizeWillChange:(CGSize)size{
// NOTE(yuval): Nothing to do here because we use the render target's dimentions for rendering
}
- (void)drawInMTKView:(nonnull MTKView*)view{
#if FRED_INTERNAL
[_capture_scope beginScope];
#endif
// HACK(yuval): This is the best way I found to force valid width and height without drawing on the next draw cycle (1 frame delay).
CGSize drawable_size = [view drawableSize];
i32 width = (i32)Min(_target->width, drawable_size.width);
i32 height = (i32)Min(_target->height, drawable_size.height);
Font_Set *font_set = (Font_Set*)_target->font_set;
// NOTE(yuval): Free any textures in the target's texture free list
for (Render_Free_Texture *free_texture = _target->free_texture_first;
free_texture;
free_texture = free_texture->next){
Metal_Texture_Slot *texture_slot = [self get_texture_slot_at_handle:free_texture->tex_id];
if (texture_slot){
sll_queue_push(_texture_slots.first_free_slot, _texture_slots.last_free_slot, texture_slot);
}
}
_target->free_texture_first = 0;
_target->free_texture_last = 0;
// NOTE(yuval): Create the command buffer
id<MTLCommandBuffer> command_buffer = [_command_queue commandBuffer];
command_buffer.label = @"4coder Metal Render Command";
// NOTE(yuval): Obtain the render pass descriptor from the renderer's view
MTLRenderPassDescriptor *render_pass_descriptor = view.currentRenderPassDescriptor;
if (render_pass_descriptor != nil){
render_pass_descriptor.colorAttachments[0].clearColor = MTLClearColorMake(0.0f, 0.0f, 0.0f, 1.0f);
// NOTE(yuval): Create the render command encoder
id<MTLRenderCommandEncoder> render_encoder =
[command_buffer renderCommandEncoderWithDescriptor:render_pass_descriptor];
render_encoder.label = @"4coder Render Encoder";
// NOTE(yuval): Set the region of the drawable to draw into
[render_encoder setViewport:(MTLViewport){0.0, 0.0, (double)width, (double)height, 0.0, 1.0}];
// NOTE(yuval): Set the render pipeline to use for drawing
[render_encoder setRenderPipelineState:_pipeline_state];
// NOTE(yuval): Calculate the projection matrix
float left = 0, right = (float)width;
float bottom = (float)height, top = 0;
float near_depth = -1.0f, far_depth = 1.0f;
float proj[16] = {
2.0f / (right - left), 0.0f, 0.0f, 0.0f,
0.0f, 2.0f / (top - bottom), 0.0f, 0.0f,
0.0f, 0.0f, -1.0f / (far_depth - near_depth), 0.0f,
-((right + left) / (right - left)), -((top + bottom) / (top - bottom)),
-(near_depth / (far_depth - near_depth)), 1.0f
};
// NOTE(yuval): Calculate required vertex buffer size
i32 all_vertex_count = 0;
for (Render_Group *group = _target->group_first;
group;
group = group->next){
all_vertex_count += group->vertex_list.vertex_count;
}
u32 vertex_buffer_size = (all_vertex_count * sizeof(Render_Vertex));
// NOTE(yuval): Find & Get a vertex buffer matching the required size
Metal_Buffer *buffer = [self get_reusable_buffer_with_size:vertex_buffer_size];
// NOTE(yuval): Pass the vertex buffer to the vertex shader
[render_encoder setVertexBuffer:buffer->buffer
offset:0
atIndex:0];
// NOTE(yuval): Pass the projection matrix to the vertex shader
[render_encoder setVertexBytes:&proj
length:sizeof(proj)
atIndex:1];
u32 buffer_offset = 0;
for (Render_Group *group = _target->group_first;
group;
group = group->next){
// NOTE(yuval): Set scissor rect
{
Rect_i32 box = Ri32(group->clip_box);
NSUInteger x0 = (NSUInteger)Min(Max(0, box.x0), width - 1);
NSUInteger x1 = (NSUInteger)Min(Max(0, box.x1), width);
NSUInteger y0 = (NSUInteger)Min(Max(0, box.y0), height - 1);
NSUInteger y1 = (NSUInteger)Min(Max(0, box.y1), height);
MTLScissorRect scissor_rect;
scissor_rect.x = x0;
scissor_rect.y = y0;
scissor_rect.width = (x1 - x0);
scissor_rect.height = (y1 - y0);
[render_encoder setScissorRect:scissor_rect];
}
i32 vertex_count = group->vertex_list.vertex_count;
if (vertex_count > 0){
// NOTE(yuval): Bind a texture
{
Face* face = font_set_face_from_id(font_set, group->face_id);
if (face != 0){
// NOTE(yuval): Bind face texture
[self bind_texture:face->texture
encoder:render_encoder];
} else{
// NOTE(yuval): Bind fallback texture
[self bind_texture:_target->fallback_texture_id
encoder:render_encoder];
}
}
// NOTE(yuval): Copy the vertex data to the vertex buffer
{
u8 *group_buffer_contents = (u8*)[buffer->buffer contents] + buffer_offset;
u8 *cursor = group_buffer_contents;
for (Render_Vertex_Array_Node *node = group->vertex_list.first;
node;
node = node->next){
i32 size = node->vertex_count * sizeof(*node->vertices);
memcpy(cursor, node->vertices, size);
cursor += size;
}
NSUInteger data_size = (NSUInteger)(cursor - group_buffer_contents);
NSRange modify_range = NSMakeRange(buffer_offset, data_size);
[buffer->buffer didModifyRange:modify_range];
}
// NOTE(yuval): Set the vertex buffer offset to the beginning of the group's vertices
[render_encoder setVertexBufferOffset:buffer_offset atIndex:0];
// NOTE(yuval): Draw the vertices
[render_encoder drawPrimitives:MTLPrimitiveTypeTriangle
vertexStart:0
vertexCount:vertex_count];
buffer_offset += (vertex_count * sizeof(Render_Vertex));
}
}
[render_encoder endEncoding];
// NOTE(yuval): Schedule a present once the framebuffer is complete using the current drawable
[command_buffer presentDrawable:view.currentDrawable];
[command_buffer addCompletedHandler:^(id<MTLCommandBuffer>){
dispatch_async(dispatch_get_main_queue(), ^{
[self add_reusable_buffer:buffer];
});
}];
}
// NOTE(yuval): Finalize rendering here and push the command buffer to the GPU
[command_buffer commit];
#if FRED_INTERNAL
[_capture_scope endScope];
#endif
}
- (u32)get_texture_of_dim:(Vec3_i32)dim kind:(Texture_Kind)kind{
u32 handle = metal__invalid_texture_slot_locator;
// NOTE(yuval): Check for a free texture slot and allocate another slot bucket if no free slot has been found
if (!_texture_slots.first_free_slot){
// NOTE(yuval): Assert that the next bucket's index can fit in a u16
Assert(_texture_slots.bucket_count < ((u16)-1));
Metal_Texture_Slot_Bucket *bucket = (Metal_Texture_Slot_Bucket*)system_memory_allocate(sizeof(Metal_Texture_Slot_Bucket), file_name_line_number_lit_u8);
for (u16 slot_index = 0;
slot_index < ArrayCount(bucket->slots);
++slot_index){
Metal_Texture_Slot *slot = &bucket->slots[slot_index];
block_zero_struct(slot);
slot->locator.bucket_index = _texture_slots.bucket_count;
slot->locator.slot_index = slot_index;
sll_queue_push(_texture_slots.first_free_slot, _texture_slots.last_free_slot, slot);
}
sll_queue_push(_texture_slots.first_bucket, _texture_slots.last_bucket, bucket);
_texture_slots.bucket_count += 1;
}
// NOTE(yuval): Get the first free texture slot and remove it from the free list (a slot is guarenteed to exist because we assert that above).
if (_texture_slots.first_free_slot){
Metal_Texture_Slot *texture_slot = _texture_slots.first_free_slot;
sll_queue_pop(_texture_slots.first_free_slot, _texture_slots.last_free_slot);
texture_slot->next = 0;
// NOTE(yuval): Create a texture descriptor.
MTLTextureDescriptor *texture_descriptor = [[MTLTextureDescriptor alloc] init];
texture_descriptor.textureType = MTLTextureType2DArray;
texture_descriptor.pixelFormat = MTLPixelFormatR8Unorm;
texture_descriptor.width = dim.x;
texture_descriptor.height = dim.y;
texture_descriptor.depth = dim.z;
// NOTE(yuval): Create the texture from the device using the descriptor and add it to the textures array.
Metal_Texture texture = [_device newTextureWithDescriptor:texture_descriptor];
texture_slot->texture = texture;
handle = texture_slot->locator.packed;
}
return handle;
}
- (b32)fill_texture:(u32)handle kind:(Texture_Kind)kind pos:(Vec3_i32)p dim:(Vec3_i32)dim data:(void*)data{
b32 result = false;
if (data){
Metal_Texture_Slot *texture_slot = [self get_texture_slot_at_handle:handle];
if (texture_slot){
Metal_Texture texture = texture_slot->texture;
if (texture != 0){
MTLRegion replace_region = {
{(NSUInteger)p.x, (NSUInteger)p.y, (NSUInteger)p.z},
{(NSUInteger)dim.x, (NSUInteger)dim.y, (NSUInteger)dim.z}
};
// NOTE(yuval): Fill the texture with data
[texture replaceRegion:replace_region
mipmapLevel:0
withBytes:data
bytesPerRow:dim.x];
result = true;
}
}
}
return(result);
}
- (void)bind_texture:(u32)handle encoder:(id<MTLRenderCommandEncoder>)render_encoder{
Metal_Texture_Slot *texture_slot = [self get_texture_slot_at_handle:handle];
if (texture_slot){
Metal_Texture texture = texture_slot->texture;
if (texture != 0){
[render_encoder setFragmentTexture:texture
atIndex:0];
}
}
}
- (Metal_Texture_Slot*)get_texture_slot_at_locator:(Metal_Texture_Slot_Locator)locator{
Metal_Texture_Slot *result = 0;
if (locator.packed != metal__invalid_texture_slot_locator){
Metal_Texture_Slot_Bucket *bucket = _texture_slots.first_bucket;
for (u16 bucket_index = 0;
(bucket_index < locator.bucket_index) && bucket;
++bucket_index, bucket = bucket->next);
if (bucket && (locator.slot_index < metal__texture_slots_per_bucket)){
result = &bucket->slots[locator.slot_index];
}
}
return(result);
}
- (Metal_Texture_Slot*)get_texture_slot_at_handle:(u32)handle{
Metal_Texture_Slot_Locator locator;
locator.packed = handle;
Metal_Texture_Slot *result = [self get_texture_slot_at_locator:locator];
return(result);
}
- (Metal_Buffer*)get_reusable_buffer_with_size:(NSUInteger)size{
// NOTE(yuval): This routine is a modified version of Dear ImGui's MetalContext::dequeueReusableBufferOfLength in imgui_impl_metal.mm
u64 now = system_now_time();
// NOTE(yuval): Purge old buffers that haven't been useful for a while
if ((now - _last_buffer_cache_purge_time) > 1000000){
Node prev_buffer_cache = _buffer_cache;
dll_init_sentinel(&_buffer_cache);
for (Node *node = prev_buffer_cache.next;
node != &_buffer_cache;
node = node->next){
Metal_Buffer *candidate = CastFromMember(Metal_Buffer, node, node);
if (candidate->last_reuse_time > _last_buffer_cache_purge_time){
dll_insert(&_buffer_cache, node);
}
}
_last_buffer_cache_purge_time = now;
}
// NOTE(yuval): See if we have a buffer we can reuse
Metal_Buffer *best_candidate = 0;
for (Node *node = _buffer_cache.next;
node != &_buffer_cache;
node = node->next){
Metal_Buffer *candidate = CastFromMember(Metal_Buffer, node, node);
if ((candidate->size >= size) && ((!best_candidate) || (best_candidate->last_reuse_time > candidate->last_reuse_time))){
best_candidate = candidate;
}
}
Metal_Buffer *result;
if (best_candidate){
// NOTE(yuval): A best candidate has been found! Remove it from the buffer list and set its last reuse time.
dll_remove(&best_candidate->node);
best_candidate->last_reuse_time = now;
result = best_candidate;
} else{
// NOTE(yuval): No luck; make a new buffer.
result = metal__make_buffer(size, _device);
}
return(result);
}
- (void)add_reusable_buffer:(Metal_Buffer*)buffer{
// NOTE(yuval): This routine is a modified version of Dear ImGui's MetalContext::enqueueReusableBuffer in imgui_impl_metal.mm
dll_insert(&_buffer_cache, &buffer->node);
}
@end

View File

@ -12,8 +12,6 @@
#if !defined(FRED_OPENGL_DEFINES_H) #if !defined(FRED_OPENGL_DEFINES_H)
#define FRED_OPENGL_DEFINES_H #define FRED_OPENGL_DEFINES_H
#include <GL/gl.h>
#define GL_TEXTURE_MAX_LEVEL 0x813D #define GL_TEXTURE_MAX_LEVEL 0x813D
#define GL_MULTISAMPLE 0x809D #define GL_MULTISAMPLE 0x809D
@ -224,9 +222,6 @@ typedef void GL_Debug_Function(GLenum src,
void *user_data); void *user_data);
typedef GL_Debug_Function *GLDEBUGPROC; typedef GL_Debug_Function *GLDEBUGPROC;
#define GL_FUNC(N,R,P) typedef R (CALL_CONVENTION N##_Function)P; N##_Function *N = 0;
#include "4ed_opengl_funcs.h"
#endif #endif
// BOTTOM // BOTTOM

View File

@ -9,8 +9,6 @@
// TOP // TOP
#include "4ed_opengl_defines.h"
internal void internal void
gl__bind_texture(Render_Target *t, i32 texid){ gl__bind_texture(Render_Target *t, i32 texid){
if (t->bound_texture != texid){ if (t->bound_texture != texid){
@ -225,11 +223,16 @@ gl_render(Render_Target *t){
#if !SHIP_MODE #if !SHIP_MODE
glEnable(GL_DEBUG_OUTPUT); glEnable(GL_DEBUG_OUTPUT);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
if (glDebugMessageControl){
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_NOTIFICATION, 0, 0, false); glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_NOTIFICATION, 0, 0, false);
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW, 0, 0, false); glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW, 0, 0, false);
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_MEDIUM, 0, 0, true); glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_MEDIUM, 0, 0, true);
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, 0, true); glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, 0, true);
}
if (glDebugMessageCallback){
glDebugMessageCallback(gl__error_callback, 0); glDebugMessageCallback(gl__error_callback, 0);
}
#endif #endif
//////////////////////////////// ////////////////////////////////
@ -286,7 +289,15 @@ gl_render(Render_Target *t){
group != 0; group != 0;
group = group->next){ group = group->next){
Rect_i32 box = Ri32(group->clip_box); Rect_i32 box = Ri32(group->clip_box);
glScissor(box.x0, height - box.y1, box.x1 - box.x0, box.y1 - box.y0);
Rect_i32 scissor_box = {
box.x0, height - box.y1, box.x1 - box.x0, box.y1 - box.y0,
};
scissor_box.x0 = clamp_bot(0, scissor_box.x0);
scissor_box.y0 = clamp_bot(0, scissor_box.y0);
scissor_box.x1 = clamp_bot(0, scissor_box.x1);
scissor_box.y1 = clamp_bot(0, scissor_box.y1);
glScissor(scissor_box.x0, scissor_box.y0, scissor_box.x1, scissor_box.y1);
i32 vertex_count = group->vertex_list.vertex_count; i32 vertex_count = group->vertex_list.vertex_count;
if (vertex_count > 0){ if (vertex_count > 0){

1393
platform_mac/mac_4ed.mm Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,937 @@
/* macOS System/Graphics/Font API Implementations */
/********************/
/* System API */
/********************/
////////////////////////////////
function
system_get_path_sig(){
String_Const_u8 result = {};
switch (path_code){
case SystemPath_CurrentDirectory:
{
char *working_dir = getcwd(NULL, 0);
u64 working_dir_length = cstring_length(working_dir);
// TODO(yuval): Maybe use push_string_copy instead
u8 *out = push_array(arena, u8, working_dir_length);
block_copy(out, working_dir, working_dir_length);
free(working_dir);
result = SCu8(out, working_dir_length);
} break;
case SystemPath_Binary:
{
local_persist b32 has_stashed_4ed_path = false;
if (!has_stashed_4ed_path){
local_const u32 binary_path_capacity = PATH_MAX;
u8 *memory = (u8*)system_memory_allocate(binary_path_capacity, file_name_line_number_lit_u8);
pid_t pid = getpid();
i32 size = proc_pidpath(pid, memory, binary_path_capacity);
Assert(size < binary_path_capacity);
mac_vars.binary_path = SCu8(memory, size);
mac_vars.binary_path = string_remove_last_folder(mac_vars.binary_path);
mac_vars.binary_path.str[mac_vars.binary_path.size] = 0;
has_stashed_4ed_path = true;
}
result = push_string_copy(arena, mac_vars.binary_path);
} break;
}
return(result);
}
function
system_get_canonical_sig(){
NSString *path_ns_str =
[[NSString alloc] initWithBytes:name.data length:name.size encoding:NSUTF8StringEncoding];
NSString *standardized_path_ns_str = [path_ns_str stringByStandardizingPath];
String_Const_u8 standardized_path = SCu8((u8*)[standardized_path_ns_str UTF8String],[standardized_path_ns_str lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
String_Const_u8 result = push_string_copy(arena, standardized_path);
[path_ns_str release];
return(result);
}
////////////////////////////////
function File_Attributes
mac_get_file_attributes(struct stat file_stat) {
File_Attributes result;
result.size = file_stat.st_size;
result.last_write_time = file_stat.st_mtimespec.tv_sec;
result.flags = 0;
if (S_ISDIR(file_stat.st_mode)) {
result.flags |= FileAttribute_IsDirectory;
}
return(result);
}
function inline File_Attributes
mac_file_attributes_from_path(char *path) {
File_Attributes result = {};
struct stat file_stat;
if (stat(path, &file_stat) == 0){
result = mac_get_file_attributes(file_stat);
}
return(result);
}
function inline File_Attributes
mac_file_attributes_from_fd(i32 fd) {
File_Attributes result = {};
struct stat file_stat;
if (fstat(fd, &file_stat) == 0){
result = mac_get_file_attributes(file_stat);
}
return(result);
}
function
system_get_file_list_sig(){
File_List result = {};
u8 *c_directory = push_array(arena, u8, directory.size + 1);
block_copy(c_directory, directory.str, directory.size);
c_directory[directory.size] = 0;
DIR *dir = opendir((char*)c_directory);
if (dir){
File_Info* first = 0;
File_Info* last = 0;
i32 count = 0;
for (struct dirent *entry = readdir(dir);
entry;
entry = readdir(dir)){
char *c_file_name = entry->d_name;
String_Const_u8 file_name = SCu8(c_file_name);
if (string_match(file_name, string_u8_litexpr(".")) || string_match(file_name, string_u8_litexpr(".."))){
continue;
}
File_Info *info = push_array(arena, File_Info, 1);
sll_queue_push(first, last, info);
count += 1;
info->file_name = push_string_copy(arena, file_name);
// NOTE(yuval): Get file attributes
{
Temp_Memory temp = begin_temp(arena);
b32 append_slash = false;
u64 file_path_size = directory.size + file_name.size;
if (string_get_character(directory, directory.size - 1) != '/'){
append_slash = true;
file_path_size += 1;
}
char *file_path = push_array(arena, char, file_path_size + 1);
char *file_path_at = file_path;
block_copy(file_path_at, directory.str, directory.size);
file_path_at += directory.size;
if (append_slash){
*file_path_at = '/';
file_path_at += 1;
}
block_copy(file_path_at, file_name.str, file_name.size);
file_path_at += file_name.size;
*file_path_at = 0;
info->attributes = mac_file_attributes_from_path(file_path);
end_temp(temp);
}
}
closedir(dir);
result.infos = push_array(arena, File_Info*, count);
result.count = count;
i32 index = 0;
for (File_Info *node = first;
node != 0;
node = node->next){
result.infos[index] = node;
index += 1;
}
}
return(result);
}
function
system_quick_file_attributes_sig(){
Temp_Memory temp = begin_temp(scratch);
char *c_file_name = push_array(scratch, char, file_name.size + 1);
block_copy(c_file_name, file_name.str, file_name.size);
c_file_name[file_name.size] = 0;
File_Attributes result = mac_file_attributes_from_path(c_file_name);
end_temp(temp);
return(result);
}
function inline Plat_Handle
mac_to_plat_handle(i32 fd){
Plat_Handle result = *(Plat_Handle*)(&fd);
return(result);
}
function inline i32
mac_to_fd(Plat_Handle handle){
i32 result = *(i32*)(&handle);
return(result);
}
function
system_load_handle_sig(){
b32 result = false;
i32 fd = open(file_name, O_RDONLY);
if ((fd != -1) && (fd != 0)) {
*out = mac_to_plat_handle(fd);
result = true;
}
return(result);
}
function
system_load_attributes_sig(){
i32 fd = mac_to_fd(handle);
File_Attributes result = mac_file_attributes_from_fd(fd);
return(result);
}
function
system_load_file_sig(){
i32 fd = mac_to_fd(handle);
do{
ssize_t bytes_read = read(fd, buffer, size);
if (bytes_read == -1){
if (errno != EINTR){
// NOTE(yuval): An error occured while reading from the file descriptor
break;
}
} else{
size -= bytes_read;
buffer += bytes_read;
}
} while (size > 0);
b32 result = (size == 0);
return(result);
}
function
system_load_close_sig(){
b32 result = true;
i32 fd = mac_to_fd(handle);
if (close(fd) == -1){
// NOTE(yuval): An error occured while close the file descriptor
result = false;
}
return(result);
}
function
system_save_file_sig(){
File_Attributes result = {};
i32 fd = open(file_name, O_WRONLY | O_TRUNC | O_CREAT, 00640);
if (fd != -1) {
do{
ssize_t bytes_written = write(fd, data.str, data.size);
if (bytes_written == -1){
if (errno != EINTR){
// NOTE(yuval): An error occured while writing to the file descriptor
break;
}
} else{
data.size -= bytes_written;
data.str += bytes_written;
}
} while (data.size > 0);
if (data.size == 0) {
result = mac_file_attributes_from_fd(fd);
}
close(fd);
}
return(result);
}
////////////////////////////////
function inline System_Library
mac_to_system_library(void *dl_handle){
System_Library result = *(System_Library*)(&dl_handle);
return(result);
}
function inline void*
mac_to_dl_handle(System_Library system_lib){
void *result = *(void**)(&system_lib);
return(result);
}
function
system_load_library_sig(){
b32 result = false;
void *lib = 0;
// NOTE(yuval): Open library handle
{
Temp_Memory temp = begin_temp(scratch);
char *c_file_name = push_array(scratch, char, file_name.size + 1);
block_copy(c_file_name, file_name.str, file_name.size);
c_file_name[file_name.size] = 0;
lib = dlopen(c_file_name, RTLD_LAZY | RTLD_GLOBAL);
end_temp(temp);
}
if (lib){
*out = mac_to_system_library(lib);
result = true;
}
return(result);
}
function
system_release_library_sig(){
void *lib = mac_to_dl_handle(handle);
i32 rc = dlclose(lib);
b32 result = (rc == 0);
return(result);
}
function
system_get_proc_sig(){
void *lib = mac_to_dl_handle(handle);
Void_Func *result = (Void_Func*)dlsym(lib, proc_name);
return(result);
}
////////////////////////////////
function
system_now_time_sig(){
u64 now = mach_absolute_time();
// NOTE(yuval): Now time nanoseconds conversion
f64 now_nano = (f64)((f64)now *
((f64)mac_vars.timebase_info.numer /
(f64)mac_vars.timebase_info.denom));
// NOTE(yuval): Conversion to useconds
u64 result = (u64)(now_nano * 1.0E-3);
return(result);
}
function
system_wake_up_timer_create_sig(){
Mac_Object *object = mac_alloc_object(MacObjectKind_Timer);
dll_insert(&mac_vars.timer_objects, &object->node);
object->timer = nil;
Plat_Handle result = mac_to_plat_handle(object);
return(result);
}
function
system_wake_up_timer_release_sig(){
Mac_Object *object = mac_to_object(handle);
if (object->kind == MacObjectKind_Timer){
if ((object->timer != nil) && [object->timer isValid]) {
[object->timer invalidate];
mac_free_object(object);
}
}
}
function
system_wake_up_timer_set_sig(){
Mac_Object *object = mac_to_object(handle);
if (object->kind == MacObjectKind_Timer){
f64 time_seconds = ((f64)time_milliseconds / 1000.0);
object->timer = [NSTimer scheduledTimerWithTimeInterval:time_seconds
target:mac_vars.view
selector:@selector(request_display)
userInfo:nil repeats:NO];
}
}
function
system_signal_step_sig(){
#if 0
if (!mac_vars.step_requested){
[NSTimer scheduledTimerWithTimeInterval:0.0
target:mac_vars.view
selector:@selector(request_display)
userInfo:nil repeats:NO];
mac_vars.step_requested = true;
}
#else
mac_vars.step_requested = true;
dispatch_async(dispatch_get_main_queue(),
^{
[NSTimer scheduledTimerWithTimeInterval:0.0
target:mac_vars.view
selector:@selector(request_display)
userInfo:nil repeats:NO];
});
#endif
}
function
system_sleep_sig(){
u64 nanoseconds = (microseconds * Thousand(1));
u64 abs_sleep_time = (u64)((f64)nanoseconds *
((f64)mac_vars.timebase_info.denom /
(f64)mac_vars.timebase_info.numer));
u64 now = mach_absolute_time();
mach_wait_until(now + abs_sleep_time);
}
////////////////////////////////
function
system_post_clipboard_sig(){
Arena *arena = &mac_vars.clip_post_arena;
if (arena->base_allocator == 0){
*arena = make_arena_system();
} else{
linalloc_clear(arena);
}
mac_vars.clip_post.str = push_array(arena, u8, str.size + 1);
if (mac_vars.clip_post.str != 0){
block_copy(mac_vars.clip_post.str, str.str, str.size);
mac_vars.clip_post.str[str.size] = 0;
mac_vars.clip_post.size = str.size;
} else{
// NOTE(yuval): Failed to allocate buffer for clipboard post
}
}
////////////////////////////////
function
system_cli_call_sig(){
b32 result = false;
int pipe_fds[2];
if (pipe(pipe_fds) == -1){
perror("system_cli_call: pipe");
return(false);
}
pid_t child_pid = fork();
if (child_pid == -1){
perror("system_cli_call: fork");
return(false);
}
enum { PIPE_FD_READ, PIPE_FD_WRITE };
if (child_pid == 0){
// NOTE(yuval): Child Process
close(pipe_fds[PIPE_FD_READ]);
dup2(pipe_fds[PIPE_FD_WRITE], STDOUT_FILENO);
dup2(pipe_fds[PIPE_FD_WRITE], STDERR_FILENO);
if (chdir(path) == -1){
perror("system_cli_call: chdir");
exit(1);
}
char* argv[] = {"sh", "-c", script, 0};
if (execv("/bin/sh", argv) == -1){
perror("system_cli_call: execv");
}
exit(1);
} else{
// NOTE(yuval): Parent Process
close(pipe_fds[PIPE_FD_WRITE]);
*(pid_t*)&cli_out->proc = child_pid;
*(int*)&cli_out->out_read = pipe_fds[PIPE_FD_READ];
*(int*)&cli_out->out_write = pipe_fds[PIPE_FD_WRITE];
mac_vars.running_cli += 1;
}
return(true);
}
function
system_cli_begin_update_sig(){
// NOTE(yuval): Nothing to do here.
}
function
system_cli_update_step_sig(){
int pipe_read_fd = *(int*)&cli->out_read;
fd_set fds;
FD_ZERO(&fds);
FD_SET(pipe_read_fd, &fds);
struct timeval tv = {};
size_t space_left = max;
char* ptr = dest;
while (space_left > 0 && (select(pipe_read_fd + 1, &fds, NULL, NULL, &tv) == 1)){
ssize_t num = read(pipe_read_fd, ptr, space_left);
if (num == -1){
perror("system_cli_update_step: read");
} else if (num == 0){
// NOTE(inso): EOF
break;
} else{
ptr += num;
space_left -= num;
}
}
*amount = (ptr - dest);
b32 result = ((ptr - dest) > 0);
return(result);
}
function
system_cli_end_update_sig(){
b32 close_me = false;
pid_t pid = *(pid_t*)&cli->proc;
int status;
if (pid && (waitpid(pid, &status, WNOHANG) > 0)){
cli->exit = WEXITSTATUS(status);
close(*(int*)&cli->out_read);
close(*(int*)&cli->out_write);
mac_vars.running_cli -= 1;
close_me = true;
}
return(close_me);
}
////////////////////////////////
function
system_open_color_picker_sig(){
NotImplemented;
}
function
system_get_screen_scale_factor_sig(){
f32 result = mac_vars.screen_scale_factor;
return(result);
}
////////////////////////////////
function void*
mac_thread_wrapper(void *ptr){
Mac_Object *object = (Mac_Object*)ptr;
Thread_Function *proc = object->thread.proc;
void *object_ptr = object->thread.ptr;
pthread_mutex_lock(&mac_vars.thread_launch_mutex);
{
mac_vars.waiting_for_launch = false;
pthread_cond_signal(&mac_vars.thread_launch_cv);
}
pthread_mutex_unlock(&mac_vars.thread_launch_mutex);
proc(object_ptr);
return(0);
}
function
system_thread_launch_sig(){
Mac_Object *object = mac_alloc_object(MacObjectKind_Thread);
object->thread.proc = proc;
object->thread.ptr = ptr;
pthread_mutex_lock(&mac_vars.thread_launch_mutex);
{
mac_vars.waiting_for_launch = true;
pthread_create(&object->thread.thread, 0, mac_thread_wrapper, object);
while (mac_vars.waiting_for_launch){
pthread_cond_wait(&mac_vars.thread_launch_cv, &mac_vars.thread_launch_mutex);
}
}
pthread_mutex_unlock(&mac_vars.thread_launch_mutex);
System_Thread result = mac_to_plat_handle(object);
return(result);
}
function
system_thread_join_sig(){
Mac_Object *object = mac_to_object(thread);
if (object->kind == MacObjectKind_Thread){
pthread_join(object->thread.thread, 0);
}
}
function
system_thread_free_sig(){
Mac_Object* object = mac_to_object(thread);
if (object->kind == MacObjectKind_Thread){
mac_free_object(object);
}
}
function
system_thread_get_id_sig(){
pthread_t id = pthread_self();
i32 result = *(i32*)(&id);
return(result);
}
function
system_mutex_make_sig(){
Mac_Object *object = mac_alloc_object(MacObjectKind_Mutex);
mac_init_recursive_mutex(&object->mutex);
System_Mutex result = mac_to_plat_handle(object);
return(result);
}
function
system_mutex_acquire_sig(){
Mac_Object *object = mac_to_object(mutex);
if (object->kind == MacObjectKind_Mutex){
pthread_mutex_lock(&object->mutex);
}
}
function
system_mutex_release_sig(){
Mac_Object *object = mac_to_object(mutex);
if (object->kind == MacObjectKind_Mutex){
pthread_mutex_unlock(&object->mutex);
}
}
function
system_mutex_free_sig(){
Mac_Object *object = mac_to_object(mutex);
if (object->kind == MacObjectKind_Mutex){
pthread_mutex_destroy(&object->mutex);
mac_free_object(object);
}
}
function
system_acquire_global_frame_mutex_sig(){
if (tctx->kind == ThreadKind_AsyncTasks){
system_mutex_acquire(mac_vars.global_frame_mutex);
}
}
function
system_release_global_frame_mutex_sig(){
if (tctx->kind == ThreadKind_AsyncTasks){
system_mutex_release(mac_vars.global_frame_mutex);
}
}
function
system_condition_variable_make_sig(){
Mac_Object *object = mac_alloc_object(MacObjectKind_CV);
pthread_cond_init(&object->cv, 0);
System_Condition_Variable result = mac_to_plat_handle(object);
return(result);
}
function
system_condition_variable_wait_sig(){
Mac_Object *object_cv = mac_to_object(cv);
Mac_Object *object_mutex = mac_to_object(mutex);
if ((object_cv->kind == MacObjectKind_CV) && (object_mutex->kind == MacObjectKind_Mutex)){
pthread_cond_wait(&object_cv->cv, &object_mutex->mutex);
}
}
function
system_condition_variable_signal_sig(){
Mac_Object *object = mac_to_object(cv);
if (object->kind == MacObjectKind_CV){
pthread_cond_signal(&object->cv);
}
}
function
system_condition_variable_free_sig(){
Mac_Object *object = mac_to_object(cv);
if (object->kind == MacObjectKind_CV){
pthread_cond_destroy(&object->cv);
mac_free_object(object);
}
}
////////////////////////////////
struct Memory_Annotation_Tracker_Node{
Memory_Annotation_Tracker_Node *next;
Memory_Annotation_Tracker_Node *prev;
String_Const_u8 location;
u64 size;
};
struct Memory_Annotation_Tracker{
Memory_Annotation_Tracker_Node *first;
Memory_Annotation_Tracker_Node *last;
i32 count;
};
global Memory_Annotation_Tracker memory_tracker = {};
global pthread_mutex_t memory_tracker_mutex;
global_const u64 ALLOCATION_SIZE_ADJUSTMENT = 64;
function void*
mac_memory_allocate_extended(void *base, u64 size, String_Const_u8 location){
u64 adjusted_size = size + ALLOCATION_SIZE_ADJUSTMENT;
void *memory = mmap(base, adjusted_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
Assert(memory != MAP_FAILED);
Memory_Annotation_Tracker_Node *node = (Memory_Annotation_Tracker_Node*)memory;
pthread_mutex_lock(&memory_tracker_mutex);
{
zdll_push_back(memory_tracker.first, memory_tracker.last, node);
memory_tracker.count += 1;
}
pthread_mutex_unlock(&memory_tracker_mutex);
node->location = location;
node->size = size;
void* result = (node + 1);
return(result);
}
function void
mac_memory_free_extended(void *ptr){
Memory_Annotation_Tracker_Node *node = (Memory_Annotation_Tracker_Node*)ptr;
node -= 1;
pthread_mutex_lock(&memory_tracker_mutex);
{
zdll_remove(memory_tracker.first, memory_tracker.last, node);
memory_tracker.count -= 1;
}
pthread_mutex_unlock(&memory_tracker_mutex);
munmap(node, node->size + ALLOCATION_SIZE_ADJUSTMENT);
}
function
system_memory_allocate_sig(){
void* result = mac_memory_allocate_extended(0, size, location);
return(result);
}
function
system_memory_set_protection_sig(){
b32 result = true;
int protect = 0;
switch (flags & 0x7){
case 0:
{
protect = PROT_NONE;
} break;
case MemProtect_Read:
{
protect = PROT_READ;
} break;
case MemProtect_Write:
case MemProtect_Read | MemProtect_Write:
{
protect = PROT_READ | PROT_WRITE;
} break;
case MemProtect_Execute:
{
protect = PROT_EXEC;
} break;
case MemProtect_Execute | MemProtect_Read:
{
protect = PROT_READ | PROT_EXEC;
} break;
// NOTE(inso): some W^X protection things might be unhappy about this one
case MemProtect_Execute | MemProtect_Write:
case MemProtect_Execute | MemProtect_Write | MemProtect_Read:
{
protect = PROT_READ | PROT_WRITE | PROT_EXEC;
} break;
}
Memory_Annotation_Tracker_Node *node = (Memory_Annotation_Tracker_Node*)ptr;
node -= 1;
if(mprotect(node, size, protect) == -1){
result = false;
}
return(result);
}
function
system_memory_free_sig(){
mac_memory_free_extended(ptr);
}
function
system_memory_annotation_sig(){
Memory_Annotation result = {};
pthread_mutex_lock(&memory_tracker_mutex);
{
for (Memory_Annotation_Tracker_Node *node = memory_tracker.first;
node != 0;
node = node->next){
Memory_Annotation_Node *r_node = push_array(arena, Memory_Annotation_Node, 1);
sll_queue_push(result.first, result.last, r_node);
result.count += 1;
r_node->location = node->location;
r_node->address = node + 1;
r_node->size = node->size;
}
}
pthread_mutex_unlock(&memory_tracker_mutex);
return(result);
}
////////////////////////////////
function
system_show_mouse_cursor_sig(){
mac_vars.cursor_show = show;
}
function
system_set_fullscreen_sig(){
// NOTE(yuval): Read comment in system_set_fullscreen_sig in win32_4ed.cpp
mac_vars.do_toggle = (mac_vars.full_screen != full_screen);
b32 success = true;
return(success);
}
function
system_is_fullscreen_sig(){
// NOTE(yuval): Read comment in system_is_fullscreen_sig in win32_4ed.cpp
b32 result = (mac_vars.full_screen != mac_vars.do_toggle);
return(result);
}
function
system_get_keyboard_modifiers_sig(){
Input_Modifier_Set result = copy_modifier_set(arena, &mac_vars.input_chunk.pers.modifiers);
return(result);
}
////////////////////////////////
/**********************/
/* Graphics API */
/**********************/
////////////////////////////////
function
graphics_get_texture_sig(){
u32 result = renderer->get_texture(renderer, dim, texture_kind);
return(result);
}
function
graphics_fill_texture_sig(){
b32 result = renderer->fill_texture(renderer, texture_kind, texture, p, dim, data);
return(result);
}
////////////////////////////////
/******************/
/* Font API */
/******************/
////////////////////////////////
function
font_make_face_sig(){
Face* result = ft__font_make_face(arena, description, scale_factor);
return(result);
}
////////////////////////////////

View File

@ -0,0 +1,83 @@
/* Mac Metal layer for 4coder */
#import "metal/4ed_metal_render.mm"
////////////////////////////////
struct Mac_Metal{
Mac_Renderer base;
Metal_Renderer *renderer;
MTKView *view;
};
////////////////////////////////
function
mac_render_sig(mac_metal__render){
#if defined(FRED_INTERNAL)
printf("Redering using Metal!\n");
#endif
Mac_Metal *metal = (Mac_Metal*)renderer;
[metal->view draw];
}
function
mac_get_texture_sig(mac_metal__get_texture){
Mac_Metal *metal = (Mac_Metal*)renderer;
u32 result = [metal->renderer get_texture_of_dim:dim
kind:texture_kind];
return(result);
}
function
mac_fill_texture_sig(mac_metal__fill_texture){
Mac_Metal *metal = (Mac_Metal*)renderer;
b32 result = [metal->renderer fill_texture:texture
kind:texture_kind
pos:p
dim:dim
data:data];
return(result);
}
function Mac_Metal*
mac_metal__init(NSWindow *window, Render_Target *target){
// NOTE(yuval): Create the Mac Metal rendere
Mac_Metal *metal = (Mac_Metal*)system_memory_allocate(sizeof(Mac_Metal),
file_name_line_number_lit_u8);
metal->base.render = mac_metal__render;
metal->base.get_texture = mac_metal__get_texture;
metal->base.fill_texture = mac_metal__fill_texture;
// NOTE(yuval): Create the Metal view
NSView *content_view = [window contentView];
metal->view = [[MTKView alloc] initWithFrame:[content_view bounds]];
[metal->view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[metal->view setPaused:YES];
[metal->view setEnableSetNeedsDisplay:NO];
metal->view.device = MTLCreateSystemDefaultDevice();
// NOTE(yuval): Add the Metal view as a subview of the window
[content_view addSubview:metal->view];
// NOTE(yuval): Create the Metal renderer and set it as the Metal view's delegate
metal->renderer = [[Metal_Renderer alloc] initWithMetalKitView:metal->view target:target];
metal->view.delegate = metal->renderer;
return(metal);
}
////////////////////////////////
// TODO(yuval): This function should be exported to a DLL
function
mac_load_renderer_sig(mac_load_metal_renderer){
Mac_Renderer *renderer = (Mac_Renderer*)mac_metal__init(window, target);
return(renderer);
}

View File

@ -0,0 +1,183 @@
/* Mac OpenGL layer for 4coder */
#include "mac_4ed_renderer.h"
////////////////////////////////
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include "opengl/4ed_opengl_defines.h"
#define GL_FUNC(N,R,P) typedef R (CALL_CONVENTION N##_Function)P; N##_Function *N = 0;
#include "mac_4ed_opengl_funcs.h"
////////////////////////////////
#include "opengl/4ed_opengl_render.cpp"
////////////////////////////////
@interface OpenGL_View : NSOpenGLView
- (void)init_gl;
- (void)render:(Render_Target*)target;
@end
////////////////////////////////
struct Mac_OpenGL{
Mac_Renderer base;
OpenGL_View *view;
};
////////////////////////////////
@implementation OpenGL_View{
b32 gl_is_initialized;
}
- (id)init{
self = [super init];
if (self == nil){
return nil;
}
gl_is_initialized = false;
[self init_gl];
return self;
}
- (void)dealloc{
[super dealloc];
}
- (void)prepareOpenGL{
[super prepareOpenGL];
[[self openGLContext] makeCurrentContext];
// NOTE(yuval): Setup vsync
GLint swap_int = 1;
[[self openGLContext] setValues:&swap_int forParameter:NSOpenGLCPSwapInterval];
}
- (void)awakeFromNib{
[self init_gl];
}
- (void)reshape{
[super reshape];
[[self openGLContext] makeCurrentContext];
[[self openGLContext] update];
}
- (void)init_gl{
if (gl_is_initialized){
return;
}
// NOTE(yuval): Setup OpenGL
NSOpenGLPixelFormatAttribute opengl_attrs[] = {
NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
NSOpenGLPFAAccelerated,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAColorSize, 32,
NSOpenGLPFAAlphaSize, 8,
NSOpenGLPFADepthSize, 24,
0
};
NSOpenGLPixelFormat *pixel_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:opengl_attrs];
if (pixel_format == nil){
fprintf(stderr, "Error creating OpenGLPixelFormat\n");
exit(1);
}
NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pixel_format shareContext:nil];
[self setPixelFormat:pixel_format];
[self setOpenGLContext:context];
[context makeCurrentContext];
[pixel_format release];
gl_is_initialized = true;
}
- (void)render:(Render_Target*)target{
Assert(gl_is_initialized);
CGLLockContext([[self openGLContext] CGLContextObj]);
[[self openGLContext] makeCurrentContext];
gl_render(target);
[[self openGLContext] flushBuffer];
CGLUnlockContext([[self openGLContext] CGLContextObj]);
}
@end
////////////////////////////////
function
mac_render_sig(mac_gl__render){
#if defined(FRED_INTERNAL)
printf("Redering using OpenGL!\n");
#endif
Mac_OpenGL *gl = (Mac_OpenGL*)renderer;
[gl->view render:target];
}
function
mac_get_texture_sig(mac_gl__get_texture){
u32 result = gl__get_texture(dim, texture_kind);
return(result);
}
function
mac_fill_texture_sig(mac_gl__fill_texture){
b32 result = gl__fill_texture(texture_kind, texture, p, dim, data);
return(result);
}
function Mac_OpenGL*
mac_gl__init(NSWindow *window, Render_Target *target){
// NOTE(yuval): Create the Mac OpenGL Renderer
Mac_OpenGL *gl = (Mac_OpenGL*)system_memory_allocate(sizeof(Mac_OpenGL),
file_name_line_number_lit_u8);
gl->base.render = mac_gl__render;
gl->base.get_texture = mac_gl__get_texture;
gl->base.fill_texture = mac_gl__fill_texture;
// NOTE(yuval): Create the OpenGL view
NSView *content_view = [window contentView];
gl->view = [[OpenGL_View alloc] init];
[gl->view setFrame:[content_view bounds]];
[gl->view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[gl->view setWantsBestResolutionOpenGLSurface:YES];
// NOTE(yuval): Add the OpenGL view as a subview of the window
[content_view addSubview:gl->view];
// NOTE(yuval): Load gl functions
void *gl_image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
#define GL_FUNC(f,R,P) ((f) = (f##_Function*)dlsym(gl_image, #f));
#include "mac_4ed_opengl_funcs.h"
return(gl);
}
////////////////////////////////
// TODO(yuval): This function should be exported to a DLL
function
mac_load_renderer_sig(mac_load_opengl_renderer){
Mac_Renderer *renderer = (Mac_Renderer*)mac_gl__init(window, target);
return(renderer);
}

View File

@ -0,0 +1,17 @@
/* Mac OpenGL functions for 4coder */
// TOP
/* Usage:
#define GL_FUNC(N,R,P) ~~~~
#include "4ed_opengl_funcs.h"
*/
GL_FUNC(glDebugMessageControl, void, (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled))
GL_FUNC(glDebugMessageCallback, void, (GLDEBUGPROC callback, const void *userParam))
GL_FUNC(glGenVertexArrays, void, (GLsizei n, GLuint *arrays))
GL_FUNC(glBindVertexArray, void, (GLuint array))
GL_FUNC(glVertexAttribIPointer, void, (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer))
#undef GL_FUNC

View File

@ -0,0 +1,44 @@
/* Mac Renderer Abstraction */
#if !defined(FRED_MAC_RENDERER_H)
#define FRED_MAC_RENDERER_H
////////////////////////////////
// TODO(yuval): This should be refactored into a platform independent renderer
struct Mac_Renderer;
#define mac_render_sig(name) void name(Mac_Renderer *renderer, Render_Target *target)
typedef mac_render_sig(mac_render_type);
#define mac_get_texture_sig(name) u32 name(Mac_Renderer *renderer, Vec3_i32 dim, Texture_Kind texture_kind)
typedef mac_get_texture_sig(mac_get_texture_type);
#define mac_fill_texture_sig(name) b32 name(Mac_Renderer *renderer, Texture_Kind texture_kind, u32 texture, Vec3_i32 p, Vec3_i32 dim, void* data)
typedef mac_fill_texture_sig(mac_fill_texture_type);
typedef i32 Mac_Renderer_Kind;
enum{
MacRenderer_OpenGL,
MacRenderer_Metal,
//
MacRenderer_COUNT
};
struct Mac_Renderer{
mac_render_type *render;
mac_get_texture_type *get_texture;
mac_fill_texture_type *fill_texture;
};
////////////////////////////////
// NOTE(yuval): This is the actual platform dependent function that each renderer implementation implements and should be exported into a DLL
#define mac_load_renderer_sig(name) Mac_Renderer* name(NSWindow *window, Render_Target *target)
typedef mac_load_renderer_sig(mac_load_renderer_type);
////////////////////////////////
#endif

View File

@ -0,0 +1,26 @@
/* Mac Renderer Abstraction Implementation */
// TODO(yuval): This should NOT be included here once the renderer is exported to a DLL
#import "mac_4ed_opengl.mm"
#import "mac_4ed_metal.mm"
// TODO(yuval): Replace this array with an array of the paths to the renderer dlls
global mac_load_renderer_type *mac_renderer_load_functions[MacRenderer_COUNT] = {
mac_load_opengl_renderer,
mac_load_metal_renderer
};
function Mac_Renderer*
mac_init_renderer(Mac_Renderer_Kind kind, NSWindow *window, Render_Target *target){
// TODO(yuval): Import renderer load function from a DLL instead of using an array of the load functions. This would allow us to switch the renderer backend and implemented new backends with ease.
mac_load_renderer_type *load_renderer = mac_renderer_load_functions[kind];
Mac_Renderer *result = load_renderer(window, target);
if (!result){
mac_error_box("Unable to initialize the renderer!");
}
return result;
}

View File

@ -0,0 +1,24 @@
/* Types and functions for communication between C++ and Objective-C layers. */
#if !defined(MAC_OBJECTIVE_C_TO_CPP_LINKS_H)
#define MAC_OBJECTIVE_C_TO_CPP_LINKS_H
// In C++ layer
external String_Const_u8
mac_SCu8(u8* str, u64 size);
external String_Const_u8
mac_push_string_copy(Arena *arena, String_Const_u8 src);
external void
mac_init();
// In Objective-C layer
external String_Const_u8
mac_standardize_path(Arena* arena, String_Const_u8 path);
external i32
mac_get_binary_path(void* buffer, u32 size);
#endif

View File

@ -605,6 +605,9 @@ os_popup_error(char *title, char *message){
#include "4ed_font_provider_freetype.cpp" #include "4ed_font_provider_freetype.cpp"
#include <GL/gl.h> #include <GL/gl.h>
#include "opengl/4ed_opengl_defines.h"
#define GL_FUNC(N,R,P) typedef R (CALL_CONVENTION N##_Function)P; N##_Function *N = 0;
#include "opengl/4ed_opengl_funcs.h"
#include "opengl/4ed_opengl_render.cpp" #include "opengl/4ed_opengl_render.cpp"
internal internal
@ -640,6 +643,7 @@ win32_keycode_init(void){
keycode_lookup_table[VK_SPACE] = KeyCode_Space; keycode_lookup_table[VK_SPACE] = KeyCode_Space;
keycode_lookup_table[VK_OEM_3] = KeyCode_Tick; keycode_lookup_table[VK_OEM_3] = KeyCode_Tick;
keycode_lookup_table[VK_OEM_MINUS] = KeyCode_Minus; keycode_lookup_table[VK_OEM_MINUS] = KeyCode_Minus;
keycode_lookup_table[VK_OEM_PLUS] = KeyCode_Equal;
keycode_lookup_table[VK_OEM_4] = KeyCode_LeftBracket; keycode_lookup_table[VK_OEM_4] = KeyCode_LeftBracket;
keycode_lookup_table[VK_OEM_6] = KeyCode_RightBracket; keycode_lookup_table[VK_OEM_6] = KeyCode_RightBracket;
keycode_lookup_table[VK_OEM_1] = KeyCode_Semicolon; keycode_lookup_table[VK_OEM_1] = KeyCode_Semicolon;
@ -1240,10 +1244,10 @@ win32_wgl_good(Void_Func *f){
f != (Void_Func*)-1); f != (Void_Func*)-1);
} }
typedef HGLRC (wglCreateContextAttribsARB_Function)(HDC,HGLRC,i32*); typedef HGLRC (CALL_CONVENTION wglCreateContextAttribsARB_Function)(HDC,HGLRC,i32*);
typedef BOOL (wglChoosePixelFormatARB_Function)(HDC,i32*,f32*,u32,i32*,u32*); typedef BOOL (CALL_CONVENTION wglChoosePixelFormatARB_Function)(HDC,i32*,f32*,u32,i32*,u32*);
typedef char* (wglGetExtensionsStringEXT_Function)(); typedef char* (CALL_CONVENTION wglGetExtensionsStringEXT_Function)();
typedef VOID (wglSwapIntervalEXT_Function)(i32); typedef VOID (CALL_CONVENTION wglSwapIntervalEXT_Function)(i32);
global wglCreateContextAttribsARB_Function *wglCreateContextAttribsARB = 0; global wglCreateContextAttribsARB_Function *wglCreateContextAttribsARB = 0;
global wglChoosePixelFormatARB_Function *wglChoosePixelFormatARB = 0; global wglChoosePixelFormatARB_Function *wglChoosePixelFormatARB = 0;

View File

@ -6,6 +6,7 @@ patterns = {
"*.cpp", "*.cpp",
"*.h", "*.h",
"*.m", "*.m",
"*.mm",
"*.bat", "*.bat",
"*.sh", "*.sh",
"*.4coder", "*.4coder",
@ -25,21 +26,23 @@ load_paths = {
build_x64_win32 = "echo build: x64 & bin\\build.bat"; build_x64_win32 = "echo build: x64 & bin\\build.bat";
build_x86_win32 = "echo build: x86 & bin\\build.bat /DDEV_BUILD_X86"; build_x86_win32 = "echo build: x86 & bin\\build.bat /DDEV_BUILD_X86";
build_x64_unix = "echo build: x64 & bin/build.sh"; build_x64_linux = "echo build: x64 & bin/build.sh";
build_x86_unix = "echo build: x86 & bin/build.sh -DDEV_BUILD_X86"; build_x86_linux = "echo build: x86 & bin/build.sh -DDEV_BUILD_X86";
build_x64_mac = "echo build: x64 & bin/build-mac.sh";
build_x86_mac = "echo build: x86 & bin/build-mac.sh -DDEV_BUILD_X86";
command_list = { command_list = {
{ .name = "build x64", { .name = "build x64",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
.cmd = { {build_x64_win32, .os = "win" }, .cmd = { {build_x64_win32, .os = "win" },
{build_x64_unix , .os = "linux"}, {build_x64_linux, .os = "linux"},
{build_x64_unix , .os = "mac" }, }, }, {build_x64_mac , .os = "mac" }, }, },
{ .name = "build x86", { .name = "build x86",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
.cmd = { {build_x86_win32, .os = "win" }, .cmd = { {build_x86_win32, .os = "win" },
{build_x86_unix , .os = "linux"}, {build_x86_linux, .os = "linux"},
{build_x86_unix , .os = "mac" }, }, }, {build_x86_mac , .os = "mac" }, }, },
{ .name = "package", { .name = "package",
.out = "*compilation*", .footer_panel = false, .save_dirty_files = true, .out = "*compilation*", .footer_panel = false, .save_dirty_files = true,
@ -49,11 +52,13 @@ command_list = {
{ .name = "run one time", { .name = "run one time",
.out = "*run*", .footer_panel = false, .save_dirty_files = false, .out = "*run*", .footer_panel = false, .save_dirty_files = false,
.cmd = { { "pushd ..\\build & one_time", .os = "win" }, }, }, .cmd = { { "pushd ..\\build & one_time", .os = "win" },
{ "pushd ../build & one_time", .os = "mac" }, }, },
{ .name = "build custom api docs", { .name = "build custom api docs",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
.cmd = { { "custom\\bin\\build_one_time docs\\4ed_doc_custom_api_main.cpp ..\\build", .os = "win" }, }, }, .cmd = { { "custom\\bin\\build_one_time docs\\4ed_doc_custom_api_main.cpp ..\\build", .os = "win" },
{ "custom/bin/build_one_time.sh docs/4ed_doc_custom_api_main.cpp ../build", .os = "mac" }, }, },
{ .name = "build C++ lexer generator", { .name = "build C++ lexer generator",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .out = "*compilation*", .footer_panel = true, .save_dirty_files = true,

View File

@ -6,9 +6,12 @@ https://github.com/4coder-editor/4coder/issues
For questions email: For questions email:
editor@4coder.net editor@4coder.net
Sign up for the newsletter for the most critical 4coder news:
newsletter.4coder.net
Watch the 4coder.handmade.network blog and @AllenWebster4th twitter for news about 4coder. Watch the 4coder.handmade.network blog and @AllenWebster4th twitter for news about 4coder.
For documentation, feature lists, and usage tutorial videos go to: For documentation, feature lists, and more visit the home page:
4coder.net 4coder.net

View File

@ -1,3 +1,43 @@
4.1.3
+ Unkillable buffer setting
+ UI elements in listers and buttons can have different highlight backgrounds
+ command 'load_theme_current_buffer' for loading the current file as a theme and setting it as the theme
+ Fix: search and replace never exits early
+ Fix: optimized builds of the custom layer display the dirty * on the file bar correclty
+ Fix: can merge "backwards" strings in the history correctly
+ Fix: the helper user_list_definition_array matches both LF and CRLF line endings
+ Fix: line number background and text colors in the built in theme files
+ Fix: a drive letter by itself is recognized as an existing path
+ Fix: the margin colors for panels are determined by the margins in theme files
+ Fix: when a file is deleted outside of 4coder, the '!' dirty status is added to the buffer
+ Fix: on mac file changes outside of 4coder are detected and do not stall the UI
4.1.2
+ Cursor color changes when recording macro if the theme provides a second cursor color
+ Default custom layer now has a feature for supporting fade ranges as used in pasting and undoing
+ Ability to "partially" paint text with a blend factor to create blends
+ In file lister, typing a slash with a name for a folder that does not exist asks the user if they would like to create a folder
+ Fix: parser in code index recognizes functions with more than one parameter
+ Fix: trying to create a face with a font file that doesn't exist doesn't crash
+ Fix: escaping command documentation lister doesn't crash
+ Fix: lexer generator switched to new macro names Max and Min
+ Fix: implementation for getting previous view iterates from null to the last view in order (instead of the first)
+ Fix: auto-indent when a file with virtual whitespace is saved
+ Fix: can create up to sixteen panels, and doesn't crash when trying to create more
+ Fix: faster text range highlighting
+ Fix: side by side editing a single buffer doesn't scroll the lower view down when insterting lines in the higher view
+ Fix: indentation after paren group is correct
4.1.1
Changes not documented
4.1.0
Initial beta version
**************************************************
**************************************************
New in alpha 4.0.30: New in alpha 4.0.30:
-Mouse events (clicking, scroll wheel, mouse move) can now be bound with modifier keys -Mouse events (clicking, scroll wheel, mouse move) can now be bound with modifier keys
-New and changed commands: -New and changed commands:

View File

@ -1,10 +1,9 @@
// Command Mapping // Command Mapping
// "" - Leave the bindings unaltered from their startup value. // "" - Leave the bindings unaltered.
// "choose" - Ask 4coder to choose based on platform. // "choose" - Ask 4coder to choose based on platform.
// "default" - Use the default keybindings 4coder has always had. // "default" - Use the default keybindings 4coder has always had.
// "mac-default" - Use keybindings similar to those found in other Mac applications. // "mac-default" - Use keybindings similar to those found in other Mac applications.
// <my-own-string> - If you use the custom layer to make a named mapping you can use that here too. mapping = "choose";
mapping = "";
// MODE // MODE
// "4coder" - The default 4coder mode that has been around since the beginning of time (2015) // "4coder" - The default 4coder mode that has been around since the beginning of time (2015)
@ -23,12 +22,9 @@ lister_whole_word_backspace_when_modified = false;
show_line_number_margins = false; show_line_number_margins = false;
// Code Wrapping // Code Wrapping
treat_as_code = ".cpp.c.hpp.h.cc.cs.java.rs.glsl.m"; treat_as_code = ".cpp.c.hpp.h.cc.cs.java.rs.glsl.m.mm";
enable_virtual_whitespace = true; enable_virtual_whitespace = true;
enable_code_wrapping = true; enable_code_wrapping = true;
automatically_adjust_wrapping = true;
default_wrap_width = 672;
default_min_base_width = 550;
// This only applies to code files in code-wrapping mode. // This only applies to code files in code-wrapping mode.
// Plain text and code files without virtual-whitespace will not be effected. // Plain text and code files without virtual-whitespace will not be effected.

View File

@ -3,10 +3,10 @@ defcolor_back = 0xFF0C0C0C;
defcolor_margin = 0xFF181818; defcolor_margin = 0xFF181818;
defcolor_margin_hover = 0xFF252525; defcolor_margin_hover = 0xFF252525;
defcolor_margin_active = 0xFF323232; defcolor_margin_active = 0xFF323232;
defcolor_list_item = defcolor_margin; defcolor_list_item = {defcolor_margin, defcolor_back};
defcolor_list_item_hover = defcolor_margin_hover; defcolor_list_item_hover = {defcolor_margin_hover, defcolor_margin};
defcolor_list_item_active = defcolor_margin_active; defcolor_list_item_active = {defcolor_margin_active, defcolor_margin_active};
defcolor_cursor = 0xFF00EE00; defcolor_cursor = {0xFF00EE00, 0xFFEE7700};
defcolor_at_cursor = defcolor_back; defcolor_at_cursor = defcolor_back;
defcolor_highlight_cursor_line = 0xFF1E1E1E; defcolor_highlight_cursor_line = 0xFF1E1E1E;
defcolor_highlight = 0xFFDDEE00; defcolor_highlight = 0xFFDDEE00;
@ -41,3 +41,6 @@ defcolor_pop2 = 0xFFFF0000;
defcolor_back_cycle = {0x10A00000, 0x0C00A000, 0x0C0000A0, 0x0CA0A000}; defcolor_back_cycle = {0x10A00000, 0x0C00A000, 0x0C0000A0, 0x0CA0A000};
defcolor_text_cycle = {0xFFA00000, 0xFF00A000, 0xFF0030B0, 0xFFA0A000}; defcolor_text_cycle = {0xFFA00000, 0xFF00A000, 0xFF0030B0, 0xFFA0A000};
defcolor_line_numbers_back = 0xFF101010;
defcolor_line_numbers_text = 0xFF404040;

View File

@ -4,10 +4,10 @@ defcolor_back = 0xFF161616;
defcolor_margin = 0xFF262626; defcolor_margin = 0xFF262626;
defcolor_margin_hover = 0xFF333333; defcolor_margin_hover = 0xFF333333;
defcolor_margin_active = 0xFF404040; defcolor_margin_active = 0xFF404040;
defcolor_list_item = defcolor_margin; defcolor_list_item = {defcolor_margin, defcolor_back};
defcolor_list_item_hover = defcolor_margin_hover; defcolor_list_item_hover = {defcolor_margin_hover, defcolor_margin};
defcolor_list_item_active = defcolor_margin_active; defcolor_list_item_active = {defcolor_margin_active, defcolor_margin_active};
defcolor_cursor = 0xFF40FF40; defcolor_cursor = {0xFF40FF40, 0xFFFF4040};
defcolor_at_cursor = defcolor_back; defcolor_at_cursor = defcolor_back;
defcolor_highlight_cursor_line = 0xFF121E12; defcolor_highlight_cursor_line = 0xFF121E12;
defcolor_highlight = 0xFF703419; defcolor_highlight = 0xFF703419;
@ -43,6 +43,5 @@ defcolor_pop2 = 0xFFFF0000;
defcolor_back_cycle = {0x0CA00000, 0x0800A000, 0x080000A0, 0x08A0A000}; defcolor_back_cycle = {0x0CA00000, 0x0800A000, 0x080000A0, 0x08A0A000};
defcolor_text_cycle = {0xFFA00000, 0xFF00A000, 0xFF0020B0, 0xFFA0A000}; defcolor_text_cycle = {0xFFA00000, 0xFF00A000, 0xFF0020B0, 0xFFA0A000};
defcolor_line_numbers_back = 0xFF202020;
defcolor_line_numbers_text = 0xFF484848;

Some files were not shown because too many files have changed in this diff Show More