[gtksourceview] Completion: warning when a header is selected



commit 4a78b6b1fe7a093df6f7815551359ecf6675a540
Author: SÃbastien Wilmet <swilmet gnome org>
Date:   Thu Feb 14 20:09:27 2013 +0100

    Completion: warning when a header is selected
    
    Normally it never happens, but it's better to have the warning, just in
    case.

 gtksourceview/gtksourcecompletion.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index c2f96b6..7fce2f2 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -2894,7 +2894,9 @@ selection_func (GtkTreeSelection    *selection,
        if (gtk_source_completion_model_iter_is_header (completion->priv->model_proposals,
                                                        &iter))
        {
-               return path_currently_selected;
+               /* A header must never be selected */
+               g_return_val_if_fail (!path_currently_selected, TRUE);
+               return FALSE;
        }
        else
        {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]