Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sun, 12 Oct 2014 16:00:12 UTC Commit: f5230f334e28248c91fa6f58f3557f0b40f40233 https://github.com/geany/geany/commit/f5230f334e28248c91fa6f58f3557f0b40f402...
Log Message: ----------- Fix moving editor tabs through keybindings
Modified Paths: -------------- src/keybindings.c
Modified: src/keybindings.c 15 lines changed, 7 insertions(+), 8 deletions(-) =================================================================== @@ -1779,20 +1779,19 @@ static void cb_func_switch_tablastused(G_GNUC_UNUSED guint key_id) /* move document left/right/first/last */ static void cb_func_move_tab(guint key_id) { - GtkWidget *sci; + GtkWidget *child; GtkNotebook *nb = GTK_NOTEBOOK(main_widgets.notebook); gint cur_page = gtk_notebook_get_current_page(nb); - GeanyDocument *doc = document_get_current();
- if (doc == NULL) + if (cur_page < 0) return;
- sci = GTK_WIDGET(doc->editor->sci); + child = gtk_notebook_get_nth_page(nb, cur_page);
switch (key_id) { case GEANY_KEYS_NOTEBOOK_MOVETABLEFT: - gtk_notebook_reorder_child(nb, sci, cur_page - 1); /* notebook wraps around by default */ + gtk_notebook_reorder_child(nb, child, cur_page - 1); /* notebook wraps around by default */ break; case GEANY_KEYS_NOTEBOOK_MOVETABRIGHT: { @@ -1800,14 +1799,14 @@ static void cb_func_move_tab(guint key_id)
if (npage == gtk_notebook_get_n_pages(nb)) npage = 0; /* wraparound */ - gtk_notebook_reorder_child(nb, sci, npage); + gtk_notebook_reorder_child(nb, child, npage); break; } case GEANY_KEYS_NOTEBOOK_MOVETABFIRST: - gtk_notebook_reorder_child(nb, sci, (file_prefs.tab_order_ltr) ? 0 : -1); + gtk_notebook_reorder_child(nb, child, (file_prefs.tab_order_ltr) ? 0 : -1); break; case GEANY_KEYS_NOTEBOOK_MOVETABLAST: - gtk_notebook_reorder_child(nb, sci, (file_prefs.tab_order_ltr) ? -1 : 0); + gtk_notebook_reorder_child(nb, child, (file_prefs.tab_order_ltr) ? -1 : 0); break; } return;
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).