Improving the jump history
This commit is contained in:
@@ -613,12 +613,24 @@ void Update(Event event) {
|
||||
For (Windows) {
|
||||
if (it->jump_history) {
|
||||
View *view = GetView(it->active_view);
|
||||
bool are_equal = it->begin_frame_crumb.view_id == it->active_view && AreEqual(view->carets[0], it->begin_frame_crumb.caret);
|
||||
if (!are_equal) {
|
||||
if (!it->skip_checkpoint) {
|
||||
Add(&it->goto_history, it->begin_frame_crumb);
|
||||
it->goto_redo.len = 0;
|
||||
bool should_checkpoint = true;
|
||||
if (it->skip_checkpoint) {
|
||||
should_checkpoint = false;
|
||||
}
|
||||
if (should_checkpoint && it->begin_frame_crumb.view_id == it->active_view) {
|
||||
if (AreEqual(view->carets[0], it->begin_frame_crumb.caret)) {
|
||||
should_checkpoint = false;
|
||||
}
|
||||
|
||||
Buffer *buffer = GetBuffer(view->active_buffer);
|
||||
if (PosToLine(buffer, GetFront(view->main_caret_on_begin_frame)) == PosToLine(buffer, GetFront(view->carets[0]))) {
|
||||
should_checkpoint = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (should_checkpoint) {
|
||||
Add(&it->goto_history, it->begin_frame_crumb);
|
||||
it->goto_redo.len = 0;
|
||||
}
|
||||
it->skip_checkpoint = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user