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 ################################################################## |