X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FGhciTags.hs;h=9959991fab9297cb1a28b68bfef89ca6abd562aa;hb=579bc757533c8c9e5beabe5b21daddd922c1af75;hp=6aa4829fe50a82e7f0e7292c00023e964948d42e;hpb=881b72ecf360a38455ac9391ffa69039377aae25;p=ghc-hetmet.git diff --git a/compiler/ghci/GhciTags.hs b/compiler/ghci/GhciTags.hs index 6aa4829..9959991 100644 --- a/compiler/ghci/GhciTags.hs +++ b/compiler/ghci/GhciTags.hs @@ -120,12 +120,9 @@ collateAndWriteTags ETags file tagInfos = do -- etags style, Emacs/XEmacs sortedGroup = sortLe byLine group tags = unlines $ perFile sortedGroup 1 0 $ lines file return $ "\x0c\n" ++ fileName ++ "," ++ show (length tags) ++ "\n" ++ tags - perFile (tagInfo@(_tag, _file, lNo, _colNo):tags) count pos (line:lines) - | lNo > count = - perFile (tagInfo:tags) (count+1) (pos+length line) lines - perFile (tagInfo@(_tag, _file, lNo, _colNo):tags) count pos lines@(line:_) - | lNo == count = - showETag tagInfo line pos : perFile tags count pos lines + perFile (tagInfo@(_tag, _file, lNo, _colNo):tags) count pos lines@(line:lines') + | lNo > count = perFile (tagInfo:tags) (count+1) (pos+length line) lines' + | lNo == count = showETag tagInfo line pos : perFile tags count pos lines perFile _ _ _ _ = [] -- simple ctags format, for Vim et al