Browse Source

Minor cleanup of cursor history

pipelines/235045657
eidheim 6 years ago
parent
commit
f7a133b1ce
  1. 10
      src/notebook.cpp

10
src/notebook.cpp

@ -386,17 +386,11 @@ bool Notebook::open(const boost::filesystem::path &file_path_, Position position
auto prev_it = cursor_locations.begin(); auto prev_it = cursor_locations.begin();
for(auto it = std::next(prev_it); it != cursor_locations.end();) { for(auto it = std::next(prev_it); it != cursor_locations.end();) {
if(prev_it->view == it->view && abs(prev_it->mark->get_iter().get_line() - it->mark->get_iter().get_line()) <= 2) { if(prev_it->view == it->view && abs(prev_it->mark->get_iter().get_line() - it->mark->get_iter().get_line()) <= 2) {
if(current_cursor_location == it) { if(current_cursor_location == it)
prev_it->view->get_buffer()->delete_mark(prev_it->mark); current_cursor_location = prev_it;
cursor_locations.erase(prev_it);
prev_it = it;
++it;
}
else {
it->view->get_buffer()->delete_mark(it->mark); it->view->get_buffer()->delete_mark(it->mark);
it = cursor_locations.erase(it); it = cursor_locations.erase(it);
} }
}
else { else {
++it; ++it;
++prev_it; ++prev_it;

Loading…
Cancel
Save