# HG changeset patch # User nadvornik # Date 1252876120 0 # Node ID ebfb5af3f5de565eb798da3ebc9f6481c9e2576e # Parent 843c4eb46e09b68986ae1e8f7b8bc168324e69a2 fixed editor list in popup menu - show an editor if any of selected files matches - added debug messages diff -r 843c4eb46e09 -r ebfb5af3f5de src/editors.c --- 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;