RefactoringRope/Refactoring.py

changeset 103
2d77b3afc98f
parent 94
03d6a17c66ac
child 106
b2b2107b8047
equal deleted inserted replaced
102:61f698ad9ec5 103:2d77b3afc98f
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 offset = editor.positionFromLineIndex(line, index) 941 source = self.__editor.text()
942 offset = len("".join(source.splitlines(True)[:line])) + index
942 if editor.eolMode() == QsciScintilla.EolWindows: 943 if editor.eolMode() == QsciScintilla.EolWindows:
943 offset -= line 944 offset -= line
944 return offset 945 return offset
945 946
946 ################################################################## 947 ##################################################################

eric ide

mercurial