You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val selectedLine by viewModel.selectedLine.collectAsState()
26
+
val content by viewModel.content.collectAsState()
27
+
// subtraction of one is necessary, because there is a line with a cursor at the bottom, which moves up all the content
28
+
val height = terminal.size.height -1
29
+
var offset by remember { mutableIntStateOf(0) }
30
+
LaunchedEffect(selectedLine.first) {
31
+
if (selectedLine.first < offset) {
32
+
offset -=1
33
+
}
34
+
}
35
+
LaunchedEffect(selectedLine.last) {
36
+
if (selectedLine.last > offset + height -1) {
37
+
offset +=1
38
+
}
39
+
}
40
+
22
41
Box(
23
42
Modifier
24
43
.width(terminal.size.width)
25
-
.height(terminal.size.height-1) // subtraction of one is necessary, because there is a line with a cursor at the bottom, which moves up all the content
0 commit comments