@@ -5,8 +5,9 @@ import androidx.compose.runtime.getValue
55import androidx.compose.runtime.mutableIntStateOf
66import androidx.compose.runtime.remember
77import androidx.compose.runtime.setValue
8- import com.jakewharton.mosaic.LocalTerminal
8+ import com.jakewharton.mosaic.LocalTerminalState
99import com.jakewharton.mosaic.layout.background
10+ import com.jakewharton.mosaic.layout.fillMaxSize
1011import com.jakewharton.mosaic.layout.fillMaxWidth
1112import com.jakewharton.mosaic.layout.height
1213import com.jakewharton.mosaic.layout.onKeyEvent
@@ -21,11 +22,11 @@ import com.jakewharton.mosaic.ui.TextStyle
2122
2223@Composable
2324fun App (viewModel : ViewModel ) {
24- val terminal = LocalTerminal .current
25+ val terminal = LocalTerminalState .current
2526 val selectedLine by viewModel.selectedLine.collectAsState()
2627 val content by viewModel.content.collectAsState()
2728 // 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+ val height = terminal.size.rows - 1
2930 var offset by remember { mutableIntStateOf(0 ) }
3031 LaunchedEffect (selectedLine.first) {
3132 if (selectedLine.first < offset) {
@@ -40,7 +41,7 @@ fun App(viewModel: ViewModel) {
4041
4142 Box (
4243 Modifier
43- .width(terminal.size.width )
44+ .width(terminal.size.columns )
4445 .height(height)
4546 .onKeyEvent { event -> viewModel.onKeyEvent(event) }
4647 ) {
0 commit comments