Get text from visible area in document of my editor intellij ide


How to  get text from the from the visible area in the current open document in intellij. Suppose current caret is at 18th line and last line that is visible is  56th line in the doc(though the doc has 100 lines) , all the contents show get selected. I tried using editor. Getscrollingmodel(). Getvisiblearea() But it return rectangle but I need  textRangetextRange

1 comment


Please check com.intellij.openapi.editor.Editor#calculateVisibleRange.


Please sign in to leave a comment.