[commit: ghc] master: Fix etags output; trac #4256 (0a4537f)

Ian Lynagh igloo at earth.li
Sun Sep 18 00:26:17 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/0a4537fb670ed15e9eb65b4b6e9c67398634a3f5

>---------------------------------------------------------------

commit 0a4537fb670ed15e9eb65b4b6e9c67398634a3f5
Author: Ian Lynagh <igloo at earth.li>
Date:   Sat Sep 17 13:10:58 2011 +0100

    Fix etags output; trac #4256
    
    We had an off-by-one bug in column numbers, causing first characters
    of identifiers to be duplicated.

>---------------------------------------------------------------

 ghc/GhciTags.hs |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ghc/GhciTags.hs b/ghc/GhciTags.hs
index 650ed87..df826e1 100644
--- a/ghc/GhciTags.hs
+++ b/ghc/GhciTags.hs
@@ -195,7 +195,7 @@ showCTag ti =
 showETag :: TagInfo -> String
 showETag TagInfo{ tagName = tag, tagLine = lineNo, tagCol = colNo,
                   tagSrcInfo = Just (srcLine,charPos) }
-    =  take colNo srcLine ++ tag
+    =  take (colNo - 1) srcLine ++ tag
     ++ "\x7f" ++ tag
     ++ "\x01" ++ show lineNo
     ++ "," ++ show charPos





More information about the Cvs-ghc mailing list