diff gui/src/m-editor/file-editor-tab.cc @ 14874:5d74d8b982a5 gui

Forgot to have a fallback lexer when the file suffix is unknown. Removed unused variable and added comments. * file-editor-tab.cc: Made the bash lexer the default lexer for unknown file types. * file-editor.cc: Removed unused variable. * workspace-view: Added comments and slot for items being double clicked in the workspace view.
author Jacob Dawid <jacob.dawid@gmail.com>
date Wed, 18 Jul 2012 07:07:18 -0400
parents 355d6c165df0
children bc6c099eacc0
line wrap: on
line diff
--- a/gui/src/m-editor/file-editor-tab.cc	Wed Jul 18 05:45:40 2012 -0400
+++ b/gui/src/m-editor/file-editor-tab.cc	Wed Jul 18 07:07:18 2012 -0400
@@ -29,7 +29,6 @@
 #include <Qsci/qscilexerperl.h>
 #include <Qsci/qscilexerbatch.h>
 #include <Qsci/qscilexerdiff.h>
-
 #include "resource-manager.h"
 #include <QMessageBox>
 #include <QVBoxLayout>
@@ -243,14 +242,18 @@
         }
       lexer_api->prepare ();           // prepare API info ... this make take some time
     }
-  else if (_file_name.endsWith (".c") || _file_name.endsWith (".cc") || _file_name.endsWith (".cpp"))
+  else if (_file_name.endsWith (".c")
+        || _file_name.endsWith (".cc")
+        || _file_name.endsWith (".cpp")
+        || _file_name.endsWith (".cxx")
+        || _file_name.endsWith (".c++")
+        || _file_name.endsWith (".h")
+        || _file_name.endsWith (".hh")
+        || _file_name.endsWith (".hpp")
+        || _file_name.endsWith (".h++"))
     {
       lexer = new QsciLexerCPP ();
     }
-  else if (_file_name.endsWith (".sh"))
-    {
-      lexer = new QsciLexerBash ();
-    }
   else if (_file_name.endsWith (".pl"))
     {
       lexer = new QsciLexerPerl ();
@@ -263,6 +266,10 @@
     {
       lexer = new QsciLexerDiff ();
     }
+  else // Default to bash lexer.
+    {
+      lexer = new QsciLexerBash ();
+    }
 
   QSettings *settings = resource_manager::instance ()->get_settings ();