Fix terminal scrolling
This commit is contained in:
+12
-11
@@ -131,19 +131,20 @@ terminalWheelEvent yi tmid w
|
||||
-- | w & has (input . mouseButtons . ix ButtonRight)
|
||||
-- , Just TerminalTextInput{} <- w ^? cWorld . lWorld . terminals . ix tmid . tmStatus =
|
||||
-- w & cWorld . lWorld . terminals . ix tmid %~ f
|
||||
-- | Just TerminalTextInput{} <- w ^? cWorld . lWorld . terminals . ix tmid . tmStatus =
|
||||
-- w & cWorld . lWorld . terminals . ix tmid %~ f
|
||||
| Just TerminalTextInput{} <- w ^? cWorld . lWorld . terminals . ix tmid . tmStatus =
|
||||
w & cWorld . lWorld . terminals . ix tmid %~ f
|
||||
| otherwise = w
|
||||
where
|
||||
-- dowrap = if yi > 0 then wrapup else wrapdown
|
||||
-- wrapup s coms = recComFindSuccessor (words s) coms <|> recComFindMin coms
|
||||
-- wrapdown s coms = recComFindPredecessor (words s) coms <|> recComFindMax coms
|
||||
-- f tm = fromMaybe tm $ do
|
||||
-- let coms = getCommands w tm
|
||||
-- x <- tm ^? tmStatus . tiText
|
||||
-- let s = fromMaybe "" $ x ^? to words . ix 0
|
||||
-- (s', _) <- dowrap s coms
|
||||
-- return $ tm & tmStatus . tiText .~ unwords s'
|
||||
dowrap = if yi > 0 then wrapup else wrapdown
|
||||
wrapup s coms = recComFindSuccessor (words s) coms -- <|> recComFindMin coms
|
||||
wrapdown s coms = recComFindPredecessor (words s) coms -- <|> recComFindMax coms
|
||||
f tm = fromMaybe tm $ do
|
||||
let coms = getCommands w tm
|
||||
x <- tm ^? tmStatus . tiText
|
||||
let s = fromMaybe "" $ x ^? to words . ix 0
|
||||
--(s', _) <- dowrap s coms
|
||||
(s', _) <- dowrap x coms
|
||||
return $ tm & tmStatus . tiText .~ unwords s'
|
||||
---- g tm = fromMaybe tm $ do
|
||||
---- let coms = getCommands w tm
|
||||
---- x <- tm ^? tmStatus . tiText
|
||||
|
||||
Reference in New Issue
Block a user