changeset 1753:ebfb5af3f5de

fixed editor list in popup menu - show an editor if any of selected files matches - added debug messages
author nadvornik
date Sun, 13 Sep 2009 21:08:40 +0000
parents 843c4eb46e09
children a4f3c93294c9
files src/editors.c
diffstat 1 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/editors.c	Sun Sep 13 21:03:17 2009 +0000
+++ b/src/editors.c	Sun Sep 13 21:08:40 2009 +0000
@@ -645,6 +645,8 @@
 	gchar *pathl;
 	const gchar *p = NULL;
 
+	DEBUG_2("editor_command_path_parse: %s %d %d %s", fd->path, consider_sidecars, type, editor->key);
+
 	string = g_string_new("");
 
 	if (type == PATH_FILE || type == PATH_FILE_URL)
@@ -705,7 +707,8 @@
 		g_free(pathl);
 		pathl = NULL;
 		}
-
+	
+	DEBUG_2("editor_command_path_parse: return %s", pathl);
 	return pathl;
 }
 
@@ -750,6 +753,8 @@
 	gboolean single_quotes = FALSE;
 	gboolean double_quotes = FALSE;
 
+	DEBUG_2("editor_command_parse: %s %d %d", editor->key, consider_sidecars, !!output);
+
 	if (output)
 		result = g_string_new("");
 
@@ -821,6 +826,23 @@
 										  consider_sidecars,
 										  (*p == 'f') ? PATH_FILE : PATH_FILE_URL,
 										  editor);
+						if (!output)
+							{
+							/* just testing, check also the rest of the list (like with F and U)
+							   any matching file is OK */
+							GList *work = list->next;
+							
+							while (!pathl && work)
+								{
+								FileData *fd = work->data;
+								pathl = editor_command_path_parse(fd,
+												  consider_sidecars,
+												  (*p == 'f') ? PATH_FILE : PATH_FILE_URL,
+												  editor);
+								work = work->next;
+								}
+							}
+							
 						if (!pathl)
 							{
 							flags |= EDITOR_ERROR_NO_FILE;