Sun, 18 Dec 2016 14:09:26 +0100
Fixed an issue dealing with source documents without a recodnized lexer language.
AssistantEric/Assistant.py | file | annotate | diff | comparison | revisions | |
ChangeLog | file | annotate | diff | comparison | revisions | |
PluginAssistantEric.py | file | annotate | diff | comparison | revisions | |
PluginAssistantEric.zip | file | annotate | diff | comparison | revisions |
--- a/AssistantEric/Assistant.py Sat Dec 03 18:08:44 2016 +0100 +++ b/AssistantEric/Assistant.py Sun Dec 18 14:09:26 2016 +0100 @@ -311,7 +311,7 @@ line, col = editor.getCursorPosition() self.__completingContext = context sep = "" - if context: + if language and context: wc = re.sub("\w", "", editor.wordCharacters()) pat = re.compile("\w{0}".format(re.escape(wc))) text = editor.text(line) @@ -361,13 +361,16 @@ else: beg = editor.text(line)[:col] col = len(beg) - wsep = editor.getLexer().autoCompletionWordSeparators() - if wsep: - wsep.append(" ") - if col > 0 and beg[col - 1] in wsep: + if language: + wseps = editor.getLexer().autoCompletionWordSeparators() + else: + wseps = [] + if wseps: + wseps.append(" ") + if col > 0 and beg[col - 1] in wseps: col -= 1 else: - while col > 0 and beg[col - 1] not in wsep: + while col > 0 and beg[col - 1] not in wseps: col -= 1 if col > 0 and beg[col - 1] != " ": col -= 1 @@ -399,8 +402,8 @@ importCompletion = True prefix = tokens[1] col = len(prefix) - 1 - wsep = editor.getLexer().autoCompletionWordSeparators() - while col >= 0 and prefix[col] not in wsep: + wseps = editor.getLexer().autoCompletionWordSeparators() + while col >= 0 and prefix[col] not in wseps: col -= 1 if col >= 0: prefix = prefix[col + 1:] @@ -808,12 +811,15 @@ mod = None beg = editor.text(line)[:col] col = len(beg) - wsep = editor.getLexer().autoCompletionWordSeparators() - if wsep: - if col > 0 and beg[col - 1] in wsep: + if language: + wseps = editor.getLexer().autoCompletionWordSeparators() + else: + wseps = [] + if wseps: + if col > 0 and beg[col - 1] in wseps: col -= 1 else: - while col > 0 and beg[col - 1] not in wsep + [" ", "\t"]: + while col > 0 and beg[col - 1] not in wseps + [" ", "\t"]: col -= 1 if col >= 0: col -= 1 @@ -902,7 +908,7 @@ @return list of calltips (list of string) """ calltips = [] - if module: + if module and bool(editor.getLexer()): if prefix: # prefix can be 'self', 'cls' or a class name sep = editor.getLexer().autoCompletionWordSeparators()[0]
--- a/ChangeLog Sat Dec 03 18:08:44 2016 +0100 +++ b/ChangeLog Sun Dec 18 14:09:26 2016 +0100 @@ -1,5 +1,8 @@ ChangeLog --------- +Version 3.2.1: +- bug fixes + Version 3.2.0: - bug fixes - added support for project type specific API configurations
--- a/PluginAssistantEric.py Sat Dec 03 18:08:44 2016 +0100 +++ b/PluginAssistantEric.py Sun Dec 18 14:09:26 2016 +0100 @@ -24,7 +24,7 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "3.2.0" +version = "3.2.1" className = "AssistantEricPlugin" packageName = "AssistantEric" shortDescription = "Alternative autocompletion and calltips provider."