Partial rethink of terminal text input

This commit is contained in:
2025-08-14 21:48:02 +01:00
parent 5b720cb82c
commit 91d19e7c42
12 changed files with 142 additions and 167 deletions
+1 -1
View File
@@ -383,7 +383,7 @@ updateKeysInTerminal :: Int -> Universe -> Universe
updateKeysInTerminal tmid u =
u
& doTextInputOverUniverse
(uvWorld . cWorld . lWorld . terminals . ix tmid . tmInput . tiText)
(uvWorld . cWorld . lWorld . terminals . ix tmid . tmStatus . tiText)
& checkEndStatus
where
checkEndStatus
+3 -3
View File
@@ -124,9 +124,9 @@ moveCombineSel yi =
terminalWheelEvent :: Int -> Int -> World -> World
terminalWheelEvent yi tmid w
| w & has (input . mouseButtons . ix ButtonRight)
, Just TerminalReady <- w ^? cWorld . lWorld . terminals . ix tmid . tmStatus =
, Just TerminalTextInput{} <- w ^? cWorld . lWorld . terminals . ix tmid . tmStatus =
w & cWorld . lWorld . terminals . ix tmid %~ updatetermsubsel
| Just TerminalReady <- w ^? cWorld . lWorld . terminals . ix tmid . tmStatus =
| Just TerminalTextInput{} <- w ^? cWorld . lWorld . terminals . ix tmid . tmStatus =
w & cWorld . lWorld . terminals . ix tmid %~ updatetermsel
| otherwise = w
where
@@ -143,7 +143,7 @@ terminalWheelEvent yi tmid w
setInput i j tm =
tm
& tmInput . tiSel .~ (i, j)
& tmInput . tiText .~ comstr ++ arg
& tmStatus . tiText .~ comstr ++ arg
where
comstr = scrollCommandStrings w tm !! i
tc = scrollCommands tm !! i