4823 if listId == EditorAutoCompletionListID: |
4823 if listId == EditorAutoCompletionListID: |
4824 lst = txt.split() |
4824 lst = txt.split() |
4825 if len(lst) > 1: |
4825 if len(lst) > 1: |
4826 txt = lst[0] |
4826 txt = lst[0] |
4827 |
4827 |
|
4828 self.beginUndoAction() |
4828 if Preferences.getEditor("AutoCompletionReplaceWord"): |
4829 if Preferences.getEditor("AutoCompletionReplaceWord"): |
4829 self.selectCurrentWord() |
4830 self.selectCurrentWord() |
4830 self.removeSelectedText() |
4831 self.removeSelectedText() |
4831 line, col = self.getCursorPosition() |
4832 line, col = self.getCursorPosition() |
4832 else: |
4833 else: |
4837 self.removeSelectedText() |
4838 self.removeSelectedText() |
4838 line, col = self.getCursorPosition() |
4839 line, col = self.getCursorPosition() |
4839 elif wLeft: |
4840 elif wLeft: |
4840 txt = txt[len(wLeft):] |
4841 txt = txt[len(wLeft):] |
4841 self.insert(txt) |
4842 self.insert(txt) |
|
4843 self.endUndoAction() |
4842 self.setCursorPosition(line, col + len(txt)) |
4844 self.setCursorPosition(line, col + len(txt)) |
4843 elif listId == TemplateCompletionListID: |
4845 elif listId == TemplateCompletionListID: |
4844 self.__applyTemplate(txt, self.getLanguage()) |
4846 self.__applyTemplate(txt, self.getLanguage()) |
4845 |
4847 |
4846 def canProvideDynamicAutoCompletion(self): |
4848 def canProvideDynamicAutoCompletion(self): |