QScintilla/Editor.py

changeset 994
8ed60a191a3a
parent 991
5ec5e707dfa5
child 1002
1151d1ea562a
--- a/QScintilla/Editor.py	Sun Apr 17 19:57:43 2011 +0200
+++ b/QScintilla/Editor.py	Thu Apr 21 09:07:31 2011 +0200
@@ -1630,9 +1630,9 @@
                    self.project.isOpen() and \
                    self.project.isProjectFile(self.fileName):
                     return self.project.getProjectLanguage() in ["Python", "Python2"]
-            
-            if ext in self.dbs.getExtensions('Python2'):
-                return True
+                
+                if ext in self.dbs.getExtensions('Python2'):
+                    return True
         
         return False
 
@@ -1658,9 +1658,9 @@
                    self.project.isOpen() and \
                    self.project.isProjectFile(self.fileName):
                     return self.project.getProjectLanguage() in ["Python3"]
-            
-            if ext in self.dbs.getExtensions('Python3'):
-                return True
+                
+                if ext in self.dbs.getExtensions('Python3'):
+                    return True
         
         return False
 
@@ -2487,7 +2487,11 @@
             
             # save to project, if a project is loaded
             if self.project.isOpen():
-                path = self.project.getProjectPath()
+                if self.fileName is not None and \
+                   self.project.startswithProjectPath(self.fileName):
+                    path = os.path.dirname(self.fileName)
+                else:
+                    path = self.project.getProjectPath()
             
             if not path and self.fileName is not None:
                 path = os.path.dirname(self.fileName)

eric ide

mercurial