diff options
| author | Gaëtan Gilbert | 2019-08-19 14:48:53 +0200 |
|---|---|---|
| committer | Gaëtan Gilbert | 2019-08-19 14:48:53 +0200 |
| commit | 7f9a08b98b1637291dda687fce92198a21ffc395 (patch) | |
| tree | 317f8729c70b1bf9d21b222efeaf0728f351ae74 /ide | |
| parent | 354ac6a0c59f77d8a7d63c84144c044fe958fa3c (diff) | |
| parent | f10cc5bbadf94210cc2ddc3835cc09228d71bde7 (diff) | |
Merge PR #10454: [vernac] Refactor control attributes and fix bug #10452
Reviewed-by: SkySkimmer
Reviewed-by: gares
Diffstat (limited to 'ide')
| -rw-r--r-- | ide/idetop.ml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ide/idetop.ml b/ide/idetop.ml index 7c6fa8951b..7e55eb4d13 100644 --- a/ide/idetop.ml +++ b/ide/idetop.ml @@ -56,7 +56,7 @@ let coqide_known_option table = List.mem table [ ["Printing";"Unfocused"]; ["Diffs"]] -let is_known_option cmd = match Vernacprop.under_control cmd with +let is_known_option cmd = match cmd with | VernacSetOption (_, o, OptionSetTrue) | VernacSetOption (_, o, OptionSetString _) | VernacSetOption (_, o, OptionUnset) -> coqide_known_option o @@ -64,7 +64,7 @@ let is_known_option cmd = match Vernacprop.under_control cmd with (** Check whether a command is forbidden in the IDE *) -let ide_cmd_checks ~last_valid ({ CAst.loc; _ } as cmd) = +let ide_cmd_checks ~last_valid { CAst.loc; v } = let user_error s = try CErrors.user_err ?loc ~hdr:"IDE" (str s) with e -> @@ -72,14 +72,14 @@ let ide_cmd_checks ~last_valid ({ CAst.loc; _ } as cmd) = let info = Stateid.add info ~valid:last_valid Stateid.dummy in Exninfo.raise ~info e in - if is_debug cmd then + if is_debug v.expr then user_error "Debug mode not available in the IDE" -let ide_cmd_warns ~id ({ CAst.loc; _ } as cmd) = +let ide_cmd_warns ~id { CAst.loc; v } = let warn msg = Feedback.(feedback ~id (Message (Warning, loc, strbrk msg))) in - if is_known_option cmd then + if is_known_option v.expr then warn "Set this option from the IDE menu instead"; - if is_navigation_vernac cmd || is_undo cmd then + if is_navigation_vernac v.expr || is_undo v.expr then warn "Use IDE navigation instead" (** Interpretation (cf. [Ide_intf.interp]) *) |
