on master help sign in
Fix #4020: Fix duplication in output of `--hightlight`.
c51fd2dJan de Muijnck-Hughes
src/Idris/Output.hs+4−3
@@ -234,14 +234,15 @@ sendParserHighlighting =
234
234
235sendHighlighting :: [(FC, OutputAnnotation)] -> Idris ()
235sendHighlighting :: [(FC, OutputAnnotation)] -> Idris ()
236sendHighlighting highlights =
236sendHighlighting highlights =
237+ do let highlights_uniq = nub highlights
237− do ist <- getIState
238+ ist <- getIState
238 case idris_outputmode ist of
239 case idris_outputmode ist of
239 RawOutput _ -> updateIState $
240 RawOutput _ -> updateIState $
240 \ist -> ist { idris_highlightedRegions =
241 \ist -> ist { idris_highlightedRegions =
241− highlights ++ idris_highlightedRegions ist }
242+ highlights_uniq ++ idris_highlightedRegions ist }
242 IdeMode n h ->
243 IdeMode n h ->
243 let fancier = [ toSExp (fc, fancifyAnnots ist False annot)
244 let fancier = [ toSExp (fc, fancifyAnnots ist False annot)
244− | (fc, annot) <- highlights, fullFC fc
245+ | (fc, annot) <- highlights_uniq, fullFC fc
245 ]
246 ]
246 in case fancier of
247 in case fancier of
247 [] -> return ()
248 [] -> return ()