fast-tags 0.0.3 → 0.0.4
raw patch · 3 files changed
+16/−16 lines, 3 files
Files
- fast-tags.cabal +5/−1
- src/Main.hs +9/−6
- src/T.hs +2/−9
fast-tags.cabal view
@@ -1,5 +1,5 @@ name: fast-tags-version: 0.0.3+version: 0.0.4 cabal-version: >= 1.8 build-type: Simple synopsis: Fast incremental vi tags.@@ -12,6 +12,10 @@ . The intent is to bind it to vim's BufWrite autocommand to automatically keep the tags file up to date.+ .+ Changes since 0.0.3:+ .+ * Fixed bug that prevented old tags from being filered out. . Changes since 0.0.2: .
src/Main.hs view
@@ -56,15 +56,18 @@ let write = if output == "-" then Text.IO.hPutStr IO.stdout else Text.IO.writeFile output-- -- Turns out GHC will not float out the T.pack and it makes a big- -- performance difference.- let textFns = Set.fromList $ map (T.pack . ('\t':)) inputs- filtered = filter (not . isNewTag textFns) oldTags- write $ T.unlines $ merge (List.sort (map showTag newTags)) filtered+ write $ T.unlines (mergeTags inputs oldTags newTags) where usage msg = putStr (GetOpt.usageInfo msg options) >> System.Exit.exitSuccess++mergeTags :: [FilePath] -> [Text] -> [Pos TagVal] -> [Text]+mergeTags inputs old new =+ merge (List.sort (map showTag new)) (filter (not . isNewTag textFns) old)+ where+ -- Turns out GHC will not float out the T.pack and it makes a big+ -- performance difference.+ textFns = Set.fromList $ map T.pack inputs data Flag = Output FilePath | Verbose deriving (Eq, Show)
src/T.hs view
@@ -1,11 +1,4 @@-{-# LANGUAGE GADTs #-} module T where --數字 :: Int-數字 = 2--(·) = (.)--data X where- A, B :: X+f :: X -> Y+f = id