ide; fixed opening media file from find in file output. sorts out the mess left by...
authorRejean Loyer <rejean.loyer@gmail.com>
Mon, 17 Jun 2013 19:26:04 +0000 (15:26 -0400)
committerRejean Loyer <rejean.loyer@gmail.com>
Fri, 21 Jun 2013 14:18:29 +0000 (10:18 -0400)
ide/src/ide.ec

index cc298ba..cc47298 100644 (file)
@@ -2539,33 +2539,29 @@ class IDEWorkSpace : Window
    {
       if(fileAttribs.isFile)
       {
-         CodeEditor codeEditor = (CodeEditor)OpenFile(path, normal, true, "", no, normal, false);
-         if(codeEditor && line)
+         char ext[MAX_EXTENSION];
+         GetExtension(path, ext);
+         if(!strcmp(ext, "mp3") || !strcmp(ext, "flac") || !strcmp(ext, "ogg") || !strcmp(ext, "avi") || !strcmp(ext, "mkv"))
+            ShellOpen(path);
+         else if(!strcmp(ext, "a") || !strcmp(ext, "o") || !strcmp(ext, "lib") || !strcmp(ext, "dll") || !strcmp(ext, "exe"))
          {
-            char ext[MAX_EXTENSION];
-            GetExtension(path, ext);
-            if(!strcmp(ext, "mp3") || !strcmp(ext, "flac") || !strcmp(ext, "ogg") || !strcmp(ext, "avi") || !strcmp(ext, "mkv"))
-               ShellOpen(path);
-            else if(!strcmp(ext, "a") || !strcmp(ext, "o") || !strcmp(ext, "lib") || !strcmp(ext, "dll") || !strcmp(ext, "exe"))
-            {
-               char dirPath[MAX_LOCATION];
-               StripLastDirectory(path, dirPath);
-               ShellOpen(dirPath);
-            }
-            else
+            char dirPath[MAX_LOCATION];
+            StripLastDirectory(path, dirPath);
+            ShellOpen(dirPath);
+         }
+         else
+         {
+            CodeEditor codeEditor = (CodeEditor)OpenFile(path, normal, true, ext, no, normal, false);
+            if(codeEditor && line)
             {
-               CodeEditor codeEditor = (CodeEditor)OpenFile(path, normal, true, "", no, normal, false);
-               if(codeEditor && line)
-               {
-                  EditBox editBox = codeEditor.editBox;
-                  editBox.GoToLineNum(line - 1);
-                  editBox.GoToPosition(editBox.line, line - 1, col ? (col - 1) : 0);
-               }
+               EditBox editBox = codeEditor.editBox;
+               editBox.GoToLineNum(line - 1);
+               editBox.GoToPosition(editBox.line, line - 1, col ? (col - 1) : 0);
             }
          }
-         else if(fileAttribs.isDirectory)
-            ShellOpen(path);
       }
+      else if(fileAttribs.isDirectory)
+         ShellOpen(path);
    }
 
    void OnRedraw(Surface surface)