aboutsummaryrefslogtreecommitdiffhomepage
path: root/ide/wg_Command.ml
diff options
context:
space:
mode:
authorGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2016-09-30 09:43:31 +0200
committerGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2017-03-21 15:51:38 +0100
commit6885a398229918865378ea24f07d93d2bcdd2802 (patch)
tree6b586a4461256737d1305a28cf324dc82fcf95cd /ide/wg_Command.ml
parent4084ee30293a6013592c0651dfeb1975711f135f (diff)
[ide] Dynamic printing width.
The IDE now gets core Coq's `std_ppcmds` document format which is width-independent. Thus, we follow [1] and make the `{proof,message}_view` object refresh their contents when the container widget changes size (by listening to GTK's `size_allocated` signal). The practical advantage is that now CoqIDE always renders terms with the proper printing width set and without a roundtrip to Coq. This patch dispenses the need for the `printing width` option, which could be removed altogether. [1] http://stackoverflow.com/questions/40854571/change-gtksourceview-contents-on-resize/
Diffstat (limited to 'ide/wg_Command.ml')
-rw-r--r--ide/wg_Command.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/ide/wg_Command.ml b/ide/wg_Command.ml
index b83bd107e..47dad8f19 100644
--- a/ide/wg_Command.ml
+++ b/ide/wg_Command.ml
@@ -103,11 +103,12 @@ object(self)
let process =
Coq.bind (Coq.query (phrase,Stateid.dummy)) (function
| Interface.Fail (_,l,str) ->
- Ideutils.insert_xml result#buffer (Richpp.richpp_of_pp str);
+ let width = Ideutils.textview_width result in
+ Ideutils.insert_xml result#buffer (Richpp.richpp_of_pp width str);
notebook#set_page ~tab_label:(new_tab_lbl "Error") frame#coerce;
Coq.return ()
| Interface.Good res ->
- result#buffer#insert res;
+ result#buffer#insert res;
notebook#set_page ~tab_label:(new_tab_lbl arg) frame#coerce;
Coq.return ())
in