Skip to content

Commit

Permalink
Remove trailing tabs
Browse files Browse the repository at this point in the history
Fix linter error
  • Loading branch information
jeffhappily committed Feb 17, 2020
1 parent dadb5ec commit fe09ef1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/unix/System/Terminal.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ foreign import ccall "sys/ioctl.h ioctl"

getTerminalWidth :: IO (Maybe Int)
getTerminalWidth =
alloca $ \p -> do
errno <- ioctl (#const STDOUT_FILENO) (#const TIOCGWINSZ) p
if errno < 0
then return Nothing
else do
WindowWidth w <- peek p
alloca $ \p -> do
errno <- ioctl (#const STDOUT_FILENO) (#const TIOCGWINSZ) p
if errno < 0
then return Nothing
else do
WindowWidth w <- peek p
return . Just . fromIntegral $ w

fixCodePage :: x -> y -> a -> a
Expand Down
2 changes: 1 addition & 1 deletion src/windows/System/Terminal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ getTerminalWidth = do
[left,_top,right,_bottom] <- forM [0..3] $ \i -> do
v <- peekByteOff p ((i*2) + posCONSOLE_SCREEN_BUFFER_INFO_srWindow)
return $ fromIntegral (v :: Word16)
return $ Just $ (1+right-left)
return $ Just (1+right-left)

-- | Set the code page for this process as necessary. Only applies to Windows.
-- See: https://github.com/commercialhaskell/stack/issues/738
Expand Down

0 comments on commit fe09ef1

Please sign in to comment.