aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 9873d2f8..08a70bde 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -591,8 +591,9 @@ findNamedDoc str decls =
where search [] = Nothing
search (HsDocCommentNamed str : rest) =
case matchRegexAll docNameRE str of
- Nothing -> search rest
- Just (_, _, after, _, _) -> Just after
+ Just (_, _, after, _, name':_)
+ | name == name' -> Just after
+ _otherwise -> search rest
search (_other_decl : rest) = search rest
_other -> Nothing