
Hi,
I need an event when scrolling vertically to get the visible lines.
I want to create something with 2 editors (left and right) like a diff viewer. Something like winMerge.
Kind regards,
Daniel
Hi,
I need an event when scrolling vertically to get the visible lines.
I want to create something with 2 editors (left and right) like a diff viewer. Something like winMerge.
Kind regards,
Daniel
Hi Daniel,
The IEditorView.TextAreaLayout event fires any time a layout occurs, which could be due to scrolling, editor resizing, zooming, or just changes in the document that require a repaint. You should be able to listen to that event to keep your side-by-side views in sync.
You can find details about the available data exposed by the event here:
Please let us know if you are unable to achieve what you need based on that event.
Hi,
That event is what I need.
Also, is there a way to set the FirstVisiblePosition? If I scroll on the left editor and I know which is the FirstVisiblePosition, I also want to set that somehow on the right editor.
Kind regards,
Daniel
Hi,
I have a solution but this is not behaving like I would want because I need the caret to stay where it is when scrolling.
Now I am setting the CaretPosition and then I scroll the line to visible top.
ActiveView.Selection.CaretPosition = new TextPosition(firstVisibleLine, 0);
ActiveView.Scroller.ScrollLineToVisibleTop();
Kind regards,
Daniel
Hi Daniel,
The editor.ActiveView.ScrollState property returns a TextViewScrollState object that has all the information about how the view's scroll state is anchored and positioned.
You can call editor.ActiveView.Scroller.ScrollTo(scrollState) to set a TextViewScrollState on another view.
The Scrolling documentation topic covers these APIs if you want to reference that.
Please log in to a validated account to post comments.