RefactoringRope/Refactoring.py

changeset 116
50cb62506ab2
parent 106
b2b2107b8047
child 121
5d1648fd695b
equal deleted inserted replaced
115:60f4a90927e6 116:50cb62506ab2
936 @param editor reference to the editor (Editor) 936 @param editor reference to the editor (Editor)
937 @param line line for the offset (integer) 937 @param line line for the offset (integer)
938 @param index index into line for the offset (integer) 938 @param index index into line for the offset (integer)
939 @return rope compliant offset into the file (integer) 939 @return rope compliant offset into the file (integer)
940 """ 940 """
941 source = self.__editor.text() 941 source = editor.text()
942 offset = len("".join(source.splitlines(True)[:line])) + index 942 offset = len("".join(source.splitlines(True)[:line])) + index
943 if editor.eolMode() == QsciScintilla.EolWindows: 943 if editor.eolMode() == QsciScintilla.EolWindows:
944 offset -= line 944 offset -= line
945 return offset 945 return offset
946 946

eric ide

mercurial