ide; find in files; fixed -1 matches found messages.
authorRejean Loyer <rejean.loyer@gmail.com>
Fri, 23 Nov 2012 03:11:58 +0000 (22:11 -0500)
committerRejean Loyer <rejean.loyer@gmail.com>
Fri, 23 Nov 2012 04:56:28 +0000 (23:56 -0500)
ide/src/dialogs/FindInFilesDialog.ec

index 852159f..18a74b7 100644 (file)
@@ -1021,6 +1021,14 @@ private:
                f.Seek(-strlen(contentCriteria), current);*/
          }
          delete f;
+         if(findCount)
+         {
+            app.Lock();
+               ide.outputView.findBox.Logf(
+                     $"Found %d match%s in \"%s\"%s\n\n", findCount, (findCount > 1) ? "es" : "",
+                     relative ? fileRelative : filePath, abortNow ? $" before search was aborted" : "");
+            app.Unlock();
+         }
       }
       else
       {
@@ -1028,14 +1036,6 @@ private:
             ide.outputView.findBox.Logf($"Unable to open file %s\n\n", filePath);
          app.Unlock();
       }
-      if(findCount)
-      {
-         app.Lock();
-            ide.outputView.findBox.Logf(
-                  $"Found %d match%s in \"%s\"%s\n\n", findCount, (findCount > 1) ? "es" : "",
-                  relative ? fileRelative : filePath, abortNow ? $" before search was aborted" : "");
-         app.Unlock();
-      }
       return findCount;
    }
 
@@ -1107,6 +1107,14 @@ private:
                
          }
          delete f;
+         if(replaceCount)
+         {
+            app.Lock();
+               ide.outputView.findBox.Logf(
+                     $"Replaced %d match%s in \"%s\"%s\n\n", replaceCount, (replaceCount > 1) ? $"es" : "",
+                     relative ? fileRelative : filePath, abortNow ? $" before search was aborted" : "");
+            app.Unlock();
+         }
       }
       else
       {
@@ -1114,14 +1122,6 @@ private:
             ide.outputView.findBox.Logf($"Unable to open file %s\n\n", filePath);
          app.Unlock();
       }
-      if(replaceCount)
-      {
-         app.Lock();
-            ide.outputView.findBox.Logf(
-                  $"Replaced %d match%s in \"%s\"%s\n\n", replaceCount, (replaceCount > 1) ? $"es" : "",
-                  relative ? fileRelative : filePath, abortNow ? $" before search was aborted" : "");
-         app.Unlock();
-      }
       return replaceCount;
    }
 }