-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[info view] Adjust breaks in errors and messages panels.
Fixes #457 , fixes #458 , fixes #571 This is a hotfix, but we should actually move this logic to the CoqPp component, as adjusting the breaks at every use doesn't scale. However this fix should be good for now, as the above fix requires a bit more thinking about the structure of the HTML that contains `Pp`
- Loading branch information
Showing
5 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
import { PpString } from "../../lib/types"; | ||
import { CoqPp } from "./CoqPp"; | ||
import { FormatPrettyPrint } from "../../lib/format-pprint/js/main"; | ||
import $ from "jquery"; | ||
import { useLayoutEffect, useRef } from "react"; | ||
|
||
export type ErrorBrowserParams = { error: PpString }; | ||
|
||
export function ErrorBrowser({ error }: ErrorBrowserParams) { | ||
const ref: React.LegacyRef<HTMLDivElement> | null = useRef(null); | ||
useLayoutEffect(() => { | ||
if (ref.current) { | ||
FormatPrettyPrint.adjustBreaks($(ref.current)); | ||
} | ||
}); | ||
|
||
return ( | ||
<> | ||
<header>Errors:</header> | ||
<CoqPp content={error} inline={true} />; | ||
<div className="coq-error" ref={ref}> | ||
<CoqPp content={error} inline={true} />; | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Record t : Type := { | ||
carrier :> Type; | ||
unit : carrier; | ||
mult : carrier -> carrier -> carrier; | ||
assoc : forall a b c, mult a (mult b c) = mult (mult a b) c; | ||
unit_l : forall a, mult unit a = a; | ||
unit_r : forall a, mult a unit = a; | ||
}. | ||
|
||
Print t. | ||
|
||
Module A. | ||
Axiom A : Type. | ||
Axiom B : Type. | ||
Axiom C : Type. | ||
Axiom D : Type. | ||
Axiom E : Type. | ||
End A. | ||
|
||
Print A. | ||
|
||
Goal True /\ True /\ True /\ True /\ True /\ True /\ True /\ True /\ True /\ True /\ True. | ||
apply I. | ||
Qed. |