Kaydet (Commit) c1068c02 authored tarafından Nick Treleaven's avatar Nick Treleaven

For Find Usage, ignore unnamed files (prevents a NULL filename GLib warning)

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@523 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 7f99c7fd
2006-07-02 Nick Treleaven <nick.treleaven@btinternet.com>
* src/callbacks.c: For Find Usage, ignore unnamed files.
2006-07-01 Enrico Tröger <enrico.troeger@uvena.de>
* src/document.c, src/keybindings.c: Added shortcut for Select All.
......
......@@ -1296,7 +1296,7 @@ void
on_find_usage1_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
gint i, pos, line;
gint i, pos, line = -1;
gint flags = SCFIND_MATCHCASE | SCFIND_WHOLEWORD;
struct TextToFind ttf;
gchar *buffer, *short_file_name, *string;
......@@ -1305,7 +1305,7 @@ on_find_usage1_activate (GtkMenuItem *menuitem,
gtk_list_store_clear(msgwindow.store_msg);
for(i = 0; i < GEANY_MAX_OPEN_FILES; i++)
{
if (doc_list[i].sci)
if (doc_list[i].sci && doc_list[i].file_name)
{
ttf.chrg.cpMin = 0;
ttf.chrg.cpMax = sci_get_length(doc_list[i].sci);
......@@ -1332,6 +1332,8 @@ on_find_usage1_activate (GtkMenuItem *menuitem,
g_free(ttf.lpstrText);
}
}
if (line == -1) // no matches were found (searching from unnamed file)
msgwin_status_add(_("No matches found for '%s'."), current_word);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment