fixed batch edit line counting bug; fixed font size parsing bug; fixed end of file indenting bug
parent
92e5c30663
commit
0c7389415d
25
4ed.cpp
25
4ed.cpp
|
@ -738,8 +738,15 @@ init_command_line_settings(App_Settings *settings, Plat_Settings *plat_settings,
|
||||||
{
|
{
|
||||||
if (i + 1 < clparams.argc){
|
if (i + 1 < clparams.argc){
|
||||||
plat_settings->set_window_size = true;
|
plat_settings->set_window_size = true;
|
||||||
plat_settings->window_w = str_to_int_c(clparams.argv[i]);
|
|
||||||
plat_settings->window_h = str_to_int_c(clparams.argv[i+1]);
|
i32 w = str_to_int_c(clparams.argv[i]);
|
||||||
|
i32 h = str_to_int_c(clparams.argv[i+1]);
|
||||||
|
if (w > 0){
|
||||||
|
plat_settings->window_w = w;
|
||||||
|
}
|
||||||
|
if (h > 0){
|
||||||
|
plat_settings->window_h = h;
|
||||||
|
}
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
@ -757,8 +764,15 @@ init_command_line_settings(App_Settings *settings, Plat_Settings *plat_settings,
|
||||||
{
|
{
|
||||||
if (i + 1 < clparams.argc){
|
if (i + 1 < clparams.argc){
|
||||||
plat_settings->set_window_pos = true;
|
plat_settings->set_window_pos = true;
|
||||||
plat_settings->window_x = str_to_int_c(clparams.argv[i]);
|
|
||||||
plat_settings->window_y = str_to_int_c(clparams.argv[i+1]);
|
i32 x = str_to_int_c(clparams.argv[i]);
|
||||||
|
i32 y = str_to_int_c(clparams.argv[i+1]);
|
||||||
|
if (x > 0){
|
||||||
|
plat_settings->window_x = x;
|
||||||
|
}
|
||||||
|
if (y > 0){
|
||||||
|
plat_settings->window_y = y;
|
||||||
|
}
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
@ -784,6 +798,7 @@ init_command_line_settings(App_Settings *settings, Plat_Settings *plat_settings,
|
||||||
{
|
{
|
||||||
if (i < clparams.argc){
|
if (i < clparams.argc){
|
||||||
plat_settings->font_size = str_to_int_c(clparams.argv[i]);
|
plat_settings->font_size = str_to_int_c(clparams.argv[i]);
|
||||||
|
plat_settings->font_size = clamp_bottom(8, plat_settings->font_size);
|
||||||
}
|
}
|
||||||
action = CLAct_Nothing;
|
action = CLAct_Nothing;
|
||||||
}break;
|
}break;
|
||||||
|
@ -847,7 +862,6 @@ App_Read_Command_Line_Sig(app_read_command_line){
|
||||||
|
|
||||||
SCROLL_RULE_SIG(fallback_scroll_rule){
|
SCROLL_RULE_SIG(fallback_scroll_rule){
|
||||||
b32 result = false;
|
b32 result = false;
|
||||||
|
|
||||||
if (target_x != *scroll_x){
|
if (target_x != *scroll_x){
|
||||||
*scroll_x = target_x;
|
*scroll_x = target_x;
|
||||||
result = true;
|
result = true;
|
||||||
|
@ -856,7 +870,6 @@ SCROLL_RULE_SIG(fallback_scroll_rule){
|
||||||
*scroll_y = target_y;
|
*scroll_y = target_y;
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1181,7 +1181,7 @@ wrap_state_consume_token(System_Functions *system, Render_Font *font, Code_Wrap_
|
||||||
state->i = i;
|
state->i = i;
|
||||||
|
|
||||||
b32 consume_token = 0;
|
b32 consume_token = 0;
|
||||||
if (i >= state->token_ptr->start + state->token_ptr->size){
|
if (state->token_ptr < state->end_token && i >= state->token_ptr->start + state->token_ptr->size){
|
||||||
consume_token = 1;
|
consume_token = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3503,13 +3503,12 @@ file_do_batch_edit(System_Functions *system, Models *models, Editing_File *file,
|
||||||
// it from cursor fixing is because you're a lazy asshole.
|
// it from cursor fixing is because you're a lazy asshole.
|
||||||
|
|
||||||
// NOTE(allen): meta data
|
// NOTE(allen): meta data
|
||||||
Buffer_Measure_Starts measure_state = {};
|
file_measure_starts(general, &file->state.buffer);
|
||||||
buffer_measure_starts(&measure_state, &file->state.buffer);
|
|
||||||
|
|
||||||
Render_Font *font = system->font.get_render_data_by_id(file->settings.font_id);
|
Render_Font *font = system->font.get_render_data_by_id(file->settings.font_id);
|
||||||
|
|
||||||
// TODO(allen): write the remeasurement version
|
// TODO(allen): write the remeasurement version
|
||||||
file_allocate_character_starts_as_needed(&models->mem.general, file);
|
file_allocate_character_starts_as_needed(general, file);
|
||||||
buffer_measure_character_starts(system, font, &file->state.buffer, file->state.character_starts, 0, file->settings.virtual_white);
|
buffer_measure_character_starts(system, font, &file->state.buffer, file->state.character_starts, 0, file->settings.virtual_white);
|
||||||
|
|
||||||
file_measure_wraps(system, models, file, font);
|
file_measure_wraps(system, models, file, font);
|
||||||
|
|
|
@ -751,6 +751,8 @@ font_load(System_Functions *system, Partition *part, Render_Font *font, i32 pt_s
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
system_set_page(System_Functions *system, Partition *part, Render_Font *font, Glyph_Page *page, u32 page_number, u32 pt_size, b32 use_hinting){
|
system_set_page(System_Functions *system, Partition *part, Render_Font *font, Glyph_Page *page, u32 page_number, u32 pt_size, b32 use_hinting){
|
||||||
|
Assert(pt_size >= 8);
|
||||||
|
|
||||||
memset(page, 0, sizeof(*page));
|
memset(page, 0, sizeof(*page));
|
||||||
|
|
||||||
if (part->base == 0){
|
if (part->base == 0){
|
||||||
|
|
|
@ -87,6 +87,8 @@ Sys_Font_Free_Sig(system_font_free){
|
||||||
|
|
||||||
internal
|
internal
|
||||||
Sys_Font_Init_Sig(system_font_init){
|
Sys_Font_Init_Sig(system_font_init){
|
||||||
|
Assert(font_size >= 8);
|
||||||
|
|
||||||
Partition *scratch = &shared_vars.scratch;
|
Partition *scratch = &shared_vars.scratch;
|
||||||
Temp_Memory temp = begin_temp_memory(scratch);
|
Temp_Memory temp = begin_temp_memory(scratch);
|
||||||
|
|
||||||
|
@ -99,8 +101,6 @@ Sys_Font_Init_Sig(system_font_init){
|
||||||
font->allocate = system_font_allocate;
|
font->allocate = system_font_allocate;
|
||||||
font->free = system_font_free;
|
font->free = system_font_free;
|
||||||
|
|
||||||
font_size = clamp_bottom(8, font_size);
|
|
||||||
|
|
||||||
struct Font_Setup{
|
struct Font_Setup{
|
||||||
Font_Setup *next_font;
|
Font_Setup *next_font;
|
||||||
char *c_filename;
|
char *c_filename;
|
||||||
|
|
Loading…
Reference in New Issue