Skip to content

Commit

Permalink
Extend example for disable/enable line wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilgrem committed Nov 13, 2024
1 parent 2ac232f commit f99c78d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ansi-terminal/app/Example.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ examples = [ cursorMovementExample
, setCursorPositionExample
, saveRestoreCursorExample
, clearExample
, lineWrapExample
, scrollExample
, screenBuffersExample
, sgrColorExample
Expand Down Expand Up @@ -206,6 +207,24 @@ clearExample = do
pause
--

lineWrapExample :: IO ()
lineWrapExample = do
putStrLn $ take 240 $ cycle "Default-line-wrap|"
pause
-- Default-line-wrap|Default-line-wrap|Default-line-wrap|Default-line-wrap|Def
-- ault-line-wrap|Default-line-wrap|Default-line-wrap|Default-line-wrap|Defaul
-- t-line-wrap|Default-line-wrap|Default-line-wrap|Default-line-wrap|Default-l
disableLineWrap
putStrLn $ take 240 $ cycle "Disable-line-wrap|"
pause
-- Disable-line-wrap|Disable-line-wrap|Disable-line-wrap|Disable-line-wrap|Dis
enableLineWrap
putStrLn $ take 240 $ cycle "Enable-line-wrap|"
pause
-- Enable-line-wrap|Enable-line-wrap|Enable-line-wrap|Enable-line-wrap|Enable-
-- line-wrap|Enable-line-wrap|Enable-line-wrap|Enable-line-wrap|Enable-line-wr
-- ap|Enable-line-wrap|Enable-line-wrap|Enable-line-wrap|Enable-line-wrap|Enab

scrollExample :: IO ()
scrollExample = do
putStrLn "Line One"
Expand Down

0 comments on commit f99c78d

Please sign in to comment.