-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Count of currently visible lines in current Editor #588
Comments
I'm not aware of such an API sorry we should add it to the backlog. |
From @jrieken on November 3, 2015 11:31 @jsturtevant Just that we get a better understanding of the requirement, what would you use such an API for? |
My extension is only interested in the text that is currently visible in the editor. If it is not visible I do not need to work with those lines. At a basic level, Given user input I am highlighting anything that is visible inside the current editor that matches the request, if is not visible I do not need to highlight it. I think there are many ways to meet the requirement, not only through line count. Let me know if you need/want more clarification. |
Yeah, is it for performance reasons that you want that? You can use the decorations api for highlighting parts of the editor content and you wrt perf shouldn't need to care if the lines are visible or not |
Not for performance reasons. I am providing shortcuts to jump around the visible screen. If the text is not on the screen then numbering would be off, which is not a huge deal if there isn't a way to determine the text is visible but would be ideal to not skip letter. Here is a screen shot from my extension in Visual Studio |
Skip |
@jrieken I'm also looking for the ability to determine the current visible lines in the current editor. And yes, for performance reasons, as I want to do a text search only over these lines. Searching the entire document in the text editor would be unnecessary and potentially bad for performance, especially if the document is large. |
Sorry, no update yet. @alexandrudima would be the man to talk to. We haven't made decision how to forward with this request |
Ok, thanks @jrieken. @alexandrudima, it'd be awesome if you could keep this issue updated on the possibility of this feature. |
This iteration we focus on issue grooming. This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider. If you wonder what we are up to, please see our roadmap and issue reporting guidelines. Thanks for your understanding and happy coding! |
From @jsturtevant on October 26, 2015 23:25
Is there an API or way to detect which lines are visible in the current editor?
In a large file if i use
I get all the count of all the lines in the document but I my case I need to restrict my search to only the current visible lines. In the example below I would get a count of 35 lines although the file is 90+.
Copied from original issue: Microsoft/vscode-extensionbuilders#63
The text was updated successfully, but these errors were encountered: