diff options
author | Enrico Tassi <Enrico.Tassi@inria.fr> | 2018-03-08 16:18:42 +0100 |
---|---|---|
committer | Enrico Tassi <Enrico.Tassi@inria.fr> | 2018-03-08 16:39:06 +0100 |
commit | 079e895cad0a205e22202da5ba1a919a820c863b (patch) | |
tree | 6168893446a95c815715f2db4a5d8e58c65b8a3f /ide/ideutils.ml | |
parent | c5cd6f93bc14c66a3e4d7e17f8d18dc9fb2308d7 (diff) |
coqide: queries from the query window are routed there (fix #5684)
We systematically use Wg_MessageView for both the message panel and each
Query tab; we register all MessageView in a RoutedMessageViews where the
default route (0) is the message panel. Queries from the Query panel pick
a non zero route to have their feedback message delivered to their MessageView
Diffstat (limited to 'ide/ideutils.ml')
-rw-r--r-- | ide/ideutils.ml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ide/ideutils.ml b/ide/ideutils.ml index 178695759..bdb39e94a 100644 --- a/ide/ideutils.ml +++ b/ide/ideutils.ml @@ -473,3 +473,15 @@ let browse_keyword prerr text = let u = Lazy.force url_for_keyword text in browse prerr (doc_url() ^ u) with Not_found -> prerr ("No documentation found for \""^text^"\".\n") + +let rec is_valid (s : Pp.t) = match Pp.repr s with + | Pp.Ppcmd_empty + | Pp.Ppcmd_print_break _ + | Pp.Ppcmd_force_newline -> true + | Pp.Ppcmd_glue l -> List.for_all is_valid l + | Pp.Ppcmd_string s -> Glib.Utf8.validate s + | Pp.Ppcmd_box (_,s) + | Pp.Ppcmd_tag (_,s) -> is_valid s + | Pp.Ppcmd_comment s -> List.for_all Glib.Utf8.validate s +let validate s = + if is_valid s then s else Pp.str "This error massage can't be printed." |