c# - Get the current document viewport in Visual Studio -


i writing vspackage. need text current document in visual studio, edit text , write current open document.

when this, current viewport of document jumps top of document:

example let's you're working on document contains 2000 lines of code, , in visual studio code editor see line numbers 500 550. , cursor @ line 700.

after processing document text, want user see same line numbers in code editor , want cursor stay was.

i found solutions moving cursor, however, still couldn't find how get , set current view port on active document.

enter image description here

https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.text.editor.iviewscroller(v=vs.120).aspx

use iviewscroller. has methods keep desired span in view, want, or scroll specified number of lines. instance viewscroller property of text view object.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -