Scroll session files in view after all resizing of the Scintilla widget and rename sci_scroll_to_line

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@379 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2006-05-30 18:03:19 +00:00
parent 4e27051196
commit e5f238c232
5 changed files with 25 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2006-05-30 Nick Treleaven <nick.treleaven@btinternet.com>
* src/keyfile.c, src/sciwrappers.c, src/sciwrappers.h, src/document.c:
Scroll session files in view after all resizing of the Scintilla
widget and rename sci_scroll_to_line.
2006-05-30 Enrico Troeger <enrico.troeger@uvena.de>
* src/dialogs.c, src/main.c:

View File

@ -531,8 +531,6 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read
filetype *use_ft = (ft != NULL) ? ft : filetypes_get_from_filename(utf8_filename);
sci_goto_pos(doc_list[idx].sci, pos, TRUE);
//if (app->main_window_realized) // avoids warnings, but doesn't scroll, so accept warning
sci_scroll_to_line(doc_list[idx].sci, sci_get_line_from_position(doc_list[idx].sci, pos) - 10);
if (readonly) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
lookup_widget(app->window, "set_file_readonly1")), TRUE);

View File

@ -401,6 +401,21 @@ void configuration_apply_settings(void)
gtk_paned_set_position(GTK_PANED(lookup_widget(app->window, "hpaned1")), hpan_position);
gtk_paned_set_position(GTK_PANED(lookup_widget(app->window, "vpaned1")), vpan_position);
}
// now the scintilla widget pages may need scrolling in view
if (app->pref_main_load_session)
{
gint idx;
guint tabnum = 0;
while (tabnum < gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)))
{
idx = document_get_n_idx(tabnum);
if (idx < 0) break;
sci_scroll_caret(doc_list[idx].sci);
tabnum++;
}
}
}

View File

@ -744,9 +744,9 @@ void sci_set_keywords(ScintillaObject *sci, gint k, gchar *text)
SSM(sci, SCI_SETKEYWORDS, k, (sptr_t) text);
}
void sci_scroll_to_line(ScintillaObject *sci, gint line)
void sci_scroll_lines(ScintillaObject *sci, gint lines)
{
SSM(sci, SCI_LINESCROLL, 0, line);
SSM(sci, SCI_LINESCROLL, 0, lines);
}
void sci_set_readonly(ScintillaObject *sci, gboolean readonly)

View File

@ -137,7 +137,7 @@ void sci_target_start (ScintillaObject * sci, gint start);
void sci_target_end (ScintillaObject * sci, gint end);
void sci_target_replace (ScintillaObject * sci, const gchar *text);
void sci_set_keywords (ScintillaObject * sci, gint k, gchar *text);
void sci_scroll_to_line (ScintillaObject * sci, gint line);
void sci_scroll_lines (ScintillaObject * sci, gint lines);
gint sci_get_lexer (ScintillaObject * sci);
void sci_set_readonly (ScintillaObject * sci, gboolean readonly);
gboolean sci_get_readonly (ScintillaObject * sci);