on master help sign in
Fix #4020: Fix duplication in output of `--hightlight`.

When adding to the list of highlighted regions ensure that there are no duplicates. While not a principled fix for the deduplication of highlighted regions, it is a fix nonetheless.

commitc51fd2d27625b788ca1199709c201d93021cfc89 authorJan de Muijnck-Hughes <jan.deMuijnck-Hughes@glasgow.ac.uk> dateFri 25 Aug 2017, 20:31 (9 years ago) parente2843b0
1 file changed+4−3
src/Idris/Output.hs+4−3
src/Idris/Output.hs+4−3
@@ -234,14 +234,15 @@ sendParserHighlighting =
234234
235235sendHighlighting :: [(FC, OutputAnnotation)] -> Idris ()
236236sendHighlighting highlights =
237− do ist <- getIState
237+ do let highlights_uniq = nub highlights
238+ ist <- getIState
238239 case idris_outputmode ist of
239240 RawOutput _ -> updateIState $
240241 \ist -> ist { idris_highlightedRegions =
241− highlights ++ idris_highlightedRegions ist }
242+ highlights_uniq ++ idris_highlightedRegions ist }
242243 IdeMode n h ->
243244 let fancier = [ toSExp (fc, fancifyAnnots ist False annot)
244− | (fc, annot) <- highlights, fullFC fc
245+ | (fc, annot) <- highlights_uniq, fullFC fc
245246 ]
246247 in case fancier of
247248 [] -> return ()