question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ScrollToEnd does not scroll to end when using WordWrap

See original GitHub issue

My AvalonEdit has to show the content of a log file. Changes to the log file will be attached automatically with AppendText(). Afterwards the editor should scroll to the end of the document. But it does not. A few lines (the ones after the selected one) are (almost) always missing. See screenshot: Untitled

XAML:

<avalonEdit:TextEditor xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
  Grid.Row="0"
  Name="LogBox"
  FontFamily="Consolas"
  FontSize="9pt"
  HorizontalScrollBarVisibility="Hidden"
  VerticalScrollBarVisibility="Visible"
  />

Some code:

LogBox.Document.UndoStack.SizeLimit = 0;
LogBox.Options.EnableRectangularSelection = true;
LogBox.Options.EnableVirtualSpace = true;
LogBox.Options.HighlightCurrentLine = true;
LogBox.TextArea.TextView.LineTransformers.Clear();
LogBox.TextArea.TextView.LineTransformers.Add(new CustomDocumentColorizingTransformer());
LogBox.IsReadOnly = true;
LogBox.WordWrap = true;
SearchPanel.Install(LogBox);

LogBox.ScrollToEnd();

I’ve also tried ScrollToLine() and ScrollToVerticalOffset() but the result stays the same.

The only thing which solves my issue (but is not an option for me) is to set WordWrap to false.

Any suggestions?

Best regards, Carsten

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
goswinrcommented, May 18, 2020

I solved it by calling ScrollToEnd twice.

1reaction
dbCFcommented, Apr 29, 2020

Doesn’t work for me. Or let’s say: It does not work if there are wrapped lines in the view. If there are only “not wrapped” lines in the view, everything’s fine.

I just saw the the search has the same issue: The found result may be out of the view if there are wrapped lines in the view. So you have to scroll a view lines to see the result.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ScrollToEnd after update data for Flatlist - react native
I want to add a new item to data then scroll to bottom of list. I use scrollToEnd method but it did not...
Read more >
Successfully using scrollToEnd() in chat app, but how to ...
So the end solution is to remove the ScrollView and the ScrollToEnd() function and just have a FlatList that is inverted. Thanks again...
Read more >
Window scrollTo() Method
Scroll the document to the horizontal position 500: window. ... Description. The scrollTo() method scrolls the document to specified coordinates.
Read more >
Flatlist scrollToEnd janky when streaming new content into ...
I am looking to solve this so I can successfully keep the flatlist scrolling to the bottom as new content is streamed in....
Read more >
Scroll to last line - EditorGadget - PureBasic Forums - English
My application has a large EditorGadget on its main window that reports all inputs/outputs with the embedded device it connects to.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found