Calling caret.getSelectionEndPosition().getLine() for lines wrapped by soft wrap return wrong values. In my case, a very long document consisting of two lines is soft wrapped. The caret position will return 31 afterwards - which is utterly wrong.
Is there any other API function I can use to get the correct line or is this a bug?
Tested with IU-141.498.1 on both Ubuntu 14.04 and Windows 7 (on multiple computers).
Also referenced in https://intellij-support.jetbrains.com/requests/58008