FIX #1669 (GHCi debugger underlining is in the wrong place)
authorPepe Iborra <mnislaih@gmail.com>
Mon, 10 Sep 2007 14:21:29 +0000 (14:21 +0000)
committerPepe Iborra <mnislaih@gmail.com>
Mon, 10 Sep 2007 14:21:29 +0000 (14:21 +0000)
We weren't taking into account the offset added by the line numbers:

Stopped at break020.hs:10:2-8
_result :: IO () = _
9  main = do
10    line1 0
     ^^^^^^^
11    line2 0

This patch adjusts that

compiler/ghci/InteractiveUI.hs

index 42424e6..e45e738 100644 (file)
@@ -1941,7 +1941,7 @@ listAround span do_highlight = do
           = BS.concat [line, nl, indent, BS.replicate col2 '^']
           | otherwise   = line
          where
-           indent = BS.pack "   "
+           indent = BS.pack ("  " ++ replicate (length (show no)) ' ')
            nl = BS.singleton '\n'
 
 -- --------------------------------------------------------------------------