Fix GLib warning when pressing a key with no documents open.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4017 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
7a77c3a214
commit
4a61fd4620
@ -15,6 +15,8 @@
|
|||||||
* src/document.c, src/editor.c:
|
* src/document.c, src/editor.c:
|
||||||
Fix scrolling horizontally after finding a search match with the
|
Fix scrolling horizontally after finding a search match with the
|
||||||
search bar or Find Next/Previous which is off-screen.
|
search bar or Find Next/Previous which is off-screen.
|
||||||
|
* src/keybindings.c:
|
||||||
|
Fix GLib warning when pressing a key with no documents open.
|
||||||
|
|
||||||
|
|
||||||
2009-07-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
2009-07-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
@ -917,12 +917,14 @@ static gboolean check_snippet_completion(GeanyDocument *doc, guint keyval, guint
|
|||||||
GeanyKeyBinding *kb = keybindings_lookup_item(GEANY_KEY_GROUP_EDITOR,
|
GeanyKeyBinding *kb = keybindings_lookup_item(GEANY_KEY_GROUP_EDITOR,
|
||||||
GEANY_KEYS_EDITOR_COMPLETESNIPPET);
|
GEANY_KEYS_EDITOR_COMPLETESNIPPET);
|
||||||
|
|
||||||
|
g_return_val_if_fail(doc, FALSE);
|
||||||
|
|
||||||
if (kb->key == keyval && kb->mods == state)
|
if (kb->key == keyval && kb->mods == state)
|
||||||
{
|
{
|
||||||
GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
|
GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
|
||||||
|
|
||||||
/* keybinding only valid when scintilla widget has focus */
|
/* keybinding only valid when scintilla widget has focus */
|
||||||
if (doc != NULL && focusw == GTK_WIDGET(doc->editor->sci))
|
if (focusw == GTK_WIDGET(doc->editor->sci))
|
||||||
{
|
{
|
||||||
ScintillaObject *sci = doc->editor->sci;
|
ScintillaObject *sci = doc->editor->sci;
|
||||||
gint pos = sci_get_current_position(sci);
|
gint pos = sci_get_current_position(sci);
|
||||||
@ -1086,6 +1088,7 @@ static gboolean on_key_press_event(GtkWidget *widget, GdkEventKey *ev, gpointer
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
doc = document_get_current();
|
doc = document_get_current();
|
||||||
|
if (doc)
|
||||||
document_check_disk_status(doc, FALSE);
|
document_check_disk_status(doc, FALSE);
|
||||||
|
|
||||||
keyval = ev->keyval;
|
keyval = ev->keyval;
|
||||||
@ -1103,7 +1106,7 @@ static gboolean on_key_press_event(GtkWidget *widget, GdkEventKey *ev, gpointer
|
|||||||
if (vte_info.have_vte && check_vte(state, keyval))
|
if (vte_info.have_vte && check_vte(state, keyval))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
if (check_snippet_completion(doc, keyval, state))
|
if (doc && check_snippet_completion(doc, keyval, state))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (check_menu_key(doc, keyval, state, ev->time))
|
if (check_menu_key(doc, keyval, state, ev->time))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user