Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vscode extension API - how to get only visible lines of editor

I've searched the documentation but I could find nothing.

is there a way to get only the "visible" text of the document in the editor (so, I don't want to get the text / lines of hidden text by scrollbar)?

Thanks guys!

like image 718
Luca Trazzi Avatar asked Mar 10 '23 18:03

Luca Trazzi


2 Answers

It's now possible via TextEditor.visibleRanges

https://github.com/Microsoft/vscode/issues/14756

like image 190
Red Riding Hood Avatar answered Mar 13 '23 12:03

Red Riding Hood


This is not possible with the current API.

You can make a feature request by creating an issue here: https://github.com/microsoft/vscode/issues

like image 36
Llewey Avatar answered Mar 13 '23 13:03

Llewey