eric6/QScintilla/Editor.py

changeset 8228
772103b14c18
parent 8222
5994b80b8760
child 8231
377c24760c37
equal deleted inserted replaced
8227:349308e84eeb 8228:772103b14c18
686 elif self.filetype in ["Python", "Python3", "MicroPython"]: 686 elif self.filetype in ["Python", "Python3", "MicroPython"]:
687 bindName = "dummy.py" 687 bindName = "dummy.py"
688 688
689 if not bindName and line0.startswith("#!"): 689 if not bindName and line0.startswith("#!"):
690 # #! marker detection 690 # #! marker detection
691 if "python3" in line0: 691 if (
692 bindName = "dummy.py" 692 "python3" in line0 or
693 self.filetype = "Python3" 693 "python" in line0 or
694 elif "python" in line0: 694 "pypy3" in line0 or
695 bindName = "dummy.py" 695 "pypy" in line0
696 self.filetype = "Python3" 696 ):
697 elif "pypy3" in line0:
698 bindName = "dummy.py"
699 self.filetype = "Python3"
700 elif "pypy" in line0:
701 bindName = "dummy.py" 697 bindName = "dummy.py"
702 self.filetype = "Python3" 698 self.filetype = "Python3"
703 elif ("/bash" in line0 or "/sh" in line0): 699 elif ("/bash" in line0 or "/sh" in line0):
704 bindName = "dummy.sh" 700 bindName = "dummy.sh"
705 elif "ruby" in line0: 701 elif "ruby" in line0:
5040 self.__acTimer.stop() 5036 self.__acTimer.stop()
5041 self.__acContext = context 5037 self.__acContext = context
5042 self.__acTimer.start() 5038 self.__acTimer.start()
5043 else: 5039 else:
5044 self.__autoComplete(auto, context) 5040 self.__autoComplete(auto, context)
5045 elif not auto:
5046 self.autoCompleteQScintilla()
5047 elif ( 5041 elif (
5048 self.autoCompletionSource() != 5042 not auto or
5049 QsciScintilla.AutoCompletionSource.AcsNone 5043 (self.autoCompletionSource() !=
5044 QsciScintilla.AutoCompletionSource.AcsNone)
5050 ): 5045 ):
5051 self.autoCompleteQScintilla() 5046 self.autoCompleteQScintilla()
5052 5047
5053 def __getAcText(self): 5048 def __getAcText(self):
5054 """ 5049 """
7899 @return flag indicating pos is in a spell check region 7894 @return flag indicating pos is in a spell check region
7900 @rtype bool 7895 @rtype bool
7901 """ 7896 """
7902 if self.__spellCheckStringsOnly: 7897 if self.__spellCheckStringsOnly:
7903 if ( 7898 if (
7904 self.__fileNameExtension in 7899 (self.__fileNameExtension in
7905 Preferences.getEditor("FullSpellCheckExtensions") 7900 Preferences.getEditor("FullSpellCheckExtensions")) or
7906 ): 7901 (not self.__fileNameExtension and
7907 return True 7902 Preferences.getEditor("FullSpellCheckUnknown"))
7908 elif (
7909 not self.__fileNameExtension and
7910 Preferences.getEditor("FullSpellCheckUnknown")
7911 ): 7903 ):
7912 return True 7904 return True
7913 else: 7905 else:
7914 style = self.styleAt(pos) 7906 style = self.styleAt(pos)
7915 if self.lexer_ is not None: 7907 if self.lexer_ is not None:

eric ide

mercurial