diff --git a/4ed.cpp b/4ed.cpp index 4b965134..3155150f 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -147,7 +147,6 @@ do_feedback_message(System_Functions *system, Models *models, String value){ if (file){ output_file_append(system, models, file, value, 1); - i32 pos = buffer_size(&file->state.buffer); for (View_Iter iter = file_view_iter_init(&models->layout, file, 0); file_view_iter_good(iter); diff --git a/4ed_file_view.cpp b/4ed_file_view.cpp index 04695dd6..c461a3d4 100644 --- a/4ed_file_view.cpp +++ b/4ed_file_view.cpp @@ -2823,29 +2823,31 @@ file_step(View *view, i32_Rect region, Input_Summary *user_input, b32 is_active) f32 cursor_max_y = CursorMaxY(max_visible_y, line_height); f32 cursor_min_y = CursorMinY(scroll_vars.min_y, line_height); + + if (!gui_id_eq(view->gui_target.active, gui_id_scrollbar())){ + if (cursor_y > target_y + cursor_max_y){ + target_y = cursor_y - cursor_max_y + delta_y; + } + if (cursor_y < target_y + cursor_min_y){ + target_y = cursor_y - delta_y - cursor_min_y; + } - if (cursor_y > target_y + cursor_max_y){ - target_y = cursor_y - cursor_max_y + delta_y; - } - if (cursor_y < target_y + cursor_min_y){ - target_y = cursor_y - delta_y - cursor_min_y; + if (target_y > scroll_vars.max_y) target_y = scroll_vars.max_y; + if (target_y < scroll_vars.min_y) target_y = view->file_scroll.min_y; + + if (cursor_x < target_x){ + target_x = (f32)Max(0, cursor_x - max_x/2); + } + else if (cursor_x >= target_x + max_x){ + target_x = (f32)(cursor_x - max_x/2); + } + + if (target_x != scroll_vars.target_x || target_y != scroll_vars.target_y){ + view->gui_target.scroll_updated.target_x = target_x; + view->gui_target.scroll_updated.target_y = target_y; + } } - if (target_y > scroll_vars.max_y) target_y = scroll_vars.max_y; - if (target_y < scroll_vars.min_y) target_y = view->file_scroll.min_y; - - if (cursor_x < target_x){ - target_x = (f32)Max(0, cursor_x - max_x/2); - } - else if (cursor_x >= target_x + max_x){ - target_x = (f32)(cursor_x - max_x/2); - } - - if (target_x != scroll_vars.target_x || target_y != scroll_vars.target_y){ - view->gui_target.scroll_updated.target_x = target_x; - view->gui_target.scroll_updated.target_y = target_y; - } - if (file->state.paste_effect.tick_down > 0){ --file->state.paste_effect.tick_down; is_animating = 1; diff --git a/README.txt b/README.txt index b9e2f5b9..93fb37a3 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -Distribution Date: 10.05.2016 (dd.mm.yyyy) +Distribution Date: 12.05.2016 (dd.mm.yyyy) Thank you for contributing to the 4coder project! diff --git a/SUPERREADME.txt b/SUPERREADME.txt index eadd7617..57736ef4 100644 --- a/SUPERREADME.txt +++ b/SUPERREADME.txt @@ -1,4 +1,4 @@ -Distribution Date: 10.05.2016 (dd.mm.yyyy) +Distribution Date: 12.05.2016 (dd.mm.yyyy) Thank you for contributing to the 4coder project!