Skip to content
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

Closed
seanmcbreen opened this issue Nov 24, 2015 · 12 comments
Closed

Count of currently visible lines in current Editor #588

seanmcbreen opened this issue Nov 24, 2015 · 12 comments
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@seanmcbreen
Copy link

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

let count = doc.getLineCount();

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+.

image

Copied from original issue: Microsoft/vscode-extensionbuilders#63

@seanmcbreen
Copy link
Author

I'm not aware of such an API sorry we should add it to the backlog.

@seanmcbreen
Copy link
Author

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?

@egamma egamma added feature-request Request for new features or functionality api and removed enhancement labels Nov 24, 2015
@jsturtevant
Copy link

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.

@jrieken
Copy link
Member

jrieken commented Dec 3, 2015

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

@egamma egamma modified the milestone: Backlog Dec 10, 2015
@jsturtevant
Copy link

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

image

@rnordin100
Copy link

Skip

@wmaurer
Copy link

wmaurer commented Oct 4, 2016

@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.

@wmaurer
Copy link

wmaurer commented Oct 11, 2016

@jrieken further info, this feature would be specifically useful for my Jumpy extension, where I have to hard code (or provide as a user setting) how many lines back and forward from the current cursor position to search.

@jrieken
Copy link
Member

jrieken commented Oct 11, 2016

Sorry, no update yet. @alexandrudima would be the man to talk to. We haven't made decision how to forward with this request

@wmaurer
Copy link

wmaurer commented Oct 11, 2016

Ok, thanks @jrieken. @alexandrudima, it'd be awesome if you could keep this issue updated on the possibility of this feature.

@mjbvz mjbvz added the *out-of-scope Posted issue is not in scope of VS Code label Sep 20, 2018
@vscodebot
Copy link

vscodebot bot commented Sep 20, 2018

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!

@vscodebot vscodebot bot closed this as completed Sep 20, 2018
@CoenraadS
Copy link
Contributor

#14756 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

8 participants