equal
deleted
inserted
replaced
55 server.channel.write(Protocol.State_Output(id, content)) |
55 server.channel.write(Protocol.State_Output(id, content)) |
56 |
56 |
57 |
57 |
58 /* query operation */ |
58 /* query operation */ |
59 |
59 |
|
60 private val output_active = Synchronized(true) |
|
61 |
60 private val print_state = |
62 private val print_state = |
61 new Query_Operation(server.editor, (), "print_state", _ => (), |
63 new Query_Operation(server.editor, (), "print_state", _ => (), |
62 (snapshot, results, body) => |
64 (snapshot, results, body) => |
63 { |
65 if (output_active.value) { |
64 val text = server.resources.output_pretty_message(Pretty.separate(body)) |
66 val text = server.resources.output_pretty_message(Pretty.separate(body)) |
65 val content = |
67 val content = |
66 HTML.output_document( |
68 HTML.output_document( |
67 List(HTML.style(HTML.fonts_css()), |
69 List(HTML.style(HTML.fonts_css()), |
68 HTML.style_file(HTML.isabelle_css), |
70 HTML.style_file(HTML.isabelle_css), |
158 server.editor.send_dispatcher { auto_update() } |
160 server.editor.send_dispatcher { auto_update() } |
159 } |
161 } |
160 |
162 |
161 def exit() |
163 def exit() |
162 { |
164 { |
163 server.editor.send_wait_dispatcher { print_state.deactivate() } |
165 output_active.change(_ => false) |
164 server.session.commands_changed -= main |
166 server.session.commands_changed -= main |
165 server.session.caret_focus -= main |
167 server.session.caret_focus -= main |
|
168 server.editor.send_wait_dispatcher { print_state.deactivate() } |
166 } |
169 } |
167 } |
170 } |