Merged remote changes.

Sun, 16 Jun 2013 15:37:09 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 16 Jun 2013 15:37:09 +0200
changeset 2721
63e4c6545ac1
parent 2720
a41f3093a03b (diff)
parent 2718
af0ba4c4bea6 (current diff)
child 2722
1c5df42d94bf

Merged remote changes.

--- a/UI/Previewer.py	Sat Jun 15 15:54:55 2013 +0200
+++ b/UI/Previewer.py	Sun Jun 16 15:37:09 2013 +0200
@@ -176,7 +176,7 @@
         @param on flag indicating to show a preview (boolean)
         """
         editor = self.__vm.activeWindow()
-        if on and self.__isPreviewable(editor):
+        if on and editor and self.__isPreviewable(editor):
             self.show()
         else:
             self.hide()
@@ -188,16 +188,18 @@
         @param editor reference to an editor (Editor)
         @return flag indicating if a preview can be shown (boolean)
         """
-        if editor.getFileName() is not None:
-            extension = os.path.normcase(os.path.splitext(editor.getFileName())[1][1:])
-            return extension in \
-                Preferences.getEditor("PreviewHtmlFileNameExtensions") + \
-                Preferences.getEditor("PreviewMarkdownFileNameExtensions") + \
-                Preferences.getEditor("PreviewRestFileNameExtensions")
-        elif editor.getLanguage() == "HTML":
-            return True
-        else:
-            return False
+        if editor:
+            if editor.getFileName() is not None:
+                extension = os.path.normcase(
+                    os.path.splitext(editor.getFileName())[1][1:])
+                return extension in \
+                    Preferences.getEditor("PreviewHtmlFileNameExtensions") + \
+                    Preferences.getEditor("PreviewMarkdownFileNameExtensions") + \
+                    Preferences.getEditor("PreviewRestFileNameExtensions")
+            elif editor.getLanguage() == "HTML":
+                return True
+        
+        return False
     
     def __runProcessingThread(self):
         """

eric ide

mercurial