QScintilla/Editor.py

changeset 2994
5ae1349b8fb4
parent 2980
2cb4e3c50b37
child 3011
18292228c724
equal deleted inserted replaced
2993:4933ac9daa80 2994:5ae1349b8fb4
4777 line0Text = self.text(curLine) 4777 line0Text = self.text(curLine)
4778 line1Text = self.text(curLine + 1) 4778 line1Text = self.text(curLine + 1)
4779 if line1Text in ["", "\r", "\n", "\r\n"]: 4779 if line1Text in ["", "\r", "\n", "\r\n"]:
4780 return 4780 return
4781 4781
4782 if line0Text.rstrip("\r\n\\ \t").endswith(("'", '"')) and \
4783 line1Text.lstrip().startswith(("'", '"')):
4784 # merging multi line strings
4785 startChars = "\r\n\\ \t'\""
4786 endChars = " \t'\""
4787 else:
4788 startChars = "\r\n\\ \t"
4789 endChars = " \t"
4790
4782 # determine start index 4791 # determine start index
4783 startIndex = len(line0Text) 4792 startIndex = len(line0Text)
4784 while startIndex > 0 and line0Text[startIndex - 1] in "\r\n\\ \t": 4793 while startIndex > 0 and line0Text[startIndex - 1] in startChars:
4785 startIndex -= 1 4794 startIndex -= 1
4786 if startIndex == 0: 4795 if startIndex == 0:
4787 return 4796 return
4788 4797
4789 # determine end index 4798 # determine end index
4790 endIndex = 0 4799 endIndex = 0
4791 while line1Text[endIndex] in " \t": 4800 while line1Text[endIndex] in endChars:
4792 endIndex += 1 4801 endIndex += 1
4793 4802
4794 self.setSelection(curLine, startIndex, curLine + 1, endIndex) 4803 self.setSelection(curLine, startIndex, curLine + 1, endIndex)
4795 self.beginUndoAction() 4804 self.beginUndoAction()
4796 self.removeSelectedText() 4805 self.removeSelectedText()

eric ide

mercurial