eliminated max_y
parent
170f521e26
commit
42cab1b573
|
@ -22,7 +22,7 @@ ul { list-style: none; padding: 0; margin: 0; }
|
||||||
<h2 id='section_introduction'>§1 Introduction</h2>
|
<h2 id='section_introduction'>§1 Introduction</h2>
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
This is the documentation for alpha 4.0.9 super! The documentation is still under construction so some of the links are linking to sections that have not been written yet. What is here should be correct and I suspect useful even without some of the other sections. </p>
|
This is the documentation for alpha 4.0.10 super! The documentation is still under construction so some of the links are linking to sections that have not been written yet. What is here should be correct and I suspect useful even without some of the other sections. </p>
|
||||||
<p>
|
<p>
|
||||||
If you have questions or discover errors please contact <span style='font-family: "Courier New", Courier, monospace; text-align: left;'>editor@4coder.net</span> or to get help from community members you can post on the 4coder forums hosted on handmade.network at <span style='font-family: "Courier New", Courier, monospace; text-align: left;'>4coder.handmade.network</span></p>
|
If you have questions or discover errors please contact <span style='font-family: "Courier New", Courier, monospace; text-align: left;'>editor@4coder.net</span> or to get help from community members you can post on the 4coder forums hosted on handmade.network at <span style='font-family: "Courier New", Courier, monospace; text-align: left;'>4coder.handmade.network</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1703,7 +1703,6 @@ can either be a name or an id. If the</div><div style='margin-top: 3mm; margin-
|
||||||
float scroll_y;<br>
|
float scroll_y;<br>
|
||||||
int32_t target_y;<br>
|
int32_t target_y;<br>
|
||||||
int32_t prev_target_y;<br>
|
int32_t prev_target_y;<br>
|
||||||
int32_t max_y;<br>
|
|
||||||
float scroll_x;<br>
|
float scroll_x;<br>
|
||||||
int32_t target_x;<br>
|
int32_t target_x;<br>
|
||||||
int32_t prev_target_x;<br>
|
int32_t prev_target_x;<br>
|
||||||
|
@ -1723,10 +1722,6 @@ int32_t prev_target_x;<br>
|
||||||
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
|
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>max_y</span></div>
|
|
||||||
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>scroll_x</span></div>
|
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>scroll_x</span></div>
|
||||||
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
|
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -458,8 +458,6 @@ struct GUI_Scroll_Vars{
|
||||||
int32_t target_y;
|
int32_t target_y;
|
||||||
/* DOC(TODO) */
|
/* DOC(TODO) */
|
||||||
int32_t prev_target_y;
|
int32_t prev_target_y;
|
||||||
/* DOC(TODO) */
|
|
||||||
int32_t max_y;
|
|
||||||
|
|
||||||
/* DOC(TODO) */
|
/* DOC(TODO) */
|
||||||
float scroll_x;
|
float scroll_x;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#define MAJOR 4
|
#define MAJOR 4
|
||||||
#define MINOR 0
|
#define MINOR 0
|
||||||
#define PATCH 9
|
#define PATCH 10
|
||||||
|
|
||||||
#define VN__(a,b,c) #a"."#b"."#c
|
#define VN__(a,b,c) #a"."#b"."#c
|
||||||
#define VN_(a,b,c) VN__(a,b,c)
|
#define VN_(a,b,c) VN__(a,b,c)
|
||||||
|
|
47
4ed.cpp
47
4ed.cpp
|
@ -230,11 +230,7 @@ app_resume_coroutine(System_Functions *system, Application_Links *app, Coroutine
|
||||||
inline void
|
inline void
|
||||||
output_file_append(System_Functions *system, Models *models, Editing_File *file, String value, b32 cursor_at_end){
|
output_file_append(System_Functions *system, Models *models, Editing_File *file, String value, b32 cursor_at_end){
|
||||||
i32 end = buffer_size(&file->state.buffer);
|
i32 end = buffer_size(&file->state.buffer);
|
||||||
i32 next_cursor = 0;
|
file_replace_range(system, models, file, end, end, value.str, value.size);
|
||||||
if (cursor_at_end){
|
|
||||||
next_cursor = end + value.size;
|
|
||||||
}
|
|
||||||
file_replace_range(system, models, file, end, end, value.str, value.size, next_cursor, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
|
@ -471,7 +467,7 @@ COMMAND_DECL(word_complete){
|
||||||
buffer_stringify(match.buffer, match.start, match.end, spare);
|
buffer_stringify(match.buffer, match.start, match.end, spare);
|
||||||
|
|
||||||
if (search_hit_add(general, &complete_state->hits, &complete_state->str, spare, match_size)){
|
if (search_hit_add(general, &complete_state->hits, &complete_state->str, spare, match_size)){
|
||||||
view_replace_range(system, models, view, word_start, word_end, spare, match_size, word_end);
|
view_replace_range(system, models, view, word_start, word_end, spare, match_size);
|
||||||
|
|
||||||
complete_state->word_end = word_start + match_size;
|
complete_state->word_end = word_start + match_size;
|
||||||
complete_state->set.ranges[1].start = word_start + match_size;
|
complete_state->set.ranges[1].start = word_start + match_size;
|
||||||
|
@ -489,7 +485,7 @@ COMMAND_DECL(word_complete){
|
||||||
|
|
||||||
match_size = complete_state->iter.word.size;
|
match_size = complete_state->iter.word.size;
|
||||||
view_replace_range(system, models, view, word_start, word_end,
|
view_replace_range(system, models, view, word_start, word_end,
|
||||||
complete_state->iter.word.str, match_size, word_end);
|
complete_state->iter.word.str, match_size);
|
||||||
|
|
||||||
complete_state->word_end = word_start + match_size;
|
complete_state->word_end = word_start + match_size;
|
||||||
complete_state->set.ranges[1].start = word_start + match_size;
|
complete_state->set.ranges[1].start = word_start + match_size;
|
||||||
|
@ -573,9 +569,29 @@ COMMAND_DECL(reopen){
|
||||||
if (system->file_load_end(loading, buffer)){
|
if (system->file_load_end(loading, buffer)){
|
||||||
General_Memory *general = &models->mem.general;
|
General_Memory *general = &models->mem.general;
|
||||||
|
|
||||||
file_close(system, general, file);
|
File_Edit_Positions edit_poss[16];
|
||||||
|
View *vptrs[16];
|
||||||
|
i32 vptr_count = 0;
|
||||||
|
for (View_Iter iter = file_view_iter_init(&models->layout, file, 0);
|
||||||
|
file_view_iter_good(iter);
|
||||||
|
iter = file_view_iter_next(iter)){
|
||||||
|
vptrs[vptr_count] = iter.view;
|
||||||
|
edit_poss[vptr_count] = *iter.view->edit_pos;
|
||||||
|
iter.view->edit_pos = 0;
|
||||||
|
++vptr_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
file_close(system, general, file);
|
||||||
init_normal_file(system, models, file, buffer, loading.size);
|
init_normal_file(system, models, file, buffer, loading.size);
|
||||||
|
|
||||||
|
for (i32 i = 0;
|
||||||
|
i < vptr_count;
|
||||||
|
++i){
|
||||||
|
view_set_file(vptrs[i], file, models);
|
||||||
|
*vptrs[i]->edit_pos = edit_poss[i];
|
||||||
|
view_set_cursor(vptrs[i], edit_poss[i].cursor,
|
||||||
|
true, view->file_data.unwrapped_lines);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end_temp_memory(temp);
|
end_temp_memory(temp);
|
||||||
|
@ -2498,9 +2514,18 @@ App_Step_Sig(app_step){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i32 max_y = 0;
|
||||||
|
if (view->showing_ui == VUI_None){
|
||||||
|
max_y = view_compute_max_target_y(view);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
max_y = view->gui_max_y;
|
||||||
|
}
|
||||||
|
|
||||||
Input_Process_Result ip_result =
|
Input_Process_Result ip_result =
|
||||||
do_step_file_view(system, view, panel->inner, active,
|
do_step_file_view(system, view, panel->inner, active,
|
||||||
&summary, *scroll_vars, view->scroll_region);
|
&summary, *scroll_vars, view->scroll_region, max_y);
|
||||||
|
|
||||||
if (ip_result.is_animating){
|
if (ip_result.is_animating){
|
||||||
app_result.animating = 1;
|
app_result.animating = 1;
|
||||||
}
|
}
|
||||||
|
@ -2513,6 +2538,10 @@ App_Step_Sig(app_step){
|
||||||
"file view step");
|
"file view step");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ip_result.has_max_y_suggestion){
|
||||||
|
view->gui_max_y = ip_result.max_y;
|
||||||
|
}
|
||||||
|
|
||||||
if (!gui_scroll_eq(scroll_vars, &ip_result.vars)){
|
if (!gui_scroll_eq(scroll_vars, &ip_result.vars)){
|
||||||
if (file_scroll){
|
if (file_scroll){
|
||||||
view_set_scroll(view, ip_result.vars);
|
view_set_scroll(view, ip_result.vars);
|
||||||
|
|
|
@ -266,7 +266,7 @@ DOC_SEE(Command_Line_Input_Flag)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file){
|
if (file){
|
||||||
file_clear(system, models, file, 1);
|
file_clear(system, models, file);
|
||||||
file->settings.unimportant = 1;
|
file->settings.unimportant = 1;
|
||||||
|
|
||||||
if (!(flags & CLI_AlwaysBindToView)){
|
if (!(flags & CLI_AlwaysBindToView)){
|
||||||
|
@ -693,7 +693,7 @@ DOC_SEE(4coder_Buffer_Positioning_System)
|
||||||
result = true;
|
result = true;
|
||||||
|
|
||||||
file_replace_range(cmd->system, cmd->models,
|
file_replace_range(cmd->system, cmd->models,
|
||||||
file, start, end, str, len, 0);
|
file, start, end, str, len);
|
||||||
}
|
}
|
||||||
fill_buffer_summary(buffer, file, cmd);
|
fill_buffer_summary(buffer, file, cmd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,6 +221,7 @@ struct View{
|
||||||
GUI_Target gui_target;
|
GUI_Target gui_target;
|
||||||
void *gui_mem;
|
void *gui_mem;
|
||||||
GUI_Scroll_Vars gui_scroll;
|
GUI_Scroll_Vars gui_scroll;
|
||||||
|
i32 gui_max_y;
|
||||||
i32 list_i;
|
i32 list_i;
|
||||||
|
|
||||||
b32 hide_scrollbar;
|
b32 hide_scrollbar;
|
||||||
|
@ -473,10 +474,57 @@ view_compute_cursor_from_xy(View *view, f32 seek_x, f32 seek_y){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline i32
|
||||||
|
view_wrapped_line_span(f32 line_width, f32 max_width){
|
||||||
|
i32 line_count = CEIL32(line_width / max_width);
|
||||||
|
if (line_count == 0) line_count = 1;
|
||||||
|
return line_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal i32
|
||||||
|
view_compute_lowest_line(View *view){
|
||||||
|
i32 lowest_line = 0;
|
||||||
|
i32 last_line = view->file_data.line_count - 1;
|
||||||
|
if (last_line > 0){
|
||||||
|
if (view->file_data.unwrapped_lines){
|
||||||
|
lowest_line = last_line;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
f32 wrap_y = view->file_data.line_wrap_y[last_line];
|
||||||
|
lowest_line = FLOOR32(wrap_y / view->line_height);
|
||||||
|
f32 max_width = view_file_width(view);
|
||||||
|
|
||||||
|
Editing_File *file = view->file_data.file;
|
||||||
|
Assert(!file->is_dummy);
|
||||||
|
f32 width = file->state.buffer.line_widths[last_line];
|
||||||
|
i32 line_span = view_wrapped_line_span(width, max_width);
|
||||||
|
lowest_line += line_span - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lowest_line;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline i32
|
||||||
|
view_compute_max_target_y(i32 lowest_line, i32 line_height, f32 view_height){
|
||||||
|
f32 max_target_y = ((lowest_line+.5f)*line_height) - view_height*.5f;
|
||||||
|
max_target_y = clamp_bottom(0.f, max_target_y);
|
||||||
|
return(CEIL32(max_target_y));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline i32
|
||||||
|
view_compute_max_target_y(View *view){
|
||||||
|
i32 lowest_line = view_compute_lowest_line(view);
|
||||||
|
i32 line_height = view->line_height;
|
||||||
|
f32 view_height = clamp_bottom((f32)line_height, view_file_height(view));
|
||||||
|
i32 max_target_y = view_compute_max_target_y(lowest_line, line_height, view_height);
|
||||||
|
return(max_target_y);
|
||||||
|
}
|
||||||
|
|
||||||
internal b32
|
internal b32
|
||||||
view_move_view_to_cursor(View *view, GUI_Scroll_Vars *scroll, b32 center_view){
|
view_move_view_to_cursor(View *view, GUI_Scroll_Vars *scroll, b32 center_view){
|
||||||
b32 result = false;
|
b32 result = false;
|
||||||
f32 max_x = view_file_width(view);
|
f32 max_x = view_file_width(view);
|
||||||
|
i32 max_y = view_compute_max_target_y(view);
|
||||||
|
|
||||||
f32 cursor_y = view_get_cursor_y(view);
|
f32 cursor_y = view_get_cursor_y(view);
|
||||||
f32 cursor_x = view_get_cursor_x(view);
|
f32 cursor_x = view_get_cursor_x(view);
|
||||||
|
@ -504,7 +552,7 @@ view_move_view_to_cursor(View *view, GUI_Scroll_Vars *scroll, b32 center_view){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target_y = clamp(0, target_y, scroll_vars.max_y);
|
target_y = clamp(0, target_y, max_y);
|
||||||
|
|
||||||
if (cursor_x >= target_x + max_x){
|
if (cursor_x >= target_x + max_x){
|
||||||
target_x = CEIL32(cursor_x - max_x/2);
|
target_x = CEIL32(cursor_x - max_x/2);
|
||||||
|
@ -940,52 +988,6 @@ file_measure_starts_widths(System_Functions *system, General_Memory *general,
|
||||||
buffer->widths_count = state.count;
|
buffer->widths_count = state.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline i32
|
|
||||||
view_wrapped_line_span(f32 line_width, f32 max_width){
|
|
||||||
i32 line_count = CEIL32(line_width / max_width);
|
|
||||||
if (line_count == 0) line_count = 1;
|
|
||||||
return line_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal i32
|
|
||||||
view_compute_lowest_line(View *view){
|
|
||||||
i32 lowest_line = 0;
|
|
||||||
i32 last_line = view->file_data.line_count - 1;
|
|
||||||
if (last_line > 0){
|
|
||||||
if (view->file_data.unwrapped_lines){
|
|
||||||
lowest_line = last_line;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
f32 wrap_y = view->file_data.line_wrap_y[last_line];
|
|
||||||
lowest_line = FLOOR32(wrap_y / view->line_height);
|
|
||||||
f32 max_width = view_file_width(view);
|
|
||||||
|
|
||||||
Editing_File *file = view->file_data.file;
|
|
||||||
Assert(!file->is_dummy);
|
|
||||||
f32 width = file->state.buffer.line_widths[last_line];
|
|
||||||
i32 line_span = view_wrapped_line_span(width, max_width);
|
|
||||||
lowest_line += line_span - 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return lowest_line;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline i32
|
|
||||||
view_compute_max_target_y(i32 lowest_line, i32 line_height, f32 view_height){
|
|
||||||
f32 max_target_y = ((lowest_line+.5f)*line_height) - view_height*.5f;
|
|
||||||
max_target_y = clamp_bottom(0.f, max_target_y);
|
|
||||||
return(CEIL32(max_target_y));
|
|
||||||
}
|
|
||||||
|
|
||||||
inline i32
|
|
||||||
view_compute_max_target_y(View *view){
|
|
||||||
i32 lowest_line = view_compute_lowest_line(view);
|
|
||||||
i32 line_height = view->line_height;
|
|
||||||
f32 view_height = clamp_bottom((f32)line_height, view_file_height(view));
|
|
||||||
i32 max_target_y = view_compute_max_target_y(lowest_line, line_height, view_height);
|
|
||||||
return(max_target_y);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
view_measure_wraps(General_Memory *general, View *view){
|
view_measure_wraps(General_Memory *general, View *view){
|
||||||
Buffer_Type *buffer;
|
Buffer_Type *buffer;
|
||||||
|
@ -1730,7 +1732,6 @@ view_set_file(View *view, Editing_File *file, Models *models){
|
||||||
|
|
||||||
if (file_is_ready(file)){
|
if (file_is_ready(file)){
|
||||||
view_measure_wraps(&models->mem.general, view);
|
view_measure_wraps(&models->mem.general, view);
|
||||||
view->edit_pos->scroll.max_y = view_compute_max_target_y(view);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2080,8 +2081,7 @@ file_edit_cursor_fix(System_Functions *system,
|
||||||
internal void
|
internal void
|
||||||
file_do_single_edit(System_Functions *system,
|
file_do_single_edit(System_Functions *system,
|
||||||
Models *models, Editing_File *file,
|
Models *models, Editing_File *file,
|
||||||
Edit_Spec spec, History_Mode history_mode, b32 use_high_permission = 0){
|
Edit_Spec spec, History_Mode history_mode){
|
||||||
if (!use_high_permission && file->settings.read_only) return;
|
|
||||||
|
|
||||||
Mem_Options *mem = &models->mem;
|
Mem_Options *mem = &models->mem;
|
||||||
Editing_Layout *layout = &models->layout;
|
Editing_Layout *layout = &models->layout;
|
||||||
|
@ -2156,8 +2156,7 @@ file_do_single_edit(System_Functions *system,
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
file_do_white_batch_edit(System_Functions *system, Models *models, Editing_File *file,
|
file_do_white_batch_edit(System_Functions *system, Models *models, Editing_File *file,
|
||||||
Edit_Spec spec, History_Mode history_mode, b32 use_high_permission = 0){
|
Edit_Spec spec, History_Mode history_mode){
|
||||||
if (!use_high_permission && file->settings.read_only) return;
|
|
||||||
|
|
||||||
Mem_Options *mem = &models->mem;
|
Mem_Options *mem = &models->mem;
|
||||||
Editing_Layout *layout = &models->layout;
|
Editing_Layout *layout = &models->layout;
|
||||||
|
@ -2244,26 +2243,25 @@ file_do_white_batch_edit(System_Functions *system, Models *models, Editing_File
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
file_replace_range(System_Functions *system, Models *models, Editing_File *file,
|
file_replace_range(System_Functions *system, Models *models, Editing_File *file,
|
||||||
i32 start, i32 end, char *str, i32 len, i32 next_cursor, b32 use_high_permission = 0){
|
i32 start, i32 end, char *str, i32 len){
|
||||||
Edit_Spec spec = {};
|
Edit_Spec spec = {};
|
||||||
spec.step.type = ED_NORMAL;
|
spec.step.type = ED_NORMAL;
|
||||||
spec.step.edit.start = start;
|
spec.step.edit.start = start;
|
||||||
spec.step.edit.end = end;
|
spec.step.edit.end = end;
|
||||||
|
|
||||||
spec.step.edit.len = len;
|
spec.step.edit.len = len;
|
||||||
spec.str = (u8*)str;
|
spec.str = (u8*)str;
|
||||||
file_do_single_edit(system, models, file, spec, hist_normal, use_high_permission);
|
file_do_single_edit(system, models, file, spec, hist_normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
file_clear(System_Functions *system, Models *models, Editing_File *file, b32 use_high_permission = 0){
|
file_clear(System_Functions *system, Models *models, Editing_File *file){
|
||||||
file_replace_range(system, models, file, 0, buffer_size(&file->state.buffer), 0, 0, 0, use_high_permission);
|
file_replace_range(system, models, file, 0, buffer_size(&file->state.buffer), 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
view_replace_range(System_Functions *system, Models *models, View *view,
|
view_replace_range(System_Functions *system, Models *models, View *view,
|
||||||
i32 start, i32 end, char *str, i32 len, i32 next_cursor){
|
i32 start, i32 end, char *str, i32 len){
|
||||||
file_replace_range(system, models, view->file_data.file, start, end, str, len, next_cursor);
|
file_replace_range(system, models, view->file_data.file, start, end, str, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
|
@ -3198,7 +3196,7 @@ view_save_file(System_Functions *system, Models *models,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file && buffer_get_sync(file) != SYNC_GOOD){
|
if (file && (buffer_get_sync(file) != SYNC_GOOD || save_as)){
|
||||||
if (file_save(system, mem, file, filename_string.str)){
|
if (file_save(system, mem, file, filename_string.str)){
|
||||||
if (save_as){
|
if (save_as){
|
||||||
file_set_name(working_set, file, filename_string.str);
|
file_set_name(working_set, file, filename_string.str);
|
||||||
|
@ -4001,7 +3999,6 @@ show_gui_scroll(GUI_Target *target, String *string,
|
||||||
show_gui_float(target, string, indent_level+1, h_align, " scroll_y ", scroll.scroll_y);
|
show_gui_float(target, string, indent_level+1, h_align, " scroll_y ", scroll.scroll_y);
|
||||||
show_gui_int (target, string, indent_level+1, h_align, " target_y ", scroll.target_y);
|
show_gui_int (target, string, indent_level+1, h_align, " target_y ", scroll.target_y);
|
||||||
show_gui_int (target, string, indent_level+1, h_align, " prev_target_y ", scroll.prev_target_y);
|
show_gui_int (target, string, indent_level+1, h_align, " prev_target_y ", scroll.prev_target_y);
|
||||||
show_gui_int (target, string, indent_level+1, h_align, " max_y ", scroll.max_y);
|
|
||||||
show_gui_float(target, string, indent_level+1, h_align, " scroll_x ", scroll.scroll_x);
|
show_gui_float(target, string, indent_level+1, h_align, " scroll_x ", scroll.scroll_x);
|
||||||
show_gui_int (target, string, indent_level+1, h_align, " target_x ", scroll.target_x);
|
show_gui_int (target, string, indent_level+1, h_align, " target_x ", scroll.target_x);
|
||||||
show_gui_int (target, string, indent_level+1, h_align, " prev_target_x ", scroll.prev_target_x);
|
show_gui_int (target, string, indent_level+1, h_align, " prev_target_x ", scroll.prev_target_x);
|
||||||
|
@ -4515,7 +4512,6 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
|
||||||
File_Node *node = 0, *used_nodes = 0;
|
File_Node *node = 0, *used_nodes = 0;
|
||||||
Editing_File **reserved_files = 0;
|
Editing_File **reserved_files = 0;
|
||||||
i32 reserved_top = 0, i = 0;
|
i32 reserved_top = 0, i = 0;
|
||||||
View_Iter iter = {0};
|
|
||||||
|
|
||||||
partition_align(part, sizeof(i32));
|
partition_align(part, sizeof(i32));
|
||||||
reserved_files = (Editing_File**)partition_current(part);
|
reserved_files = (Editing_File**)partition_current(part);
|
||||||
|
@ -4526,7 +4522,7 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
|
||||||
Assert(!file->is_dummy);
|
Assert(!file->is_dummy);
|
||||||
|
|
||||||
if (filename_match(view->dest, &absolutes, file->name.live_name, 1)){
|
if (filename_match(view->dest, &absolutes, file->name.live_name, 1)){
|
||||||
iter = file_view_iter_init(layout, file, 0);
|
View_Iter iter = file_view_iter_init(layout, file, 0);
|
||||||
if (file_view_iter_good(iter)){
|
if (file_view_iter_good(iter)){
|
||||||
reserved_files[reserved_top++] = file;
|
reserved_files[reserved_top++] = file;
|
||||||
}
|
}
|
||||||
|
@ -5091,13 +5087,16 @@ struct Input_Process_Result{
|
||||||
b32 is_animating;
|
b32 is_animating;
|
||||||
b32 consumed_l;
|
b32 consumed_l;
|
||||||
b32 consumed_r;
|
b32 consumed_r;
|
||||||
|
|
||||||
|
b32 has_max_y_suggestion;
|
||||||
|
i32 max_y;
|
||||||
};
|
};
|
||||||
|
|
||||||
internal Input_Process_Result
|
internal Input_Process_Result
|
||||||
do_step_file_view(System_Functions *system,
|
do_step_file_view(System_Functions *system,
|
||||||
View *view, i32_Rect rect, b32 is_active,
|
View *view, i32_Rect rect, b32 is_active,
|
||||||
Input_Summary *user_input,
|
Input_Summary *user_input,
|
||||||
GUI_Scroll_Vars vars, i32_Rect region){
|
GUI_Scroll_Vars vars, i32_Rect region, i32 max_y){
|
||||||
Input_Process_Result result = {0};
|
Input_Process_Result result = {0};
|
||||||
b32 is_file_scroll = 0;
|
b32 is_file_scroll = 0;
|
||||||
|
|
||||||
|
@ -5106,7 +5105,7 @@ do_step_file_view(System_Functions *system,
|
||||||
GUI_Target *target = &view->gui_target;
|
GUI_Target *target = &view->gui_target;
|
||||||
GUI_Interpret_Result interpret_result = {0};
|
GUI_Interpret_Result interpret_result = {0};
|
||||||
|
|
||||||
vars.target_y = clamp(0, vars.target_y, vars.max_y);
|
vars.target_y = clamp(0, vars.target_y, max_y);
|
||||||
|
|
||||||
result.vars = vars;
|
result.vars = vars;
|
||||||
result.region = region;
|
result.region = region;
|
||||||
|
@ -5120,7 +5119,7 @@ do_step_file_view(System_Functions *system,
|
||||||
h->type;
|
h->type;
|
||||||
h = NextHeader(h)){
|
h = NextHeader(h)){
|
||||||
interpret_result = gui_interpret(target, &gui_session, h,
|
interpret_result = gui_interpret(target, &gui_session, h,
|
||||||
result.vars, result.region);
|
result.vars, result.region, max_y);
|
||||||
|
|
||||||
if (interpret_result.has_region){
|
if (interpret_result.has_region){
|
||||||
result.region = interpret_result.region;
|
result.region = interpret_result.region;
|
||||||
|
@ -5161,7 +5160,6 @@ do_step_file_view(System_Functions *system,
|
||||||
result.vars = view_reinit_scrolling(view);
|
result.vars = view_reinit_scrolling(view);
|
||||||
result.is_animating = true;
|
result.is_animating = true;
|
||||||
}
|
}
|
||||||
result.vars.max_y = view_compute_max_target_y(view);
|
|
||||||
|
|
||||||
if (file_step(view, gui_session.rect, user_input, is_active, &result.consumed_l)){
|
if (file_step(view, gui_session.rect, user_input, is_active, &result.consumed_l)){
|
||||||
result.is_animating = true;
|
result.is_animating = true;
|
||||||
|
@ -5208,17 +5206,17 @@ do_step_file_view(System_Functions *system,
|
||||||
activation_key = char_to_upper(activation_key);
|
activation_key = char_to_upper(activation_key);
|
||||||
|
|
||||||
if (activation_key != 0){
|
if (activation_key != 0){
|
||||||
count = keys->count;
|
count = keys->count;
|
||||||
for (i = 0; i < count; ++i){
|
for (i = 0; i < count; ++i){
|
||||||
key = get_single_key(keys, i);
|
key = get_single_key(keys, i);
|
||||||
if (char_to_upper(key.character) == activation_key){
|
if (char_to_upper(key.character) == activation_key){
|
||||||
target->active = b->id;
|
target->active = b->id;
|
||||||
result.is_animating = true;
|
result.is_animating = true;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
case guicom_scrollable_slider:
|
case guicom_scrollable_slider:
|
||||||
|
@ -5244,7 +5242,7 @@ do_step_file_view(System_Functions *system,
|
||||||
v = unlerp(gui_session.scroll_top, (f32)my,
|
v = unlerp(gui_session.scroll_top, (f32)my,
|
||||||
gui_session.scroll_bottom);
|
gui_session.scroll_bottom);
|
||||||
v = clamp(0.f, v, 1.f);
|
v = clamp(0.f, v, 1.f);
|
||||||
result.vars.target_y = ROUND32(lerp(0.f, v, (f32)result.vars.max_y));
|
result.vars.target_y = ROUND32(lerp(0.f, v, (f32)max_y));
|
||||||
|
|
||||||
gui_activate_scrolling(target);
|
gui_activate_scrolling(target);
|
||||||
result.is_animating = true;
|
result.is_animating = true;
|
||||||
|
@ -5258,7 +5256,7 @@ do_step_file_view(System_Functions *system,
|
||||||
result.vars.target_y += user_input->mouse.wheel*target->delta;
|
result.vars.target_y += user_input->mouse.wheel*target->delta;
|
||||||
|
|
||||||
result.vars.target_y =
|
result.vars.target_y =
|
||||||
clamp(0, result.vars.target_y, result.vars.max_y);
|
clamp(0, result.vars.target_y, max_y);
|
||||||
gui_activate_scrolling(target);
|
gui_activate_scrolling(target);
|
||||||
result.is_animating = true;
|
result.is_animating = true;
|
||||||
}
|
}
|
||||||
|
@ -5281,7 +5279,7 @@ do_step_file_view(System_Functions *system,
|
||||||
|
|
||||||
if (scroll_button_input(target, &gui_session, user_input, id, &result.is_animating)){
|
if (scroll_button_input(target, &gui_session, user_input, id, &result.is_animating)){
|
||||||
result.vars.target_y += clamp_bottom(1, target->delta >> 2);
|
result.vars.target_y += clamp_bottom(1, target->delta >> 2);
|
||||||
result.vars.target_y = clamp_top(result.vars.target_y, result.vars.max_y);
|
result.vars.target_y = clamp_top(result.vars.target_y, max_y);
|
||||||
result.consumed_l = true;
|
result.consumed_l = true;
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
|
@ -5289,7 +5287,8 @@ do_step_file_view(System_Functions *system,
|
||||||
case guicom_end_scrollable_section:
|
case guicom_end_scrollable_section:
|
||||||
{
|
{
|
||||||
if (!is_file_scroll){
|
if (!is_file_scroll){
|
||||||
result.vars.max_y = gui_session.suggested_max_y;
|
result.has_max_y_suggestion = true;
|
||||||
|
result.max_y = gui_session.suggested_max_y;
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
|
@ -5528,7 +5527,7 @@ draw_text_field(Render_Target *target, View *view, i32_Rect rect, String p, Stri
|
||||||
draw_rectangle(target, rect, back_color);
|
draw_rectangle(target, rect, back_color);
|
||||||
x = CEIL32(draw_string(target, font_id, p, x, y, text2_color));
|
x = CEIL32(draw_string(target, font_id, p, x, y, text2_color));
|
||||||
draw_string(target, font_id, t, x, y, text1_color);
|
draw_string(target, font_id, t, x, y, text1_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
|
@ -5573,7 +5572,7 @@ draw_text_with_cursor(Render_Target *target, View *view, i32_Rect rect, String s
|
||||||
else{
|
else{
|
||||||
draw_string(target, font_id, s, FLOOR32(x), y, text_color);
|
draw_string(target, font_id, s, FLOOR32(x), y, text_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
|
@ -5583,21 +5582,21 @@ draw_file_bar(Render_Target *target, View *view, Editing_File *file, i32_Rect re
|
||||||
Style_Font *font = &models->global_font;
|
Style_Font *font = &models->global_font;
|
||||||
Style *style = main_style(models);
|
Style *style = main_style(models);
|
||||||
Interactive_Style bar_style = style->main.file_info_style;
|
Interactive_Style bar_style = style->main.file_info_style;
|
||||||
|
|
||||||
u32 back_color = bar_style.bar_color;
|
u32 back_color = bar_style.bar_color;
|
||||||
u32 base_color = bar_style.base_color;
|
u32 base_color = bar_style.base_color;
|
||||||
u32 pop1_color = bar_style.pop1_color;
|
u32 pop1_color = bar_style.pop1_color;
|
||||||
u32 pop2_color = bar_style.pop2_color;
|
u32 pop2_color = bar_style.pop2_color;
|
||||||
|
|
||||||
bar.rect = rect;
|
bar.rect = rect;
|
||||||
|
|
||||||
if (target){
|
if (target){
|
||||||
bar.font_id = font->font_id;
|
bar.font_id = font->font_id;
|
||||||
bar.pos_x = (f32)bar.rect.x0;
|
bar.pos_x = (f32)bar.rect.x0;
|
||||||
bar.pos_y = (f32)bar.rect.y0;
|
bar.pos_y = (f32)bar.rect.y0;
|
||||||
bar.text_shift_y = 2;
|
bar.text_shift_y = 2;
|
||||||
bar.text_shift_x = 0;
|
bar.text_shift_x = 0;
|
||||||
|
|
||||||
draw_rectangle(target, bar.rect, back_color);
|
draw_rectangle(target, bar.rect, back_color);
|
||||||
if (!file){
|
if (!file){
|
||||||
intbar_draw_string(target, &bar, make_lit_string("*NULL*"), base_color);
|
intbar_draw_string(target, &bar, make_lit_string("*NULL*"), base_color);
|
||||||
|
@ -5616,22 +5615,22 @@ draw_file_bar(Render_Target *target, View *view, Editing_File *file, i32_Rect re
|
||||||
append_int_to_str(&line_number, view->edit_pos->cursor.line);
|
append_int_to_str(&line_number, view->edit_pos->cursor.line);
|
||||||
append(&line_number, " C#");
|
append(&line_number, " C#");
|
||||||
append_int_to_str(&line_number, view->edit_pos->cursor.character);
|
append_int_to_str(&line_number, view->edit_pos->cursor.character);
|
||||||
|
|
||||||
intbar_draw_string(target, &bar, line_number, base_color);
|
intbar_draw_string(target, &bar, line_number, base_color);
|
||||||
|
|
||||||
intbar_draw_string(target, &bar, make_lit_string(" -"), base_color);
|
intbar_draw_string(target, &bar, make_lit_string(" -"), base_color);
|
||||||
|
|
||||||
if (file->settings.dos_write_mode){
|
if (file->settings.dos_write_mode){
|
||||||
intbar_draw_string(target, &bar, make_lit_string(" dos"), base_color);
|
intbar_draw_string(target, &bar, make_lit_string(" dos"), base_color);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
intbar_draw_string(target, &bar, make_lit_string(" nix"), base_color);
|
intbar_draw_string(target, &bar, make_lit_string(" nix"), base_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file->state.still_lexing){
|
if (file->state.still_lexing){
|
||||||
intbar_draw_string(target, &bar, make_lit_string(" parsing"), pop1_color);
|
intbar_draw_string(target, &bar, make_lit_string(" parsing"), pop1_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file->settings.unimportant){
|
if (!file->settings.unimportant){
|
||||||
switch (buffer_get_sync(file)){
|
switch (buffer_get_sync(file)){
|
||||||
case SYNC_BEHIND_OS:
|
case SYNC_BEHIND_OS:
|
||||||
|
@ -5639,7 +5638,7 @@ draw_file_bar(Render_Target *target, View *view, Editing_File *file, i32_Rect re
|
||||||
persist String out_of_sync = make_lit_string(" !");
|
persist String out_of_sync = make_lit_string(" !");
|
||||||
intbar_draw_string(target, &bar, out_of_sync, pop2_color);
|
intbar_draw_string(target, &bar, out_of_sync, pop2_color);
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
case SYNC_UNSAVED:
|
case SYNC_UNSAVED:
|
||||||
{
|
{
|
||||||
persist String out_of_sync = make_lit_string(" *");
|
persist String out_of_sync = make_lit_string(" *");
|
||||||
|
@ -5655,7 +5654,7 @@ draw_file_bar(Render_Target *target, View *view, Editing_File *file, i32_Rect re
|
||||||
u32
|
u32
|
||||||
get_margin_color(i32 active_level, Style *style){
|
get_margin_color(i32 active_level, Style *style){
|
||||||
u32 margin = 0xFFFFFFFF;
|
u32 margin = 0xFFFFFFFF;
|
||||||
|
|
||||||
switch (active_level){
|
switch (active_level){
|
||||||
default:
|
default:
|
||||||
margin = style->main.margin_color;
|
margin = style->main.margin_color;
|
||||||
|
@ -5668,19 +5667,19 @@ get_margin_color(i32 active_level, Style *style){
|
||||||
case 3: case 4:
|
case 3: case 4:
|
||||||
margin = style->main.margin_active_color;
|
margin = style->main.margin_active_color;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(margin);
|
return(margin);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
draw_color_button(GUI_Target *gui_target, Render_Target *target, View *view,
|
draw_color_button(GUI_Target *gui_target, Render_Target *target, View *view,
|
||||||
i32_Rect rect, GUI_id id, u32 fore, u32 back, String text){
|
i32_Rect rect, GUI_id id, u32 fore, u32 back, String text){
|
||||||
Models *models = view->persistent.models;
|
Models *models = view->persistent.models;
|
||||||
|
|
||||||
i32 active_level = gui_active_level(gui_target, id);
|
i32 active_level = gui_active_level(gui_target, id);
|
||||||
i16 font_id = models->global_font.font_id;
|
i16 font_id = models->global_font.font_id;
|
||||||
|
|
||||||
if (active_level > 0){
|
if (active_level > 0){
|
||||||
Swap(u32, back, fore);
|
Swap(u32, back, fore);
|
||||||
}
|
}
|
||||||
|
@ -5691,7 +5690,7 @@ draw_color_button(GUI_Target *gui_target, Render_Target *target, View *view,
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
draw_font_button(GUI_Target *gui_target, Render_Target *target, View *view,
|
draw_font_button(GUI_Target *gui_target, Render_Target *target, View *view,
|
||||||
i32_Rect rect, GUI_id id, i16 font_id, String text){
|
i32_Rect rect, GUI_id id, i16 font_id, String text){
|
||||||
Models *models = view->persistent.models;
|
Models *models = view->persistent.models;
|
||||||
Style *style = main_style(models);
|
Style *style = main_style(models);
|
||||||
|
|
||||||
|
@ -5700,7 +5699,7 @@ draw_font_button(GUI_Target *gui_target, Render_Target *target, View *view,
|
||||||
u32 margin = get_margin_color(active_level, style);
|
u32 margin = get_margin_color(active_level, style);
|
||||||
u32 back = style->main.back_color;
|
u32 back = style->main.back_color;
|
||||||
u32 text_color = style->main.default_color;
|
u32 text_color = style->main.default_color;
|
||||||
|
|
||||||
draw_rectangle(target, rect, back);
|
draw_rectangle(target, rect, back);
|
||||||
draw_rectangle_outline(target, rect, margin);
|
draw_rectangle_outline(target, rect, margin);
|
||||||
draw_string(target, font_id, text, rect.x0, rect.y0 + 1, text_color);
|
draw_string(target, font_id, text, rect.x0, rect.y0 + 1, text_color);
|
||||||
|
@ -5708,7 +5707,7 @@ draw_font_button(GUI_Target *gui_target, Render_Target *target, View *view,
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
draw_fat_option_block(GUI_Target *gui_target, Render_Target *target, View *view, i32_Rect rect, GUI_id id,
|
draw_fat_option_block(GUI_Target *gui_target, Render_Target *target, View *view, i32_Rect rect, GUI_id id,
|
||||||
String text, String pop, i8 checkbox = -1){
|
String text, String pop, i8 checkbox = -1){
|
||||||
Models *models = view->persistent.models;
|
Models *models = view->persistent.models;
|
||||||
Style *style = main_style(models);
|
Style *style = main_style(models);
|
||||||
|
|
||||||
|
@ -5830,7 +5829,9 @@ do_render_file_view(System_Functions *system, View *view, GUI_Scroll_Vars *scrol
|
||||||
GUI_Target *gui_target = &view->gui_target;
|
GUI_Target *gui_target = &view->gui_target;
|
||||||
GUI_Interpret_Result interpret_result = {0};
|
GUI_Interpret_Result interpret_result = {0};
|
||||||
|
|
||||||
f32 v;
|
f32 v = {0};
|
||||||
|
|
||||||
|
i32 max_y = view_compute_max_target_y(view);
|
||||||
|
|
||||||
if (gui_target->push.pos > 0){
|
if (gui_target->push.pos > 0){
|
||||||
gui_session_init(&gui_session, gui_target, rect, view->line_height);
|
gui_session_init(&gui_session, gui_target, rect, view->line_height);
|
||||||
|
@ -5844,7 +5845,7 @@ do_render_file_view(System_Functions *system, View *view, GUI_Scroll_Vars *scrol
|
||||||
h->type;
|
h->type;
|
||||||
h = NextHeader(h)){
|
h = NextHeader(h)){
|
||||||
interpret_result = gui_interpret(gui_target, &gui_session, h,
|
interpret_result = gui_interpret(gui_target, &gui_session, h,
|
||||||
*scroll, view->scroll_region);
|
*scroll, view->scroll_region, max_y);
|
||||||
|
|
||||||
if (interpret_result.has_info){
|
if (interpret_result.has_info){
|
||||||
if (gui_session.clip_y > clip_rect.y0){
|
if (gui_session.clip_y > clip_rect.y0){
|
||||||
|
|
|
@ -946,7 +946,7 @@ struct GUI_Interpret_Result{
|
||||||
|
|
||||||
internal GUI_Interpret_Result
|
internal GUI_Interpret_Result
|
||||||
gui_interpret(GUI_Target *target, GUI_Session *session, GUI_Header *h,
|
gui_interpret(GUI_Target *target, GUI_Session *session, GUI_Header *h,
|
||||||
GUI_Scroll_Vars vars, i32_Rect region){
|
GUI_Scroll_Vars vars, i32_Rect region, i32 max_y){
|
||||||
GUI_Interpret_Result result = {0};
|
GUI_Interpret_Result result = {0};
|
||||||
GUI_Section *section = 0;
|
GUI_Section *section = 0;
|
||||||
GUI_Section *new_section = 0;
|
GUI_Section *new_section = 0;
|
||||||
|
@ -1135,11 +1135,11 @@ gui_interpret(GUI_Target *target, GUI_Session *session, GUI_Header *h,
|
||||||
lerp_space_scroll_v =
|
lerp_space_scroll_v =
|
||||||
unlerp(0,
|
unlerp(0,
|
||||||
(f32)target->scroll_original.target_y,
|
(f32)target->scroll_original.target_y,
|
||||||
(f32)target->scroll_original.max_y);
|
(f32)max_y);
|
||||||
|
|
||||||
gui_scrollbar_slider(session->scroll_rect, &rect, lerp_space_scroll_v,
|
gui_scrollbar_slider(session->scroll_rect, &rect, lerp_space_scroll_v,
|
||||||
&session->scroll_top, &session->scroll_bottom,
|
&session->scroll_top, &session->scroll_bottom,
|
||||||
0, target->scroll_original.max_y);
|
0, max_y);
|
||||||
scroll_v = 0;
|
scroll_v = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ pushd ..\build
|
||||||
|
|
||||||
REM call "%CODE_DIR%\buildsuper.bat" ..\code\4coder_default_bindings.cpp
|
REM call "%CODE_DIR%\buildsuper.bat" ..\code\4coder_default_bindings.cpp
|
||||||
call "%CODE_DIR%\buildsuper.bat" ..\code\power\4coder_experiments.cpp
|
call "%CODE_DIR%\buildsuper.bat" ..\code\power\4coder_experiments.cpp
|
||||||
call "%CODE_DIR%\buildsuper.bat" ..\code\power\4coder_casey.cpp
|
REM call "%CODE_DIR%\buildsuper.bat" ..\code\power\4coder_casey.cpp
|
||||||
call "%CODE_DIR%\buildsuper.bat" ..\4vim\4coder_chronal.cpp
|
REM call "%CODE_DIR%\buildsuper.bat" ..\4vim\4coder_chronal.cpp
|
||||||
if %ERRORLEVEL% neq 0 (set FirstError=1)
|
if %ERRORLEVEL% neq 0 (set FirstError=1)
|
||||||
|
|
||||||
set EXPORTS=/EXPORT:app_get_functions
|
set EXPORTS=/EXPORT:app_get_functions
|
||||||
|
|
|
@ -11,31 +11,17 @@
|
||||||
merchantability, fitness for a particular purpose, or non-infringement.
|
merchantability, fitness for a particular purpose, or non-infringement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* BUGS
|
|
||||||
|
|
||||||
Assertion: w:\apps\4coder\source\build\4ed_app.dll
|
|
||||||
w:\apps\4coder\source\code\4ed_file_view.cpp
|
|
||||||
Line: 3261
|
|
||||||
Expression: view->prev_cursor_pos == view_get_cursor_pos(view)
|
|
||||||
|
|
||||||
|
|
||||||
Crash in buffer_get_line_index_range - it doesn't check for lines == 0, which can be the case?
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* TODO(casey): Here are our current issues
|
/* TODO(casey): Here are our current issues
|
||||||
|
|
||||||
- High priority:
|
- High priority:
|
||||||
- Buffer switching still seems a little bit broken. I find I can't reliably hit switch-return
|
- Buffer switching still seems a little bit broken. I find I can't reliably hit switch-return
|
||||||
and switch to the most recently viewed file that wasn't one of the two currently viewed buffers?
|
and switch to the most recently viewed file that wasn't one of the two currently viewed buffers?
|
||||||
- High-DPI settings break rendering and all fonts just show up as solid squares
|
|
||||||
|
- High-DPI settings break rendering and all fonts just show up as solid squares <<< Check this again
|
||||||
|
|
||||||
- Pretty sure auto-indent has some bugs. Things that should be pretty easy to indent
|
- Pretty sure auto-indent has some bugs. Things that should be pretty easy to indent
|
||||||
properly even from only a few surrounding lines seem to be indented improperly at the moment
|
properly even from only a few surrounding lines seem to be indented improperly at the moment
|
||||||
- Multi-line comments should default to indenting to the indentation of the line prior?
|
- Multi-line comments should default to indenting to the indentation of the line prior?
|
||||||
- Would like the option to indent to hanging parentheses, equals signs, etc. instead of
|
|
||||||
always just "one tab in from the previous line".
|
|
||||||
- Actually, maybe just expose the dirty state, so that the user can decide whether to
|
|
||||||
save or not? Not sure...
|
|
||||||
- Replace:
|
- Replace:
|
||||||
- Needs to be case-insensitive, or at least have the option to be
|
- Needs to be case-insensitive, or at least have the option to be
|
||||||
- Needs to replace using the case of the thing being replaced, or at least have the option to do so
|
- Needs to replace using the case of the thing being replaced, or at least have the option to do so
|
||||||
|
@ -57,16 +43,18 @@ Crash in buffer_get_line_index_range - it doesn't check for lines == 0, which ca
|
||||||
|
|
||||||
- Display:
|
- Display:
|
||||||
- When switching _back_ to a buffer, it seems like it loses the scroll position, instead preferring
|
- When switching _back_ to a buffer, it seems like it loses the scroll position, instead preferring
|
||||||
to center the cursor? This is undesirable IMO...
|
to center the cursor? This is undesirable IMO... <<< Check this again
|
||||||
|
|
||||||
- I'd like to be able to hide the mark in text entry mode, and show the whole highlighted
|
- I'd like to be able to hide the mark in text entry mode, and show the whole highlighted
|
||||||
region in edit mode - perhaps even with a magic split at the top or bottom that shows where the mark
|
region in edit mode - perhaps even with a magic split at the top or bottom that shows where the mark
|
||||||
is if it's off screen?
|
is if it's off screen?
|
||||||
- There are often repaint bugs with 4coder coming to the front / unminimizing, etc.
|
- There are often repaint bugs with 4coder coming to the front / unminimizing, etc.
|
||||||
I think this might have something to do with the way you're doing lots of semaphore
|
I think this might have something to do with the way you're doing lots of semaphore
|
||||||
locking but I haven't investigated yet.
|
locking but I haven't investigated yet. <<< How are we doing on this bug? It might be fixed but I haven't heard from anyone.
|
||||||
|
|
||||||
- Need a word-wrap mode that wraps at word boundaries instead of characters
|
- Need a word-wrap mode that wraps at word boundaries instead of characters
|
||||||
- Need to be able to set a word wrap length at something other than the window
|
- Need to be able to set a word wrap length at something other than the window
|
||||||
?FIXED First go-to-line for a file seems to still just go to the beginning of the buffer?
|
- First go-to-line for a file seems to still just go to the beginning of the buffer?
|
||||||
Not sure Allen's right about the slash problem, but either way, we need some
|
Not sure Allen's right about the slash problem, but either way, we need some
|
||||||
way to fix it.
|
way to fix it.
|
||||||
- NOTE / IMPORTANT / TODO highlighting? Ability to customize? Whatever.
|
- NOTE / IMPORTANT / TODO highlighting? Ability to customize? Whatever.
|
||||||
|
@ -85,22 +73,18 @@ Crash in buffer_get_line_index_range - it doesn't check for lines == 0, which ca
|
||||||
be nice if it go _better_ than Emacs, with no need to manually flow comments,
|
be nice if it go _better_ than Emacs, with no need to manually flow comments,
|
||||||
etc.
|
etc.
|
||||||
- It should never reindent text in comments that it doesn't know how to indent - eg., in a comment block, it shouldn't decide to move things around if it doesn't know what they are
|
- It should never reindent text in comments that it doesn't know how to indent - eg., in a comment block, it shouldn't decide to move things around if it doesn't know what they are
|
||||||
- Sometimes when I hit [ it inserts a [ _and_ a space? I think this is related to the auto-indent?
|
- Sometimes when I hit [ it inserts a [ _and_ a space? I think this is related to the auto-indent? <<< Check this again
|
||||||
|
|
||||||
- Buffer management:
|
- Buffer management:
|
||||||
- I'd like to be able to set a buffer to "auto-revert", so it reloads automatically whenever it changes externally
|
- I'd like to be able to set a buffer to "auto-revert", so it reloads automatically whenever it changes externally
|
||||||
- If you undo back to where there are no changes, the "buffer changed" flag should be cleared
|
- If you undo back to where there are no changes, the "buffer changed" flag should be cleared
|
||||||
- Seems like there's no way to switch to buffers whose names are substrings of other
|
- Seems like there's no way to switch to buffers whose names are substrings of other
|
||||||
buffers' names without using the mouse?
|
buffers' names without using the mouse? <<< Check this again
|
||||||
- Also, mouse-clicking on buffers doesn't seem to work reliably? Often it just goes to a
|
|
||||||
blank window?
|
|
||||||
- Buffer switch display should always show the buffer _it will switch to when you hit return_
|
|
||||||
as the first buffer in the list.
|
|
||||||
|
|
||||||
- File system
|
- File system
|
||||||
- When switching to a buffer that has changed on disk, notify? Really this can just
|
- When switching to a buffer that has changed on disk, notify? Really this can just
|
||||||
be some way to query the modification flag and then the customization layer can do it?
|
be some way to query the modification flag and then the customization layer can do it?
|
||||||
- Still can't seem to open a zero-length file?
|
- Still can't seem to open a zero-length file? <<< Check this again
|
||||||
- I'd prefer it if file-open could create new files, and that I could get called on that
|
- I'd prefer it if file-open could create new files, and that I could get called on that
|
||||||
so I can insert my boilerplate headers on new files
|
so I can insert my boilerplate headers on new files
|
||||||
- I'd prefer it if file-open deleted per-character instead of deleting entire path sections
|
- I'd prefer it if file-open deleted per-character instead of deleting entire path sections
|
||||||
|
@ -641,9 +625,9 @@ CUSTOM_COMMAND_SIG(casey_find_corresponding_file_other_window)
|
||||||
CUSTOM_COMMAND_SIG(casey_save_and_make_without_asking)
|
CUSTOM_COMMAND_SIG(casey_save_and_make_without_asking)
|
||||||
{
|
{
|
||||||
exec_command(app, change_active_panel);
|
exec_command(app, change_active_panel);
|
||||||
|
|
||||||
Buffer_Summary buffer = {};
|
Buffer_Summary buffer = {};
|
||||||
|
|
||||||
unsigned int access = AccessAll;
|
unsigned int access = AccessAll;
|
||||||
for(buffer = app->get_buffer_first(app, access);
|
for(buffer = app->get_buffer_first(app, access);
|
||||||
buffer.exists;
|
buffer.exists;
|
||||||
|
@ -800,6 +784,7 @@ casey_parse_error(Application_Links *app, Buffer_Summary buffer, View_Summary vi
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(ParsingRegion);
|
||||||
|
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
@ -1370,7 +1355,6 @@ Casey_Scroll_Velocity casey_scroll_velocity_[16] = {0};
|
||||||
Casey_Scroll_Velocity *casey_scroll_velocity = casey_scroll_velocity_;
|
Casey_Scroll_Velocity *casey_scroll_velocity = casey_scroll_velocity_;
|
||||||
|
|
||||||
SCROLL_RULE_SIG(casey_smooth_scroll_rule){
|
SCROLL_RULE_SIG(casey_smooth_scroll_rule){
|
||||||
dt = 1.0f/60.0f;
|
|
||||||
Casey_Scroll_Velocity *velocity = casey_scroll_velocity + view_id;
|
Casey_Scroll_Velocity *velocity = casey_scroll_velocity + view_id;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if(is_new_target)
|
if(is_new_target)
|
||||||
|
@ -1526,7 +1510,7 @@ extern "C" GET_BINDING_DATA(get_bindings)
|
||||||
bind(context, key_page_up, MDFR_NONE, search);
|
bind(context, key_page_up, MDFR_NONE, search);
|
||||||
bind(context, key_page_down, MDFR_NONE, reverse_search);
|
bind(context, key_page_down, MDFR_NONE, reverse_search);
|
||||||
bind(context, 'm', MDFR_NONE, casey_save_and_make_without_asking);
|
bind(context, 'm', MDFR_NONE, casey_save_and_make_without_asking);
|
||||||
|
|
||||||
// NOTE(allen): Added this so mouse would keep working rougly as before.
|
// NOTE(allen): Added this so mouse would keep working rougly as before.
|
||||||
// Of course now there could be a modal click behavior if that will be useful.
|
// Of course now there could be a modal click behavior if that will be useful.
|
||||||
// As well as right click.
|
// As well as right click.
|
||||||
|
@ -1635,4 +1619,4 @@ extern "C" GET_BINDING_DATA(get_bindings)
|
||||||
|
|
||||||
end_bind_helper(context);
|
end_bind_helper(context);
|
||||||
return context->write_total;
|
return context->write_total;
|
||||||
}
|
}
|
|
@ -693,14 +693,14 @@ Sys_File_Load_End_Sig(system_file_load_end){
|
||||||
|
|
||||||
internal
|
internal
|
||||||
Sys_File_Save_Sig(system_file_save){
|
Sys_File_Save_Sig(system_file_save){
|
||||||
b32 success = 0;
|
b32 success = false;
|
||||||
|
|
||||||
HANDLE file =
|
HANDLE file =
|
||||||
CreateFile((char*)filename, GENERIC_WRITE, 0, 0,
|
CreateFile((char*)filename, GENERIC_WRITE, 0, 0,
|
||||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
||||||
|
|
||||||
if (!file || file == INVALID_HANDLE_VALUE){
|
if (!file || file == INVALID_HANDLE_VALUE){
|
||||||
success = 0;
|
success = false;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
BOOL write_result = 0;
|
BOOL write_result = 0;
|
||||||
|
@ -712,8 +712,8 @@ Sys_File_Save_Sig(system_file_save){
|
||||||
|
|
||||||
CloseHandle(file);
|
CloseHandle(file);
|
||||||
|
|
||||||
if (!write_result || bytes_written != (u32)size){
|
if (write_result && bytes_written == (u32)size){
|
||||||
success = 0;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue