-
Notifications
You must be signed in to change notification settings - Fork 688
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
Bug when using ScrollTo()
method
#1876
Comments
You have to test with the current main branch because it's the same bug that was fixed by the #1866 already merged. |
I was waiting for a library update on NuGet to be able to test, will it take a long time to come out? |
I recommend to you to have two projects, one using the NuGet package and another using the gui.cs repo. Only this way you can really test if the fixes is working. Waiting for a update package sometimes it take to long time. |
Okay, thanks, I'll do that, if it works, I'll close this issue. |
Yes, it solved, but is there any way to move the cursor to the line I scrolled? I can't do that, the cursor is always on the same line, I've tried using the Move method but I haven't had success. |
Set the cursor position to the column and row you want. |
I already do that, but it doesn't work, I use the |
I forgot to mention, even inverting the operations, which in this case would be, putting the |
Any update on this bug? In case what I said was not clear, I can record a gif, or anything else |
I haven't see it yet. |
This unit test proves that the [Fact]
[AutoInitShutdown]
public void MoveDown_By_Setting_CursorPosition ()
{
var tv = new TextView {
Width = 10,
Height = 5
};
// add 100 lines of wide text to view
for (int i = 0; i < 100; i++)
tv.Text += new string ('x', 100) + (i == 99 ? "" : Environment.NewLine);
Assert.Equal (new Point (0, 0), tv.CursorPosition);
tv.CursorPosition = new Point (5, 50);
Assert.Equal (new Point (5, 50), tv.CursorPosition);
tv.CursorPosition = new Point (200, 200);
Assert.Equal (new Point (100, 99), tv.CursorPosition);
}
[Fact]
[AutoInitShutdown]
public void ScrollTo_CursorPosition ()
{
var tv = new TextView {
Width = 10,
Height = 5
};
// add 100 lines of wide text to view
for (int i = 0; i < 100; i++)
tv.Text += new string ('x', 100) + (i == 99 ? "" : Environment.NewLine);
Assert.Equal (new Point (0, 0), tv.CursorPosition);
tv.ScrollTo (50);
Assert.Equal (new Point (0, 0), tv.CursorPosition);
tv.CursorPosition = new Point (tv.LeftColumn, tv.TopRow);
Assert.Equal (new Point (0, 50), tv.CursorPosition);
} |
This method is normally used by the |
Now I understand, thank you. |
Describe the bug
A bit similar to the #1866 I had previously opened.
In this case, when the
ScrollTo
method runs for a few lines down and you try to type something, an error is thrown.To Reproduce
Steps to reproduce the behavior:
In the screenshots
Expected behavior
Perhaps in this case, it would be correct for the cursor to go to the line that was defined in the parameter of the
ScrollTo()
methodScreenshots
Before:
After pressing the
Ctrl
+CursorDown
key, which I put as binding in the code next to the console:I try to type anything and boom:
The text was updated successfully, but these errors were encountered: