Skip to content

Commit 79c0125

Browse files
committed
adapt hint
1 parent 146dab6 commit 79c0125

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Mathlib/Tactic/Hint.lean

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,18 @@ Extracts the `MessageData` from the first clickable `Try This:` diff widget in t
6969
Preserves (only) contexts and tags.
7070
-/
7171
private def getFirstTryThisFromMessage? : MessageData → Option MessageData
72-
| .ofWidget w msg => if w.id == ``Meta.Hint.tryThisDiffWidget then msg else none
72+
| .ofWidget w msg =>
73+
if w.id == ``Meta.Hint.tryThisDiffWidget then
74+
msg
75+
else
76+
none
7377
| .nest _ msg
7478
| .group msg => getFirstTryThisFromMessage? msg
79+
| .compose (.ofWidget w _) msg =>
80+
if w.id == ``Meta.Hint.textInsertionWidget then
81+
msg
82+
else
83+
getFirstTryThisFromMessage? msg
7584
| .compose msg₁ msg₂ => getFirstTryThisFromMessage? msg₁ <|> getFirstTryThisFromMessage? msg₂
7685
| .withContext ctx msg => (getFirstTryThisFromMessage? msg).map <| .withContext ctx
7786
| .withNamingContext ctx msg => (getFirstTryThisFromMessage? msg).map <| .withNamingContext ctx

0 commit comments

Comments
 (0)