@@ -38,7 +38,7 @@ import Prelude hiding ((<$>))
39import Control.Arrow (first)
39import Control.Arrow (first)
40import Control.Monad.Trans.Except (ExceptT(ExceptT), runExceptT)
40import Control.Monad.Trans.Except (ExceptT(ExceptT), runExceptT)
41−import Data.List (intersperse, nub)
41+import Data.List (intersperse, nub, nubBy)
42import Data.Maybe (fromJust, fromMaybe, isJust, listToMaybe)
42import Data.Maybe (fromJust, fromMaybe, isJust, listToMaybe)
43import System.Console.Haskeline.MonadException (MonadException(controlIO),
43import System.Console.Haskeline.MonadException (MonadException(controlIO),
44 RunIO(RunIO))
44 RunIO(RunIO))
@@ -372,12 +372,12 @@ sendHighlighting highlights =
372 case idris_outputmode ist of
372 case idris_outputmode ist of
373 RawOutput _ -> updateIState $
373 RawOutput _ -> updateIState $
374 \ist -> ist { idris_highlightedRegions =
374 \ist -> ist { idris_highlightedRegions =
375− highlights ++ idris_highlightedRegions ist }
375+ nubBy canNub $ highlights ++ idris_highlightedRegions ist }
376 IdeMode n h ->
376 IdeMode n h ->
377 let fancier = [ toSExp (fc, fancifyAnnots ist False annot)
377 let fancier = [ toSExp (fc, fancifyAnnots ist False annot)
378− | (fc, annot) <- highlights, fullFC fc
378+ | (fc, annot) <- nubBy canNub highlights, fullFC fc
380− in case fancier of
380+ case fancier of
381 [] -> return ()
381 [] -> return ()
382 _ -> runIO . hPutStrLn h $
382 _ -> runIO . hPutStrLn h $
383 convSExp "output"
383 convSExp "output"
@@ -386,6 +386,7 @@ sendHighlighting highlights =
387 where fullFC (FC _ _ _) = True
387 where fullFC (FC _ _ _) = True
388 fullFC _ = False
388 fullFC _ = False
389+ canNub (fA,x) (fB,y) = show fA == show fB && x == y
390-- | Write the highlighting information to a file, for use in external tools
391-- | Write the highlighting information to a file, for use in external tools
391-- or in editors that don't support the IDE protocol
392-- or in editors that don't support the IDE protocol