Continue mouse context refactor
This commit is contained in:
@@ -273,16 +273,17 @@ commandFutureLines s tm w = fromMaybe [errline "^ Invalid command"] $ do
|
||||
where
|
||||
errline = makeColorTermLine red
|
||||
|
||||
terminalReturnEffect :: Terminal -> World -> World
|
||||
terminalReturnEffect tm w = fromMaybe w $ do
|
||||
terminalReturnEffect :: Int -> World -> World
|
||||
terminalReturnEffect tmid w = fromMaybe w $ do
|
||||
tm <- w ^? cWorld . lWorld . terminals. ix tmid
|
||||
guard $ _tmStatus tm == TerminalReady
|
||||
s <- w ^? cWorld . lWorld . terminals . ix (_tmID tm) . tmInput . tiText
|
||||
s <- tm ^? tmInput . tiText
|
||||
let pc = maybe "" (++ " ") $ tm ^? tmPartialCommand . _Just . tcString
|
||||
return $
|
||||
runTerminalString (pc ++ s) tm $
|
||||
w
|
||||
& cWorld . lWorld . terminals . ix (_tmID tm) . tmPartialCommand .~ Nothing
|
||||
& cWorld . lWorld . terminals . ix (_tmID tm) . tmFutureLines
|
||||
& cWorld . lWorld . terminals . ix tmid . tmPartialCommand .~ Nothing
|
||||
& cWorld . lWorld . terminals . ix tmid . tmFutureLines
|
||||
.~ [makeTermLine (pc ++ getPromptTM (tm ^. tmType) ++ s)]
|
||||
|
||||
runTerminalString :: String -> Terminal -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user