doCommand :: Buffer b => Command -> Editor b ()
doCommand View = do
  cur  <- getCurLine
  let ls = [(cur - 2) .. (cur + 2)]
  ss <- mapM (\l -> onBuffer $ line l) ls
  zipWithM_ (showL cur) ls ss
 where
  showL _ _ Nothing  = return ()
  showL l n (Just s) = io $ putStrLn (m ++ show n ++ ": " ++ s)
    where m | n == l    = "*"
            | otherwise = " "
doCommand :: Buffer b => Command -> Editor b ()
doCommand View = do
  cur  <- getCurLine
  let ls = [(cur - 2) .. (cur + 2)]
  ss <- mapM (\l -> onBuffer $ line l) ls
  zipWithM_ (showL cur) ls ss
 where
  showL _ _ Nothing  = return ()
  showL l n (Just s) = io $ putStrLn (m ++ show n ++ ": " ++ s)
    where m | n == l    = "*"
            | otherwise = " "
doCommand View = do
  cur  <- getCurLine
  let ls = [(cur - 2) .. (cur + 2)]
  ss <- mapM (\l -> onBuffer $ line l) ls
  zipWithM_ (showL cur) ls ss
 where
  showL _ _ Nothing  = return ()
  showL l n (Just s) = io $ putStrLn (m ++ show n ++ ": " ++ s)
    where m | n == l    = "*"
            | otherwise = " "