fixed off-by-one in remeasure widths

master
Allen Webster 2016-07-04 00:04:39 -04:00
parent 8bcda623a8
commit cdcc01ec23
3 changed files with 9 additions and 4 deletions

View File

@ -801,7 +801,9 @@ view_open_file(Application_Links *app, View_Summary *view,
Buffer_Summary buffer = app->get_buffer_by_name(app, filename, filename_len, AccessProtected|AccessHidden);
if (buffer.exists){
if (!do_in_background){
app->view_set_buffer(app, view, buffer.buffer_id, 0);
if (view){
app->view_set_buffer(app, view, buffer.buffer_id, 0);
}
}
result = true;
}
@ -809,8 +811,10 @@ view_open_file(Application_Links *app, View_Summary *view,
buffer = app->create_buffer(app, filename, filename_len, do_in_background);
if (!do_in_background){
if (buffer.exists){
app->view_set_buffer(app, view, buffer.buffer_id, 0);
result = true;
if (view){
app->view_set_buffer(app, view, buffer.buffer_id, 0);
result = true;
}
}
}
}

View File

@ -779,6 +779,7 @@ buffer_remeasure_widths(Buffer_Type *buffer, float *advance_data,
assert_4tech(line_start <= line_end);
assert_4tech(line_count <= buffer->widths_max);
++line_end;
if (line_shift != 0){
memmove_4tech(widths + line_end + line_shift, widths + line_end,
sizeof(float)*(widths_count - line_end));

View File

@ -530,7 +530,7 @@ Win32AllocCoroutine(){
return(result);
}
nternal void
internal void
Win32FreeCoroutine(Win32_Coroutine *data){
data->next = win32vars.coroutine_free;
win32vars.coroutine_free = data;