SF.net SVN: geany: [2702] branches/document-pointer/src

ntrel at users.sourceforge.net ntrel at xxxxx
Wed Jun 18 13:36:34 UTC 2008


Revision: 2702
          http://geany.svn.sourceforge.net/geany/?rev=2702&view=rev
Author:   ntrel
Date:     2008-06-18 06:36:33 -0700 (Wed, 18 Jun 2008)

Log Message:
-----------
Fix redo, reload commands.
Fix focusing editor on notebook tab click.
Minor formatting and use NZV, DOC_FILENAME macros.
Make doc_at() debug function check idx is within range.

Modified Paths:
--------------
    branches/document-pointer/src/callbacks.c
    branches/document-pointer/src/document.c
    branches/document-pointer/src/notebook.c

Modified: branches/document-pointer/src/callbacks.c
===================================================================
--- branches/document-pointer/src/callbacks.c	2008-06-17 21:30:15 UTC (rev 2701)
+++ branches/document-pointer/src/callbacks.c	2008-06-18 13:36:33 UTC (rev 2702)
@@ -292,7 +292,7 @@
                                         gpointer         user_data)
 {
 	GeanyDocument *doc = document_get_current();
-	if (doc == NULL && (document_can_redo(doc)))
+	if (doc != NULL && document_can_redo(doc))
 		document_redo(doc);
 }
 
@@ -329,7 +329,7 @@
 	if (GTK_IS_EDITABLE(focusw))
 		gtk_editable_copy_clipboard(GTK_EDITABLE(focusw));
 	else
-	if (IS_SCINTILLA(focusw) && doc!= NULL)
+	if (IS_SCINTILLA(focusw) && doc != NULL)
 		sci_copy(doc->sci);
 	else
 	if (GTK_IS_TEXT_VIEW(focusw))
@@ -1952,8 +1952,7 @@
 
 	/* use the filetype specific command if available, fallback to global command otherwise */
 	if (doc->file_type != NULL &&
-		doc->file_type->context_action_cmd != NULL &&
-		*doc->file_type->context_action_cmd != '\0')
+		NZV(doc->file_type->context_action_cmd))
 	{
 		command = g_strdup(doc->file_type->context_action_cmd);
 	}

Modified: branches/document-pointer/src/document.c
===================================================================
--- branches/document-pointer/src/document.c	2008-06-17 21:30:15 UTC (rev 2701)
+++ branches/document-pointer/src/document.c	2008-06-18 13:36:33 UTC (rev 2702)
@@ -657,7 +657,7 @@
 	}
 
 	msgwin_status_add(_("New file \"%s\" opened."),
-		(doc->file_name != NULL) ? doc->file_name : GEANY_STRING_UNTITLED);
+		DOC_FILENAME(doc));
 
 	return doc;
 }
@@ -1234,7 +1234,7 @@
 	gint pos = 0;
 	GeanyDocument *new_doc;
 
-	if (doc != NULL)
+	if (doc == NULL)
 		return FALSE;
 
 	/* try to set the cursor to the position before reloading */
@@ -2467,7 +2467,7 @@
 #ifdef GEANY_DEBUG
 GeanyDocument *doc_at(gint idx)
 {
-	return (idx >= 0) ? documents[idx] : NULL;
+	return (idx >= 0 && idx < (gint) documents_array->len) ? documents[idx] : NULL;
 }
 #endif
 

Modified: branches/document-pointer/src/notebook.c
===================================================================
--- branches/document-pointer/src/notebook.c	2008-06-17 21:30:15 UTC (rev 2701)
+++ branches/document-pointer/src/notebook.c	2008-06-18 13:36:33 UTC (rev 2702)
@@ -81,7 +81,7 @@
 {
 	GeanyDocument *doc = document_get_current();
 
-	if (doc != NULL)
+	if (doc == NULL)
 		return;
 
 	gtk_widget_grab_focus(GTK_WIDGET(doc->sci));


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list