Better scrolling to line

master
Yevgen Muntyan 2006-08-01 16:18:17 -05:00
parent 31b50feaa7
commit 14db61af5e
2 changed files with 7 additions and 18 deletions

View File

@ -1672,7 +1672,8 @@ moo_editor_open_file_line (MooEditor *editor,
if (doc)
{
moo_text_view_move_cursor (MOO_TEXT_VIEW (doc), line, 0, FALSE, FALSE);
if (line >= 0)
moo_text_view_move_cursor (MOO_TEXT_VIEW (doc), line, 0, FALSE, FALSE);
moo_editor_set_active_doc (editor, doc);
gtk_widget_grab_focus (GTK_WIDGET (doc));
return doc;
@ -1683,7 +1684,8 @@ moo_editor_open_file_line (MooEditor *editor,
/* XXX */
moo_editor_set_active_doc (editor, doc);
moo_text_view_move_cursor (MOO_TEXT_VIEW (doc), line, 0, FALSE, TRUE);
if (line >= 0)
moo_text_view_move_cursor (MOO_TEXT_VIEW (doc), line, 0, FALSE, TRUE);
gtk_widget_grab_focus (GTK_WIDGET (doc));
return doc;
}
@ -1809,7 +1811,7 @@ _moo_editor_reload (MooEditor *editor,
}
moo_text_view_move_cursor (MOO_TEXT_VIEW (doc), cursor_line,
cursor_offset, TRUE, TRUE);
cursor_offset, TRUE, FALSE);
}

View File

@ -871,7 +871,6 @@ output_activate (WindowStuff *stuff,
int line)
{
MooEditor *editor;
MooEdit *doc;
FileLinePair *line_data;
line_data = moo_line_view_get_data (MOO_LINE_VIEW (stuff->output), line);
@ -880,20 +879,8 @@ output_activate (WindowStuff *stuff,
return FALSE;
editor = moo_edit_window_get_editor (stuff->window);
moo_editor_open_file (editor, stuff->window, NULL,
line_data->filename, NULL);
doc = moo_editor_get_doc (editor, line_data->filename);
if (!doc)
return TRUE;
moo_editor_set_active_doc (editor, doc);
gtk_widget_grab_focus (GTK_WIDGET (doc));
if (line_data->line >= 0)
moo_text_view_move_cursor (MOO_TEXT_VIEW (doc),
line_data->line, -1, FALSE, TRUE);
moo_editor_open_file_line (editor, line_data->filename,
line_data->line, stuff->window);
return TRUE;
}