Skip to content

Commit

Permalink
Draft cursor ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
NorseDreki committed Feb 13, 2024
1 parent 149b3b6 commit bd0d306
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/nativeMain/kotlin/ui/AppView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class AppView {
exit(1)
}

//idlok¶

use_default_colors()
start_color()
init_pair(1, COLOR_RED.toShort(), -1)
Expand Down
2 changes: 2 additions & 0 deletions src/nativeMain/kotlin/ui/logLines/LogLineExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ suspend fun LogLinesView.processLogLine(
refresh()
}



yield()
}

Expand Down
3 changes: 2 additions & 1 deletion src/nativeMain/kotlin/ui/logLines/LogLinesView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class LogLinesView {
scrollok(pad, true)

//does it even work?
//leaveok(pad, true);
// leaveok(pad, true);


//WINDOW * win1 = newwin(10, 40, 0, 0)
//WINDOW * win2 = newwin(10, 40, 0, 40)
Expand Down
20 changes: 20 additions & 0 deletions src/nativeMain/kotlin/ui/status/StatusView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import logger.Logger
import logger.context
import ncurses.*
import ui.ViewPosition
import kotlin.coroutines.coroutineContext

data class ViewState(
val filters: AppliedFilters,
Expand Down Expand Up @@ -40,6 +41,9 @@ class StatusView {

val bytePtr = allocArray<ByteVar>(200)
echo()

leaveok(window, true);

//mvwprintw(window, 1, filterLength, "")
// Print the prompt

Expand All @@ -48,12 +52,28 @@ class StatusView {
mvwprintw(window, 1, 0, prompt)
wmove(window, 1, prompt.length)

val x = getcurx(stdscr)
val y = getcury(stdscr)

Logger.d("($x, ${getbegy(window)}}")

val j = CoroutineScope(coroutineContext).launch {
while (isActive) {
delay(10)
wmove(stdscr, 49 , 0)
wrefresh(stdscr)
//Logger.d("moved (${getcurx(window)}, ${getcury(window)})")
}
}

withContext(Dispatchers.IO) {
//wgetch(window)
wgetnstr(window, bytePtr, 200)
//readLine() ?: "zzzz"
}

j.cancel()

Logger.d("????????????????????? ${bytePtr.toKString()}")

noecho()
Expand Down

0 comments on commit bd0d306

Please sign in to comment.