QScintilla/Shell.py

changeset 5020
d0afdfd8e45b
parent 4631
5c1a96925da4
child 5108
f5cb9cb98e6a
equal deleted inserted replaced
5015:ca1d44f0f6b2 5020:d0afdfd8e45b
22 from E5Gui import E5MessageBox 22 from E5Gui import E5MessageBox
23 23
24 from .QsciScintillaCompat import QsciScintillaCompat 24 from .QsciScintillaCompat import QsciScintillaCompat
25 25
26 import Preferences 26 import Preferences
27
28 import Utilities
27 29
28 import UI.PixmapCache 30 import UI.PixmapCache
29 31
30 from Debugger.DebugClientCapabilities import HasCompleter 32 from Debugger.DebugClientCapabilities import HasCompleter
31 33
763 765
764 @param s text to be displayed (string) 766 @param s text to be displayed (string)
765 """ 767 """
766 line, col = self.__getEndPos() 768 line, col = self.__getEndPos()
767 self.setCursorPosition(line, col) 769 self.setCursorPosition(line, col)
768 self.insert(s) 770 self.insert(Utilities.filterAnsiSequences(s))
769 self.prline, self.prcol = self.getCursorPosition() 771 self.prline, self.prcol = self.getCursorPosition()
770 self.ensureCursorVisible() 772 self.ensureCursorVisible()
771 self.ensureLineVisible(self.prline) 773 self.ensureLineVisible(self.prline)
772 774
773 def __writeStdOut(self, s): 775 def __writeStdOut(self, s):
895 Private method to insert some text at the current cursor position. 897 Private method to insert some text at the current cursor position.
896 898
897 @param s text to be inserted (string) 899 @param s text to be inserted (string)
898 """ 900 """
899 line, col = self.getCursorPosition() 901 line, col = self.getCursorPosition()
900 self.insertAt(s, line, col) 902 self.insertAt(Utilities.filterAnsiSequences(s), line, col)
901 self.setCursorPosition(line, col + len(s)) 903 self.setCursorPosition(line, col + len(s))
902 904
903 def __insertTextAtEnd(self, s): 905 def __insertTextAtEnd(self, s):
904 """ 906 """
905 Private method to insert some text at the end of the command line. 907 Private method to insert some text at the end of the command line.
906 908
907 @param s text to be inserted (string) 909 @param s text to be inserted (string)
908 """ 910 """
909 line, col = self.__getEndPos() 911 line, col = self.__getEndPos()
910 self.setCursorPosition(line, col) 912 self.setCursorPosition(line, col)
911 self.insert(s) 913 self.insert(Utilities.filterAnsiSequences(s))
912 self.prline, _ = self.getCursorPosition() 914 self.prline, _ = self.getCursorPosition()
913 915
914 def __insertTextNoEcho(self, s): 916 def __insertTextNoEcho(self, s):
915 """ 917 """
916 Private method to insert some text at the end of the buffer without 918 Private method to insert some text at the end of the buffer without
1740 1742
1741 The cursor is advanced to the end of the inserted text. 1743 The cursor is advanced to the end of the inserted text.
1742 1744
1743 @param txt text to be inserted (string) 1745 @param txt text to be inserted (string)
1744 """ 1746 """
1747 txt = Utilities.filterAnsiSequences(txt)
1745 length = len(txt) 1748 length = len(txt)
1746 line, col = self.getCursorPosition() 1749 line, col = self.getCursorPosition()
1747 self.insertAt(txt, line, col) 1750 self.insertAt(txt, line, col)
1748 if re.search(self.linesepRegExp, txt) is not None: 1751 if re.search(self.linesepRegExp, txt) is not None:
1749 line += 1 1752 line += 1

eric ide

mercurial