Fix horizontal scrolling in the ListView.

This commit is contained in:
BDisp
2024-04-11 17:44:16 +01:00
parent f1bc42aaa5
commit 36469b7298

View File

@@ -912,7 +912,7 @@ public class ListWrapper : IListDataSource
int start = 0
)
{
container.Move (col, line);
container.Move (Math.Max (col - start, 0), line);
object t = _source? [item];
if (t is null)
@@ -1028,7 +1028,8 @@ public class ListWrapper : IListDataSource
private void RenderUstr (ConsoleDriver driver, string ustr, int col, int line, int width, int start = 0)
{
string u = TextFormatter.ClipAndJustify (ustr, width, TextAlignment.Left);
string str = start > ustr.GetColumns () ? string.Empty : ustr.Substring (Math.Min (start, ustr.ToRunes ().Length - 1));
string u = TextFormatter.ClipAndJustify (str, width, TextAlignment.Left);
driver.AddStr (u);
width -= u.GetColumns ();