Commit 219670cb authored by Fabien Parent's avatar Fabien Parent
Browse files

Fix the scrolling when working on big files

parent 9ada6a48
......@@ -783,13 +783,20 @@ void MainWindow::on_go_next_file(bool move_forward)
on_go_next(move_forward);
}
bool MainWindow::do_scroll(const Glib::RefPtr<Gtk::TextMark> mark)
{
textview_->scroll_to(mark, 0.125);
return false;
}
void MainWindow::on_go_next(bool move_forward)
{
if (const FileBufferPtr buffer = FileBufferPtr::cast_static(textview_->get_buffer()))
{
if (const Glib::RefPtr<Gtk::TextMark> mark = buffer->get_next_match(move_forward))
{
textview_->scroll_to(mark, 0.125);
Glib::signal_idle ().connect (sigc::bind<const Glib::RefPtr<Gtk::TextMark> >
(sigc::mem_fun (*this, &MainWindow::do_scroll), mark));
statusline_->set_match_index(buffer->get_match_index());
return;
}
......
......@@ -168,6 +168,8 @@ private:
void on_bound_state_changed();
void on_buffer_modified_changed();
bool do_scroll(const Glib::RefPtr<Gtk::TextMark> mark);
void on_go_next_file(bool move_forward);
void on_go_next(bool move_forward);
void on_replace();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment