QScintilla/Editor.py

branch
5_3_x
changeset 2901
11fdeb2891a8
parent 2631
06f866e83d3a
child 2970
e9f971b4b3c5
equal deleted inserted replaced
2887:9b6d993bf7c2 2901:11fdeb2891a8
1418 if self.project.isOpen() and self.project.isProjectFile(filename): 1418 if self.project.isOpen() and self.project.isProjectFile(filename):
1419 language = self.project.getEditorLexerAssoc(os.path.basename(filename)) 1419 language = self.project.getEditorLexerAssoc(os.path.basename(filename))
1420 if not language: 1420 if not language:
1421 ext = os.path.splitext(filename)[1] 1421 ext = os.path.splitext(filename)[1]
1422 if ext in [".py", ".pyw"]: 1422 if ext in [".py", ".pyw"]:
1423 if self.isPy2File(): 1423 if self.isPy3File():
1424 language = "Python3"
1425 elif self.isPy2File():
1424 language = "Python2" 1426 language = "Python2"
1425 elif self.isPy3File():
1426 language = "Python3"
1427 else: 1427 else:
1428 # default is Python 3 1428 # default is Python 3
1429 language = "Python3" 1429 language = "Python3"
1430 else: 1430 else:
1431 filename = os.path.basename(filename) 1431 filename = os.path.basename(filename)
1539 self.completer = None 1539 self.completer = None
1540 1540
1541 filename = os.path.basename(filename) 1541 filename = os.path.basename(filename)
1542 apiLanguage = Preferences.getEditorLexerAssoc(filename) 1542 apiLanguage = Preferences.getEditorLexerAssoc(filename)
1543 if apiLanguage == "": 1543 if apiLanguage == "":
1544 if self.isPy2File(): 1544 if self.isPy3File():
1545 apiLanguage = "Python3"
1546 elif self.isPy2File():
1545 apiLanguage = "Python2" 1547 apiLanguage = "Python2"
1546 elif self.isPy3File():
1547 apiLanguage = "Python3"
1548 elif self.isRubyFile(): 1548 elif self.isRubyFile():
1549 apiLanguage = "Ruby" 1549 apiLanguage = "Ruby"
1550 1550
1551 self.completer = TypingCompleters.getCompleter(apiLanguage, self) 1551 self.completer = TypingCompleters.getCompleter(apiLanguage, self)
1552 1552
1666 """ 1666 """
1667 ftype = self.filetype 1667 ftype = self.filetype
1668 if not ftype: 1668 if not ftype:
1669 ftype = self.getFileTypeByFlag() 1669 ftype = self.getFileTypeByFlag()
1670 if not ftype: 1670 if not ftype:
1671 if self.isPy2File(): 1671 if self.isPy3File():
1672 ftype = "Python3"
1673 elif self.isPy2File():
1672 ftype = "Python2" 1674 ftype = "Python2"
1673 elif self.isPy3File():
1674 ftype = "Python3"
1675 elif self.isRubyFile(): 1675 elif self.isRubyFile():
1676 ftype = "Ruby" 1676 ftype = "Ruby"
1677 else: 1677 else:
1678 ftype = "" 1678 ftype = ""
1679 1679

eric ide

mercurial