Diff of /src/search.c [db140b] .. [0998f1] Maximize Restore

  Switch to side-by-side view

--- a/src/search.c
+++ b/src/search.c
@@ -781,7 +781,7 @@
 	}
 	else if (selection == FILES_MODE_PROJECT)
 	{
-		if (app->project && NZV(app->project->file_patterns))
+		if (app->project && !EMPTY(app->project->file_patterns))
 		{
 			gchar *patterns;
 
@@ -1063,14 +1063,14 @@
 
 	/* add project's base path directory to the dir list, we do this here once
 	 * (in create_fif_dialog() it would fail if a project is opened after dialog creation) */
-	if (app->project != NULL && NZV(app->project->base_path))
+	if (app->project != NULL && !EMPTY(app->project->base_path))
 	{
 		ui_combo_box_prepend_text_once(GTK_COMBO_BOX_TEXT(fif_dlg.dir_combo),
 			app->project->base_path);
 	}
 
 	entry = gtk_bin_get_child(GTK_BIN(fif_dlg.dir_combo));
-	if (NZV(dir))
+	if (!EMPTY(dir))
 		cur_dir = g_strdup(dir);	/* custom directory argument passed */
 	else
 	{
@@ -1092,7 +1092,7 @@
 
 			last_doc = doc;
 		}
-		if (!cur_dir && ! NZV(gtk_entry_get_text(GTK_ENTRY(entry))))
+		if (!cur_dir && EMPTY(gtk_entry_get_text(GTK_ENTRY(entry))))
 		{
 			/* use default_open_path if no directory could be determined
 			 * (e.g. when no files are open) */
@@ -1226,7 +1226,7 @@
 	/* clear previous search indicators */
 	editor_indicator_clear(doc->editor, GEANY_INDICATOR_SEARCH);
 
-	if (G_UNLIKELY(! NZV(search_text)))
+	if (G_UNLIKELY(EMPTY(search_text)))
 		return 0;
 
 	ttf.chrg.cpMin = 0;
@@ -1308,7 +1308,7 @@
 		search_data.flags = int_search_flags(settings.find_case_sensitive,
 			settings.find_match_whole_word, settings.find_regexp, settings.find_match_word_start);
 
-		if (! NZV(search_data.text))
+		if (EMPTY(search_data.text))
 		{
 			fail:
 			utils_beep();
@@ -1594,9 +1594,9 @@
 		GeanyEncodingIndex enc_idx = gtk_combo_box_get_active(
 			GTK_COMBO_BOX(fif_dlg.encoding_combo));
 
-		if (G_UNLIKELY(! NZV(utf8_dir)))
+		if (G_UNLIKELY(EMPTY(utf8_dir)))
 			ui_set_statusbar(FALSE, _("Invalid directory for find in files."));
-		else if (NZV(search_text))
+		else if (!EMPTY(search_text))
 		{
 			gchar *locale_dir;
 			GString *opts = get_grep_options();
@@ -1638,7 +1638,7 @@
 	gboolean ret = FALSE;
 	gssize utf8_text_len;
 
-	if (! NZV(utf8_search_text) || ! dir) return TRUE;
+	if (EMPTY(utf8_search_text) || ! dir) return TRUE;
 
 	command_grep = g_find_program_in_path(tool_prefs.grep_cmd);
 	if (command_grep == NULL)
@@ -2166,7 +2166,7 @@
 	doc = document_get_current();
 	g_return_if_fail(doc != NULL);
 
-	if (G_UNLIKELY(! NZV(search_text)))
+	if (G_UNLIKELY(EMPTY(search_text)))
 	{
 		utils_beep();
 		return;