Hello community,

here is the log from the commit of package ghc-ansi-terminal for 
openSUSE:Factory checked in at 2018-11-09 07:51:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-ansi-terminal (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-ansi-terminal.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-ansi-terminal"

Fri Nov  9 07:51:50 2018 rev:10 rq:646353 version:0.8.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-ansi-terminal/ghc-ansi-terminal.changes      
2018-10-25 08:14:44.124112230 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-ansi-terminal.new/ghc-ansi-terminal.changes 
2018-11-09 07:51:55.547882983 +0100
@@ -1,0 +2,13 @@
+Mon Oct 29 09:03:23 UTC 2018 - [email protected]
+
+- Update ansi-terminal to version 0.8.2.
+  Version 0.8.2
+  -------------
+
+  * Add `getCursorPosition0` and deprecate `getCursorPosition`. Any position
+    provided by the latter is 1-based. Any position provided by the former is
+    0-based, consistent with `setCursorColumn` and `setCursorPosition`.
+  * Improvements to Haddock documentation in respect of 0-based and 1-based
+    cursor positions.
+
+-------------------------------------------------------------------

Old:
----
  ansi-terminal-0.8.1.tar.gz

New:
----
  ansi-terminal-0.8.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-ansi-terminal.spec ++++++
--- /var/tmp/diff_new_pack.7ggW8h/_old  2018-11-09 07:51:57.331880929 +0100
+++ /var/tmp/diff_new_pack.7ggW8h/_new  2018-11-09 07:51:57.331880929 +0100
@@ -18,7 +18,7 @@
 
 %global pkg_name ansi-terminal
 Name:           ghc-%{pkg_name}
-Version:        0.8.1
+Version:        0.8.2
 Release:        0
 Summary:        Simple ANSI terminal support, with Windows compatibility
 License:        BSD-3-Clause

++++++ ansi-terminal-0.8.1.tar.gz -> ansi-terminal-0.8.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.8.1/CHANGELOG.md 
new/ansi-terminal-0.8.2/CHANGELOG.md
--- old/ansi-terminal-0.8.1/CHANGELOG.md        2018-09-08 19:20:43.000000000 
+0200
+++ new/ansi-terminal-0.8.2/CHANGELOG.md        2018-10-28 00:21:07.000000000 
+0200
@@ -1,6 +1,15 @@
 Changes
 =======
 
+Version 0.8.2
+-------------
+
+* Add `getCursorPosition0` and deprecate `getCursorPosition`. Any position
+  provided by the latter is 1-based. Any position provided by the former is
+  0-based, consistent with `setCursorColumn` and `setCursorPosition`.
+* Improvements to Haddock documentation in respect of 0-based and 1-based
+  cursor positions.
+
 Version 0.8.1
 -------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.8.1/ansi-terminal.cabal 
new/ansi-terminal-0.8.2/ansi-terminal.cabal
--- old/ansi-terminal-0.8.1/ansi-terminal.cabal 2018-09-08 19:21:42.000000000 
+0200
+++ new/ansi-terminal-0.8.2/ansi-terminal.cabal 2018-10-28 00:21:07.000000000 
+0200
@@ -1,5 +1,5 @@
 Name:                ansi-terminal
-Version:             0.8.1
+Version:             0.8.2
 Cabal-Version:       >= 1.8
 Category:            User Interfaces
 Synopsis:            Simple ANSI terminal support, with Windows compatibility
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.8.1/app/Example.hs 
new/ansi-terminal-0.8.2/app/Example.hs
--- old/ansi-terminal-0.8.1/app/Example.hs      2018-03-03 13:19:27.000000000 
+0100
+++ new/ansi-terminal-0.8.2/app/Example.hs      2018-10-28 00:21:07.000000000 
+0200
@@ -301,11 +301,11 @@
   --          11111111112222222222
   -- 12345678901234567890123456789
   -- Report cursor position here:|
-  result <- getCursorPosition
+  result <- getCursorPosition0
   putStrLn " (3rd row, 29th column) to stdin, as CSI 3 ; 29 R.\n"
   case result of
     Just (row, col) -> putStrLn $ "The cursor was at row number " ++
-      show row ++ " and column number " ++ show col ++ ".\n"
+      show (row + 1) ++ " and column number " ++ show (col + 1) ++ ".\n"
     Nothing -> putStrLn "Error: unable to get the cursor position\n"
   pause
   --          11111111112222222222
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.8.1/src/System/Console/ANSI/Codes.hs 
new/ansi-terminal-0.8.2/src/System/Console/ANSI/Codes.hs
--- old/ansi-terminal-0.8.1/src/System/Console/ANSI/Codes.hs    2018-03-03 
13:19:27.000000000 +0100
+++ new/ansi-terminal-0.8.2/src/System/Console/ANSI/Codes.hs    2018-10-28 
00:21:07.000000000 +0200
@@ -134,18 +134,42 @@
 cursorDownLineCode n = csi [n] "E"
 cursorUpLineCode n = csi [n] "F"
 
+-- | Code to move the cursor to the specified column. The column numbering is
+-- 0-based (that is, the left-most column is numbered 0).
 setCursorColumnCode :: Int -- ^ 0-based column to move to
                     -> String
 setCursorColumnCode n = csi [n + 1] "G"
 
+-- | Code to move the cursor to the specified position (row and column). The
+-- position is 0-based (that is, the top-left corner is at row 0 column 0).
 setCursorPositionCode :: Int -- ^ 0-based row to move to
                       -> Int -- ^ 0-based column to move to
                       -> String
 setCursorPositionCode n m = csi [n + 1, m + 1] "H"
 
-saveCursorCode, restoreCursorCode, reportCursorPositionCode :: String
+-- | @since 0.7.1
+saveCursorCode, restoreCursorCode :: String
 saveCursorCode = "\ESC7"
 restoreCursorCode = "\ESC8"
+
+-- | Code to emit the cursor position into the console input stream, 
immediately
+-- after being recognised on the output stream, as:
+-- @ESC [ \<cursor row> ; \<cursor column> R@
+--
+-- Note that the information that is emitted is 1-based (the top-left corner is
+-- at row 1 column 1) but 'setCursorPositionCode' is 0-based.
+--
+-- In isolation of 'getReportedCursorPosition' or 'getCursorPosition0', this
+-- function may be of limited use on Windows operating systems because of
+-- difficulties in obtaining the data emitted into the console input stream.
+-- The function 'hGetBufNonBlocking' in module "System.IO" does not work on
+-- Windows. This has been attributed to the lack of non-blocking primatives in
+-- the operating system (see the GHC bug report #806 at
+-- <https://ghc.haskell.org/trac/ghc/ticket/806>).
+--
+-- @since 0.7.1
+reportCursorPositionCode :: String
+
 reportCursorPositionCode = csi [] "6n"
 
 clearFromCursorToScreenEndCode, clearFromCursorToScreenBeginningCode,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.8.1/src/System/Console/ANSI/Unix.hs 
new/ansi-terminal-0.8.2/src/System/Console/ANSI/Unix.hs
--- old/ansi-terminal-0.8.1/src/System/Console/ANSI/Unix.hs     2018-09-08 
18:58:56.000000000 +0200
+++ new/ansi-terminal-0.8.2/src/System/Console/ANSI/Unix.hs     2018-10-28 
00:21:07.000000000 +0200
@@ -101,6 +101,7 @@
 
 -- getCursorPosition :: IO (Maybe (Int, Int))
 -- (See Common-Include.hs for Haddock documentation)
+{-# DEPRECATED getCursorPosition "Use getCursorPosition0 instead." #-}
 getCursorPosition = do
   input <- bracket (hGetBuffering stdin) (hSetBuffering stdin) $ \_ -> do
     hSetBuffering stdin NoBuffering -- set no buffering (the contents of the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/ansi-terminal-0.8.1/src/System/Console/ANSI/Windows.hs 
new/ansi-terminal-0.8.2/src/System/Console/ANSI/Windows.hs
--- old/ansi-terminal-0.8.1/src/System/Console/ANSI/Windows.hs  2018-09-08 
18:58:56.000000000 +0200
+++ new/ansi-terminal-0.8.2/src/System/Console/ANSI/Windows.hs  2018-10-28 
00:21:07.000000000 +0200
@@ -192,4 +192,5 @@
 
 -- getCursorPosition :: IO (Maybe (Int, Int))
 -- (See Common-Include.hs for Haddock documentation)
+{-# DEPRECATED getCursorPosition "Use getCursorPosition0 instead." #-}
 getCursorPosition = E.getCursorPosition
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.8.1/src/System/Console/ANSI.hs 
new/ansi-terminal-0.8.2/src/System/Console/ANSI.hs
--- old/ansi-terminal-0.8.1/src/System/Console/ANSI.hs  2018-05-05 
20:22:03.000000000 +0200
+++ new/ansi-terminal-0.8.2/src/System/Console/ANSI.hs  2018-10-28 
00:21:07.000000000 +0200
@@ -22,6 +22,13 @@
 --
 --  * Changing the title of the terminal
 --
+-- The functions moving the cursor to an absolute position are 0-based (the
+-- top-left corner is considered to be at row 0 column 0) (see
+-- 'setCursorPosition') and so is 'getCursorPosition0'. The \'ANSI\' standards
+-- themselves are 1-based (that is, the top-left corner is considered to be at
+-- row 1 column 1) and some functions reporting the position of the cursor are
+-- too (see 'reportCursorPosition').
+--
 -- The native terminal software on Windows is \'Command Prompt\' or
 -- \`PowerShell\`. Before Windows 10 version 1511 (known as the \'November
 -- [2015] Update\' or \'Threshold 2\') that software did not support such
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.8.1/src/includes/Common-Include.hs 
new/ansi-terminal-0.8.2/src/includes/Common-Include.hs
--- old/ansi-terminal-0.8.1/src/includes/Common-Include.hs      2018-09-08 
18:58:56.000000000 +0200
+++ new/ansi-terminal-0.8.2/src/includes/Common-Include.hs      2018-10-28 
00:21:07.000000000 +0200
@@ -35,6 +35,9 @@
 hSetCursorColumn :: Handle
                  -> Int -- ^ 0-based column to move to
                  -> IO ()
+
+-- | Move the cursor to the specified column. The column numbering is 0-based
+-- (that is, the left-most column is numbered 0).
 setCursorColumn :: Int -- ^ 0-based column to move to
                 -> IO ()
 setCursorColumn = hSetCursorColumn stdout
@@ -43,6 +46,9 @@
                    -> Int -- ^ 0-based row to move to
                    -> Int -- ^ 0-based column to move to
                    -> IO ()
+
+-- | Move the cursor to the specified position (row and column). The position 
is
+-- 0-based (that is, the top-left corner is at row 0 column 0).
 setCursorPosition :: Int -- ^ 0-based row to move to
                   -> Int -- ^ 0-based column to move to
                   -> IO ()
@@ -52,24 +58,36 @@
 
 -- | Save the cursor position in memory. The only way to access the saved value
 -- is with the 'restoreCursor' command.
+--
+-- @since 0.7.1
 saveCursor :: IO ()
+
 -- | Restore the cursor position from memory. There will be no value saved in
 -- memory until the first use of the 'saveCursor' command.
+--
+-- @since 0.7.1
 restoreCursor :: IO ()
+
 -- | Looking for a way to get the cursors position? See
--- 'getCursorPosition'.
+-- 'getCursorPosition0'.
 --
 -- Emit the cursor position into the console input stream, immediately after
 -- being recognised on the output stream, as:
 -- @ESC [ \<cursor row> ; \<cursor column> R@
 --
--- In isolation of 'getReportedCursorPosition' or 'getCursorPosition', this
+-- Note that the information that is emitted is 1-based (the top-left corner is
+-- at row 1 column 1) but 'setCursorColumn' and 'setCursorPosition' are
+-- 0-based.
+--
+-- In isolation of 'getReportedCursorPosition' or 'getCursorPosition0', this
 -- function may be of limited use on Windows operating systems because of
 -- difficulties in obtaining the data emitted into the console input stream.
 -- The function 'hGetBufNonBlocking' in module "System.IO" does not work on
 -- Windows. This has been attributed to the lack of non-blocking primatives in
 -- the operating system (see the GHC bug report #806 at
 -- <https://ghc.haskell.org/trac/ghc/ticket/806>).
+--
+-- @since 0.7.1
 reportCursorPosition :: IO ()
 
 saveCursor = hSaveCursor stdout
@@ -151,6 +169,7 @@
 -- >         ++ " and column" ++ show column ++ "."
 -- >     (_:_) -> putStrLn $ "Error: parse not unique"
 --
+-- @since 0.7.1
 cursorPosition :: ReadP (Int, Int)
 cursorPosition = do
   void $ char '\ESC'
@@ -183,14 +202,31 @@
 -- On Windows operating systems, the function is not supported on consoles, 
such
 -- as mintty, that are not based on the Win32 console of the Windows API.
 -- (Command Prompt and PowerShell are based on the Win32 console.)
+--
+-- @since 0.7.1
 getReportedCursorPosition :: IO String
 
 -- | Attempts to get the reported cursor position, combining the functions
--- 'reportCursorPosition', 'getReportedCursorPosition' and 'cursorPosition'.
--- Returns 'Nothing' if any data emitted by 'reportCursorPosition', obtained by
--- 'getReportedCursorPosition', cannot be parsed by 'cursorPosition'.
+-- 'reportCursorPosition', 'getReportedCursorPosition' and 'cursorPosition'. 
Any
+-- position @(row, column)@ is translated to be 0-based (that is, the top-left
+-- corner is at @(0, 0)@), consistent with `setCursorColumn` and
+-- `setCursorPosition`. (Note that the information emitted by
+-- 'reportCursorPosition' is 1-based.) Returns 'Nothing' if any data emitted by
+-- 'reportCursorPosition', obtained by 'getReportedCursorPosition', cannot be
+-- parsed by 'cursorPosition'.
 --
 -- On Windows operating systems, the function is not supported on consoles, 
such
 -- as mintty, that are not based on the Win32 console of the Windows API.
 -- (Command Prompt and PowerShell are based on the Win32 console.)
+--
+-- @since 0.8.2
+getCursorPosition0 :: IO (Maybe (Int, Int))
+getCursorPosition0 = fmap to0base <$> getCursorPosition
+ where
+  to0base (row, col) = (row - 1, col - 1)
+
+-- | Similar to 'getCursorPosition0', but does not translate the 1-based data
+-- emitted by 'reportCursorPosition' to be 0-based.
+--
+-- @since 0.7.1
 getCursorPosition :: IO (Maybe (Int, Int))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.8.1/src/includes/Exports-Include.hs 
new/ansi-terminal-0.8.2/src/includes/Exports-Include.hs
--- old/ansi-terminal-0.8.1/src/includes/Exports-Include.hs     2018-09-08 
18:58:56.000000000 +0200
+++ new/ansi-terminal-0.8.2/src/includes/Exports-Include.hs     2018-10-28 
00:21:07.000000000 +0200
@@ -110,6 +110,9 @@
   , hSupportsANSIWithoutEmulation
 
     -- * Getting the cursor position
-  , getCursorPosition
+  , getCursorPosition0
   , getReportedCursorPosition
   , cursorPosition
+
+    -- * Deprecated
+  , getCursorPosition


Reply via email to