author | wenzelm |
Thu, 13 Feb 2025 16:19:48 +0100 | |
changeset 82156 | 5d2ed7e56a49 |
parent 82142 | 508a673c87ac |
child 82321 | 0811cfce1f5b |
permissions | -rw-r--r-- |
73987
fc363a3b690a
build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents:
73947
diff
changeset
|
1 |
/* Title: Tools/jEdit/src/main_plugin.scala |
36760 | 2 |
Author: Makarius |
3 |
||
50362 | 4 |
Main plumbing for PIDE infrastructure as jEdit plugin. |
36760 | 5 |
*/ |
34407 | 6 |
|
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
7 |
package isabelle.jedit |
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
8 |
|
34429 | 9 |
|
36015 | 10 |
import isabelle._ |
11 |
||
44573
51f8895b9ad9
some dialog for auto loading of required files (still inactive);
wenzelm
parents:
44434
diff
changeset
|
12 |
import javax.swing.JOptionPane |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
13 |
|
64858 | 14 |
import java.io.{File => JFile} |
15 |
||
66593 | 16 |
import org.gjt.sp.jedit.{jEdit, EBMessage, EBPlugin, Buffer, View, PerspectiveManager} |
65248 | 17 |
import org.gjt.sp.jedit.textarea.JEditTextArea |
50362 | 18 |
import org.gjt.sp.jedit.syntax.ModeProvider |
68080 | 19 |
import org.gjt.sp.jedit.msg.{EditorStarted, BufferUpdate, EditPaneUpdate, PropertiesChanged, |
20 |
ViewUpdate} |
|
62228
6dfe5b12c5b2
report error on internal channel as well: startup_failure dialog may be too late;
wenzelm
parents:
62227
diff
changeset
|
21 |
import org.gjt.sp.util.Log |
39241 | 22 |
|
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
23 |
|
75393 | 24 |
object PIDE { |
65248 | 25 |
/* semantic document content */ |
55621
8d69c15b6fb9
added PIDE.snapshot, PIDE.rendering for convenience;
wenzelm
parents:
55618
diff
changeset
|
26 |
|
75393 | 27 |
def maybe_snapshot(view: View = null): Option[Document.Snapshot] = GUI_Thread.now { |
69636 | 28 |
val buffer = JEdit_Lib.jedit_view(view).getBuffer |
76765
c654103e9c9d
more robust Document.Pending_Edits: cover all nodes simulataneously, and thus support proper Snapshot.switch;
wenzelm
parents:
76716
diff
changeset
|
29 |
Document_Model.get_snapshot(buffer) |
55621
8d69c15b6fb9
added PIDE.snapshot, PIDE.rendering for convenience;
wenzelm
parents:
55618
diff
changeset
|
30 |
} |
8d69c15b6fb9
added PIDE.snapshot, PIDE.rendering for convenience;
wenzelm
parents:
55618
diff
changeset
|
31 |
|
75393 | 32 |
def maybe_rendering(view: View = null): Option[JEdit_Rendering] = GUI_Thread.now { |
69636 | 33 |
val text_area = JEdit_Lib.jedit_view(view).getTextArea |
76765
c654103e9c9d
more robust Document.Pending_Edits: cover all nodes simulataneously, and thus support proper Snapshot.switch;
wenzelm
parents:
76716
diff
changeset
|
34 |
Document_View.get_rendering(text_area) |
55621
8d69c15b6fb9
added PIDE.snapshot, PIDE.rendering for convenience;
wenzelm
parents:
55618
diff
changeset
|
35 |
} |
65277 | 36 |
|
69759 | 37 |
def snapshot(view: View = null): Document.Snapshot = |
38 |
maybe_snapshot(view) getOrElse error("No document model for current buffer") |
|
39 |
||
40 |
def rendering(view: View = null): JEdit_Rendering = |
|
41 |
maybe_rendering(view) getOrElse error("No document view for current text area") |
|
42 |
||
65277 | 43 |
|
44 |
/* plugin instance */ |
|
45 |
||
73987
fc363a3b690a
build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents:
73947
diff
changeset
|
46 |
@volatile var _plugin: Main_Plugin = null |
65277 | 47 |
|
73987
fc363a3b690a
build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents:
73947
diff
changeset
|
48 |
def plugin: Main_Plugin = |
65277 | 49 |
if (_plugin == null) error("Uninitialized Isabelle/jEdit plugin") |
50 |
else _plugin |
|
51 |
||
52 |
def options: JEdit_Options = plugin.options |
|
53 |
def resources: JEdit_Resources = plugin.resources |
|
54 |
def session: Session = plugin.session |
|
81433
c3793899b880
performance tuning: cache for Rich_Text.format, notably for incremental tracing;
wenzelm
parents:
79717
diff
changeset
|
55 |
def cache: Rich_Text.Cache = session.cache.asInstanceOf[Rich_Text.Cache] |
66082 | 56 |
|
66083 | 57 |
object editor extends JEdit_Editor |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
58 |
} |
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
59 |
|
75393 | 60 |
class Main_Plugin extends EBPlugin { |
65262
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
61 |
/* options */ |
65238 | 62 |
|
65257
2307b91159bb
more explicit strict vs. non-strict initialization;
wenzelm
parents:
65256
diff
changeset
|
63 |
private var _options: JEdit_Options = null |
69854
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69759
diff
changeset
|
64 |
private def init_options(): Unit = |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69759
diff
changeset
|
65 |
_options = new JEdit_Options(Options.init()) |
65257
2307b91159bb
more explicit strict vs. non-strict initialization;
wenzelm
parents:
65256
diff
changeset
|
66 |
def options: JEdit_Options = _options |
65239
509a9b0ad02e
avoid global variables with implicit initialization;
wenzelm
parents:
65238
diff
changeset
|
67 |
|
65262
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
68 |
|
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
69 |
/* resources */ |
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
70 |
|
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
71 |
private var _resources: JEdit_Resources = null |
66572
1e5ae735e026
tolerate errors in session structure, although this may lead to confusion about theory imports later on;
wenzelm
parents:
66459
diff
changeset
|
72 |
private def init_resources(): Unit = _resources = JEdit_Resources(options.value) |
65262
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
73 |
def resources: JEdit_Resources = _resources |
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
74 |
|
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
75 |
|
65263
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
76 |
/* session */ |
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
77 |
|
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
78 |
private var _session: Session = null |
81433
c3793899b880
performance tuning: cache for Rich_Text.format, notably for incremental tracing;
wenzelm
parents:
79717
diff
changeset
|
79 |
private def init_session(): Unit = { |
c3793899b880
performance tuning: cache for Rich_Text.format, notably for incremental tracing;
wenzelm
parents:
79717
diff
changeset
|
80 |
_session = |
c3793899b880
performance tuning: cache for Rich_Text.format, notably for incremental tracing;
wenzelm
parents:
79717
diff
changeset
|
81 |
new Session(options.value, resources) { |
c3793899b880
performance tuning: cache for Rich_Text.format, notably for incremental tracing;
wenzelm
parents:
79717
diff
changeset
|
82 |
override val cache: Term.Cache = Rich_Text.Cache.make() |
c3793899b880
performance tuning: cache for Rich_Text.format, notably for incremental tracing;
wenzelm
parents:
79717
diff
changeset
|
83 |
} |
c3793899b880
performance tuning: cache for Rich_Text.format, notably for incremental tracing;
wenzelm
parents:
79717
diff
changeset
|
84 |
} |
65263
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
85 |
def session: Session = _session |
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
86 |
|
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
87 |
|
65262
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
88 |
/* misc support */ |
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
89 |
|
65239
509a9b0ad02e
avoid global variables with implicit initialization;
wenzelm
parents:
65238
diff
changeset
|
90 |
val completion_history = new Completion.History_Variable |
509a9b0ad02e
avoid global variables with implicit initialization;
wenzelm
parents:
65238
diff
changeset
|
91 |
val spell_checker = new Spell_Checker_Variable |
509a9b0ad02e
avoid global variables with implicit initialization;
wenzelm
parents:
65238
diff
changeset
|
92 |
|
65238 | 93 |
|
44577
96b6388d06c4
separate module for jEdit primitives for loading theory files;
wenzelm
parents:
44574
diff
changeset
|
94 |
/* theory files */ |
44574 | 95 |
|
76704 | 96 |
private lazy val delay_init: Delay = |
76610 | 97 |
Delay.last(PIDE.session.load_delay, gui = true) { init_models() } |
50344
608265769ce0
emit bulk edits on initialization of multiple buffers, which greatly improves performance when starting big sessions (e.g. JinjaThreads);
wenzelm
parents:
50209
diff
changeset
|
98 |
|
76704 | 99 |
private lazy val delay_load: Delay = |
100 |
Delay.last(session.load_delay, gui = true) { |
|
101 |
if (JEdit_Options.continuous_checking()) { |
|
102 |
if (!PerspectiveManager.isPerspectiveEnabled || |
|
103 |
JEdit_Lib.jedit_buffers().exists(_.isLoading)) delay_load.invoke() |
|
104 |
else if (delay_load_activated()) delay_load_body() |
|
105 |
else delay_load.invoke() |
|
106 |
} |
|
107 |
} |
|
108 |
||
76706 | 109 |
def deps_changed(): Unit = delay_load.invoke() |
110 |
||
57582 | 111 |
private val delay_load_active = Synchronized(false) |
76584 | 112 |
private def delay_load_finished(): Unit = delay_load_active.change(_ => false) |
57582 | 113 |
private def delay_load_activated(): Boolean = |
114 |
delay_load_active.guarded_access(a => Some((!a, true))) |
|
76584 | 115 |
|
76585
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
116 |
private def delay_load_body(): Unit = { |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
117 |
val required_files = { |
76777 | 118 |
val models = Document_Model.get_models_map() |
76585
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
119 |
|
76716
a7602257a825
clarified state document nodes for Theories_Status / Document_Dockable;
wenzelm
parents:
76706
diff
changeset
|
120 |
val thy_files = |
76767 | 121 |
resources.resolve_dependencies(models.values, PIDE.editor.document_required()) |
67290 | 122 |
|
76585
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
123 |
val aux_files = |
76601 | 124 |
if (resources.auto_resolve) { |
76766 | 125 |
session.stable_tip_version(models.values) match { |
76590 | 126 |
case Some(version) => resources.undefined_blobs(version) |
76585
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
127 |
case None => delay_load.invoke(); Nil |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
128 |
} |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
129 |
} |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
130 |
else Nil |
46761 | 131 |
|
76777 | 132 |
(thy_files ::: aux_files).filterNot(models.keySet) |
76585
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
133 |
} |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
134 |
if (required_files.nonEmpty) { |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
135 |
try { |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
136 |
Isabelle_Thread.fork(name = "resolve_dependencies") { |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
137 |
val loaded_files = |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
138 |
for { |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
139 |
name <- required_files |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
140 |
text <- resources.read_file_content(name) |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
141 |
} yield (name, text) |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
142 |
|
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
143 |
GUI_Thread.later { |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
144 |
try { |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
145 |
Document_Model.provide_files(session, loaded_files) |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
146 |
delay_init.invoke() |
62068 | 147 |
} |
76585
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
148 |
finally { delay_load_finished() } |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
149 |
} |
64835
fd1efd6dd385
resolve dependencies implicitly via File_Model, without jEdit Buffer_Model;
wenzelm
parents:
64818
diff
changeset
|
150 |
} |
76585
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
151 |
} |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
152 |
catch { case _: Throwable => delay_load_finished() } |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
153 |
} |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
154 |
else delay_load_finished() |
1b7bb4f8c0f4
potentially more robust delay_load action: avoid loosing events due to guards;
wenzelm
parents:
76584
diff
changeset
|
155 |
} |
62068 | 156 |
|
64858 | 157 |
private def file_watcher_action(changed: Set[JFile]): Unit = |
66082 | 158 |
if (Document_Model.sync_files(changed)) PIDE.editor.invoke_generated() |
64858 | 159 |
|
160 |
lazy val file_watcher: File_Watcher = |
|
76610 | 161 |
File_Watcher(file_watcher_action, session.load_delay) |
64858 | 162 |
|
44574 | 163 |
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
164 |
/* session phase */ |
44573
51f8895b9ad9
some dialog for auto loading of required files (still inactive);
wenzelm
parents:
44434
diff
changeset
|
165 |
|
75393 | 166 |
val session_phase_changed: Session.Consumer[Session.Phase] = Session.Consumer("Isabelle/jEdit") { |
65317 | 167 |
case Session.Terminated(result) if !result.ok => |
65226 | 168 |
GUI_Thread.later { |
65267 | 169 |
GUI.error_dialog(jEdit.getActiveView, "Prover process terminated with error", |
76488 | 170 |
"Isabelle Syslog", GUI.scrollable_text(session.syslog.content())) |
65226 | 171 |
} |
39735
969ede84aac0
more uniform init/exit model/view in session_manager, trading race wrt. session.phase for race wrt. global editor state;
wenzelm
parents:
39702
diff
changeset
|
172 |
|
71471
c06604896c3d
more robust shutdown while Isabelle_Process is starting up, e.g. quit after dialog Isabelle version for testing";
wenzelm
parents:
70775
diff
changeset
|
173 |
case Session.Ready if !shutting_down.value => |
65244 | 174 |
init_models() |
57640
0a28cf866d5d
reconfirm continuous checking on startup, to address common trap of disabling it accidentally;
wenzelm
parents:
57612
diff
changeset
|
175 |
|
75849 | 176 |
if (!JEdit_Options.continuous_checking()) { |
65226 | 177 |
GUI_Thread.later { |
178 |
val answer = |
|
179 |
GUI.confirm_dialog(jEdit.getActiveView, |
|
180 |
"Continuous checking of PIDE document", |
|
181 |
JOptionPane.YES_NO_OPTION, |
|
182 |
"Continuous checking is presently disabled:", |
|
183 |
"editor buffers will remain inactive!", |
|
184 |
"Enable continuous checking now?") |
|
75849 | 185 |
if (answer == 0) JEdit_Options.continuous_checking.set() |
57640
0a28cf866d5d
reconfirm continuous checking on startup, to address common trap of disabling it accidentally;
wenzelm
parents:
57612
diff
changeset
|
186 |
} |
65226 | 187 |
} |
57640
0a28cf866d5d
reconfirm continuous checking on startup, to address common trap of disabling it accidentally;
wenzelm
parents:
57612
diff
changeset
|
188 |
|
65226 | 189 |
delay_load.invoke() |
44573
51f8895b9ad9
some dialog for auto loading of required files (still inactive);
wenzelm
parents:
44434
diff
changeset
|
190 |
|
65226 | 191 |
case Session.Shutdown => |
192 |
GUI_Thread.later { |
|
193 |
delay_load.revoke() |
|
194 |
delay_init.revoke() |
|
66458
42d0d5c77c78
more robust shutdown, e.g. when plugin is stopped;
wenzelm
parents:
66351
diff
changeset
|
195 |
PIDE.editor.shutdown() |
65244 | 196 |
exit_models(JEdit_Lib.jedit_buffers().toList) |
65226 | 197 |
} |
46740
852baa599351
explicitly revoke delay, to avoid spurious timer events after deactivation of related components;
wenzelm
parents:
46204
diff
changeset
|
198 |
|
65226 | 199 |
case _ => |
200 |
} |
|
39630
44181423183a
explicit Session.Phase indication with associated event bus;
wenzelm
parents:
39628
diff
changeset
|
201 |
|
44181423183a
explicit Session.Phase indication with associated event bus;
wenzelm
parents:
39628
diff
changeset
|
202 |
|
65244 | 203 |
/* document model and view */ |
204 |
||
75393 | 205 |
def exit_models(buffers: List[Buffer]): Unit = { |
65244 | 206 |
GUI_Thread.now { |
207 |
buffers.foreach(buffer => |
|
208 |
JEdit_Lib.buffer_lock(buffer) { |
|
209 |
JEdit_Lib.jedit_text_areas(buffer).foreach(Document_View.exit) |
|
210 |
Document_Model.exit(buffer) |
|
211 |
}) |
|
212 |
} |
|
213 |
} |
|
214 |
||
75393 | 215 |
def init_models(): Unit = { |
65244 | 216 |
GUI_Thread.now { |
66082 | 217 |
PIDE.editor.flush() |
65244 | 218 |
|
219 |
for { |
|
220 |
buffer <- JEdit_Lib.jedit_buffers() |
|
221 |
if buffer != null && !buffer.getBooleanProperty(Buffer.GZIPPED) |
|
222 |
} { |
|
223 |
if (buffer.isLoaded) { |
|
224 |
JEdit_Lib.buffer_lock(buffer) { |
|
65262
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
225 |
val node_name = resources.node_name(buffer) |
65263
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
226 |
val model = Document_Model.init(session, node_name, buffer) |
65244 | 227 |
for { |
228 |
text_area <- JEdit_Lib.jedit_text_areas(buffer) |
|
75751 | 229 |
if !Document_View.get(text_area).map(_.model).contains(model) |
65244 | 230 |
} Document_View.init(model, text_area) |
231 |
} |
|
232 |
} |
|
233 |
else delay_init.invoke() |
|
234 |
} |
|
235 |
||
66082 | 236 |
PIDE.editor.invoke_generated() |
65244 | 237 |
} |
238 |
} |
|
239 |
||
240 |
def init_view(buffer: Buffer, text_area: JEditTextArea): Unit = |
|
241 |
GUI_Thread.now { |
|
242 |
JEdit_Lib.buffer_lock(buffer) { |
|
76768
40c8275f0131
tuned signature: follow terminology of VSCode_Resources;
wenzelm
parents:
76767
diff
changeset
|
243 |
Document_Model.get_model(buffer) match { |
65244 | 244 |
case Some(model) => Document_View.init(model, text_area) |
245 |
case None => |
|
246 |
} |
|
247 |
} |
|
248 |
} |
|
249 |
||
250 |
def exit_view(buffer: Buffer, text_area: JEditTextArea): Unit = |
|
251 |
GUI_Thread.now { |
|
252 |
JEdit_Lib.buffer_lock(buffer) { |
|
253 |
Document_View.exit(text_area) |
|
254 |
} |
|
255 |
} |
|
256 |
||
257 |
||
34618 | 258 |
/* main plugin plumbing */ |
34433 | 259 |
|
65241 | 260 |
@volatile private var startup_failure: Option[Throwable] = None |
261 |
@volatile private var startup_notified = false |
|
262 |
||
75393 | 263 |
private def init_editor(view: View): Unit = { |
71725
c255ed582095
proper asynchronous GUI interaction for somewhat heavy JEdit_Sessions.session_build check;
wenzelm
parents:
71724
diff
changeset
|
264 |
Keymap_Merge.check_dialog(view) |
66459 | 265 |
Session_Build.check_dialog(view) |
266 |
} |
|
267 |
||
75393 | 268 |
private def init_title(view: View): Unit = { |
68080 | 269 |
val title = |
270 |
proper_string(Isabelle_System.getenv("ISABELLE_IDENTIFIER")).getOrElse("Isabelle") + |
|
75752 | 271 |
"/" + PIDE.resources.session_base.session_name |
68080 | 272 |
val marker = "\u200B" |
273 |
||
274 |
val old_title = view.getViewConfig.title |
|
275 |
if (old_title == null || old_title.startsWith(marker)) { |
|
276 |
view.setUserTitle(marker + title) |
|
277 |
} |
|
278 |
} |
|
279 |
||
75393 | 280 |
override def handleMessage(message: EBMessage): Unit = { |
57612
990ffb84489b
clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents:
57611
diff
changeset
|
281 |
GUI_Thread.assert {} |
39630
44181423183a
explicit Session.Phase indication with associated event bus;
wenzelm
parents:
39628
diff
changeset
|
282 |
|
65241 | 283 |
if (startup_failure.isDefined && !startup_notified) { |
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
284 |
message match { |
75751 | 285 |
case _: EditorStarted => |
51616 | 286 |
GUI.error_dialog(null, "Isabelle plugin startup failure", |
65241 | 287 |
GUI.scrollable_text(Exn.message(startup_failure.get)), |
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
288 |
"Prover IDE inactive!") |
65241 | 289 |
startup_notified = true |
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
290 |
case _ => |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
291 |
} |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
292 |
} |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
293 |
|
65241 | 294 |
if (startup_failure.isEmpty) { |
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
295 |
message match { |
75751 | 296 |
case _: EditorStarted => |
76666 | 297 |
try { resources.session_background.check_errors } |
298 |
catch { |
|
299 |
case ERROR(msg) => |
|
300 |
GUI.warning_dialog(jEdit.getActiveView, |
|
301 |
"Bad session structure: may cause problems with theory imports", |
|
302 |
GUI.scrollable_text(msg)) |
|
66572
1e5ae735e026
tolerate errors in session structure, although this may lead to confusion about theory imports later on;
wenzelm
parents:
66459
diff
changeset
|
303 |
} |
1e5ae735e026
tolerate errors in session structure, although this may lead to confusion about theory imports later on;
wenzelm
parents:
66459
diff
changeset
|
304 |
|
66602
180b2e72601f
more thorough change of syntax style extender: jEdit.propertiesChanged invalidates buffer chunk cache;
wenzelm
parents:
66593
diff
changeset
|
305 |
jEdit.propertiesChanged() |
180b2e72601f
more thorough change of syntax style extender: jEdit.propertiesChanged invalidates buffer chunk cache;
wenzelm
parents:
66593
diff
changeset
|
306 |
|
64602 | 307 |
val view = jEdit.getActiveView() |
71724
522994a6c10e
tuned signature --- avoid confusion with init_view(buffer: Buffer, text_area: JEditTextArea);
wenzelm
parents:
71704
diff
changeset
|
308 |
init_editor(view) |
64602 | 309 |
|
66082 | 310 |
PIDE.editor.hyperlink_position(true, Document.Snapshot.init, |
66973
829c3133c4ca
added isabelle jedit options -B, -P, clarified -R;
wenzelm
parents:
66959
diff
changeset
|
311 |
JEdit_Sessions.logic_root(options.value)).foreach(_.follow(view)) |
61277 | 312 |
|
68080 | 313 |
case msg: ViewUpdate |
314 |
if msg.getWhat == ViewUpdate.CREATED && msg.getView != null => |
|
315 |
init_title(msg.getView) |
|
316 |
||
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
317 |
case msg: BufferUpdate |
64818
67a0a563d2b3
clarified buffer events: exit model while loading;
wenzelm
parents:
64817
diff
changeset
|
318 |
if msg.getWhat == BufferUpdate.LOAD_STARTED || msg.getWhat == BufferUpdate.CLOSING => |
64838 | 319 |
if (msg.getBuffer != null) { |
65244 | 320 |
exit_models(List(msg.getBuffer)) |
66082 | 321 |
PIDE.editor.invoke_generated() |
64838 | 322 |
} |
57611
b6256ea3b7c5
proper change of perspective for removed nodes (stemming from closed buffers);
wenzelm
parents:
57582
diff
changeset
|
323 |
|
64818
67a0a563d2b3
clarified buffer events: exit model while loading;
wenzelm
parents:
64817
diff
changeset
|
324 |
case msg: BufferUpdate |
67a0a563d2b3
clarified buffer events: exit model while loading;
wenzelm
parents:
64817
diff
changeset
|
325 |
if msg.getWhat == BufferUpdate.PROPERTIES_CHANGED || msg.getWhat == BufferUpdate.LOADED => |
65263
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
326 |
if (session.is_ready) { |
55791
5821b1937fa5
clarified init_models: simultaneous initialization of all document models, before flushing edits by regular means (via PIDE.editor.invoke) -- important for consolidated doc_blobs when determining initial edits;
wenzelm
parents:
55784
diff
changeset
|
327 |
delay_init.invoke() |
5821b1937fa5
clarified init_models: simultaneous initialization of all document models, before flushing edits by regular means (via PIDE.editor.invoke) -- important for consolidated doc_blobs when determining initial edits;
wenzelm
parents:
55784
diff
changeset
|
328 |
delay_load.invoke() |
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
329 |
} |
34784
02959dcea756
split Theory_View into Document_Model (connected to Buffer) and Document_View (connected to JEditTextArea);
wenzelm
parents:
34782
diff
changeset
|
330 |
|
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
331 |
case msg: EditPaneUpdate |
60215 | 332 |
if msg.getWhat == EditPaneUpdate.BUFFER_CHANGING || |
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
333 |
msg.getWhat == EditPaneUpdate.BUFFER_CHANGED || |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
334 |
msg.getWhat == EditPaneUpdate.CREATED || |
60215 | 335 |
msg.getWhat == EditPaneUpdate.DESTROYED => |
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
336 |
val edit_pane = msg.getEditPane |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
337 |
val buffer = edit_pane.getBuffer |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
338 |
val text_area = edit_pane.getTextArea |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
339 |
|
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
340 |
if (buffer != null && text_area != null) { |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
341 |
if (msg.getWhat == EditPaneUpdate.BUFFER_CHANGED || |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
342 |
msg.getWhat == EditPaneUpdate.CREATED) { |
65263
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
343 |
if (session.is_ready) |
65244 | 344 |
init_view(buffer, text_area) |
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
345 |
} |
52867
8d8cb75ab20a
more central Pretty_Tooltip.dismissed_all -- avoid spurious crash of Rich_Text_Area.robust_body in asynchronous mouse_motion_listener;
wenzelm
parents:
52816
diff
changeset
|
346 |
else { |
65240 | 347 |
Isabelle.dismissed_popups(text_area.getView) |
65244 | 348 |
exit_view(buffer, text_area) |
52867
8d8cb75ab20a
more central Pretty_Tooltip.dismissed_all -- avoid spurious crash of Rich_Text_Area.robust_body in asynchronous mouse_motion_listener;
wenzelm
parents:
52816
diff
changeset
|
349 |
} |
53274
1760c01f1c78
maintain Completion_Popup.Text_Area as client property like Document_View;
wenzelm
parents:
53272
diff
changeset
|
350 |
|
1760c01f1c78
maintain Completion_Popup.Text_Area as client property like Document_View;
wenzelm
parents:
53272
diff
changeset
|
351 |
if (msg.getWhat == EditPaneUpdate.CREATED) |
1760c01f1c78
maintain Completion_Popup.Text_Area as client property like Document_View;
wenzelm
parents:
53272
diff
changeset
|
352 |
Completion_Popup.Text_Area.init(text_area) |
1760c01f1c78
maintain Completion_Popup.Text_Area as client property like Document_View;
wenzelm
parents:
53272
diff
changeset
|
353 |
|
1760c01f1c78
maintain Completion_Popup.Text_Area as client property like Document_View;
wenzelm
parents:
53272
diff
changeset
|
354 |
if (msg.getWhat == EditPaneUpdate.DESTROYED) |
1760c01f1c78
maintain Completion_Popup.Text_Area as client property like Document_View;
wenzelm
parents:
53272
diff
changeset
|
355 |
Completion_Popup.Text_Area.exit(text_area) |
43510
17d431c92575
init/exit model/view synchronously within the swing thread -- EditBus.send in jedit-4.4.1 always runs there;
wenzelm
parents:
43487
diff
changeset
|
356 |
} |
34784
02959dcea756
split Theory_View into Document_Model (connected to Buffer) and Document_View (connected to JEditTextArea);
wenzelm
parents:
34782
diff
changeset
|
357 |
|
75751 | 358 |
case _: PropertiesChanged => |
62264
340f98836fd9
re-init document views for the sake of Text_Overview size;
wenzelm
parents:
62228
diff
changeset
|
359 |
for { |
73367 | 360 |
view <- JEdit_Lib.jedit_views() |
62264
340f98836fd9
re-init document views for the sake of Text_Overview size;
wenzelm
parents:
62228
diff
changeset
|
361 |
edit_pane <- JEdit_Lib.jedit_edit_panes(view) |
340f98836fd9
re-init document views for the sake of Text_Overview size;
wenzelm
parents:
62228
diff
changeset
|
362 |
} { |
340f98836fd9
re-init document views for the sake of Text_Overview size;
wenzelm
parents:
62228
diff
changeset
|
363 |
val buffer = edit_pane.getBuffer |
340f98836fd9
re-init document views for the sake of Text_Overview size;
wenzelm
parents:
62228
diff
changeset
|
364 |
val text_area = edit_pane.getTextArea |
65244 | 365 |
if (buffer != null && text_area != null) init_view(buffer, text_area) |
62264
340f98836fd9
re-init document views for the sake of Text_Overview size;
wenzelm
parents:
62228
diff
changeset
|
366 |
} |
340f98836fd9
re-init document views for the sake of Text_Overview size;
wenzelm
parents:
62228
diff
changeset
|
367 |
|
65249 | 368 |
spell_checker.update(options.value) |
65263
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
369 |
session.update_options(options.value) |
34784
02959dcea756
split Theory_View into Document_Model (connected to Buffer) and Document_View (connected to JEditTextArea);
wenzelm
parents:
34782
diff
changeset
|
370 |
|
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
371 |
case _ => |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
372 |
} |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
373 |
} |
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
374 |
} |
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
375 |
|
65260 | 376 |
|
377 |
/* mode provider */ |
|
378 |
||
379 |
private var orig_mode_provider: ModeProvider = null |
|
380 |
private var pide_mode_provider: ModeProvider = null |
|
381 |
||
75393 | 382 |
def init_mode_provider(): Unit = { |
65260 | 383 |
orig_mode_provider = ModeProvider.instance |
384 |
if (orig_mode_provider.isInstanceOf[ModeProvider]) { |
|
385 |
pide_mode_provider = new Token_Markup.Mode_Provider(orig_mode_provider) |
|
386 |
ModeProvider.instance = pide_mode_provider |
|
387 |
} |
|
388 |
} |
|
389 |
||
75393 | 390 |
def exit_mode_provider(): Unit = { |
65260 | 391 |
if (ModeProvider.instance == pide_mode_provider) |
392 |
ModeProvider.instance = orig_mode_provider |
|
393 |
} |
|
394 |
||
395 |
||
66019 | 396 |
/* HTTP server */ |
397 |
||
79717 | 398 |
val http_root: String = "/" + UUID.random_string() |
66019 | 399 |
|
75107 | 400 |
val http_server: HTTP.Server = |
75145 | 401 |
HTTP.server(services = Document_Model.Preview_Service :: HTTP.isabelle_services) |
66019 | 402 |
|
403 |
||
65260 | 404 |
/* start and stop */ |
405 |
||
71471
c06604896c3d
more robust shutdown while Isabelle_Process is starting up, e.g. quit after dialog Isabelle version for testing";
wenzelm
parents:
70775
diff
changeset
|
406 |
private val shutting_down = Synchronized(false) |
c06604896c3d
more robust shutdown while Isabelle_Process is starting up, e.g. quit after dialog Isabelle version for testing";
wenzelm
parents:
70775
diff
changeset
|
407 |
|
75393 | 408 |
override def start(): Unit = { |
65257
2307b91159bb
more explicit strict vs. non-strict initialization;
wenzelm
parents:
65256
diff
changeset
|
409 |
/* strict initialization */ |
2307b91159bb
more explicit strict vs. non-strict initialization;
wenzelm
parents:
65256
diff
changeset
|
410 |
|
65262
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
411 |
init_options() |
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
412 |
init_resources() |
65263
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
413 |
init_session() |
65262
0fe4ebab9fdf
resources are part of early/strict initialization, but session_base is permissive to avoid crash of "isabelle jedit -l BAD";
wenzelm
parents:
65261
diff
changeset
|
414 |
PIDE._plugin = this |
65257
2307b91159bb
more explicit strict vs. non-strict initialization;
wenzelm
parents:
65256
diff
changeset
|
415 |
|
2307b91159bb
more explicit strict vs. non-strict initialization;
wenzelm
parents:
65256
diff
changeset
|
416 |
|
2307b91159bb
more explicit strict vs. non-strict initialization;
wenzelm
parents:
65256
diff
changeset
|
417 |
/* non-strict initialization */ |
2307b91159bb
more explicit strict vs. non-strict initialization;
wenzelm
parents:
65256
diff
changeset
|
418 |
|
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
419 |
try { |
65242 | 420 |
completion_history.load() |
65249 | 421 |
spell_checker.update(options.value) |
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
49195
diff
changeset
|
422 |
|
73367 | 423 |
JEdit_Lib.jedit_views().foreach(init_title) |
68080 | 424 |
|
73997 | 425 |
Syntax_Style.set_extender(Syntax_Style.Main_Extender) |
65260 | 426 |
init_mode_provider() |
73367 | 427 |
JEdit_Lib.jedit_text_areas().foreach(Completion_Popup.Text_Area.init) |
53274
1760c01f1c78
maintain Completion_Popup.Text_Area as client property like Document_View;
wenzelm
parents:
53272
diff
changeset
|
428 |
|
73367 | 429 |
http_server.start() |
66019 | 430 |
|
65241 | 431 |
startup_failure = None |
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
432 |
} |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
433 |
catch { |
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
434 |
case exn: Throwable => |
65241 | 435 |
startup_failure = Some(exn) |
436 |
startup_notified = false |
|
62228
6dfe5b12c5b2
report error on internal channel as well: startup_failure dialog may be too late;
wenzelm
parents:
62227
diff
changeset
|
437 |
Log.log(Log.ERROR, this, exn) |
49099
10e899bb6530
more permissive handling of plugin startup failure;
wenzelm
parents:
49098
diff
changeset
|
438 |
} |
66459 | 439 |
|
71471
c06604896c3d
more robust shutdown while Isabelle_Process is starting up, e.g. quit after dialog Isabelle version for testing";
wenzelm
parents:
70775
diff
changeset
|
440 |
shutting_down.change(_ => false) |
c06604896c3d
more robust shutdown while Isabelle_Process is starting up, e.g. quit after dialog Isabelle version for testing";
wenzelm
parents:
70775
diff
changeset
|
441 |
|
66459 | 442 |
val view = jEdit.getActiveView() |
71724
522994a6c10e
tuned signature --- avoid confusion with init_view(buffer: Buffer, text_area: JEditTextArea);
wenzelm
parents:
71704
diff
changeset
|
443 |
if (view != null) init_editor(view) |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
444 |
} |
34618 | 445 |
|
75393 | 446 |
override def stop(): Unit = { |
73367 | 447 |
http_server.stop() |
66019 | 448 |
|
73987
fc363a3b690a
build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents:
73947
diff
changeset
|
449 |
Syntax_Style.set_extender(Syntax_Style.Base_Extender) |
fc363a3b690a
build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents:
73947
diff
changeset
|
450 |
|
65261 | 451 |
exit_mode_provider() |
73367 | 452 |
JEdit_Lib.jedit_text_areas().foreach(Completion_Popup.Text_Area.exit) |
53274
1760c01f1c78
maintain Completion_Popup.Text_Area as client property like Document_View;
wenzelm
parents:
53272
diff
changeset
|
453 |
|
65241 | 454 |
if (startup_failure.isEmpty) { |
65249 | 455 |
options.value.save_prefs() |
65242 | 456 |
completion_history.value.save() |
53337
b3817a0e3211
sort items according to persistent history of frequency of use;
wenzelm
parents:
53277
diff
changeset
|
457 |
} |
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
49195
diff
changeset
|
458 |
|
65244 | 459 |
exit_models(JEdit_Lib.jedit_buffers().toList) |
71471
c06604896c3d
more robust shutdown while Isabelle_Process is starting up, e.g. quit after dialog Isabelle version for testing";
wenzelm
parents:
70775
diff
changeset
|
460 |
|
c06604896c3d
more robust shutdown while Isabelle_Process is starting up, e.g. quit after dialog Isabelle version for testing";
wenzelm
parents:
70775
diff
changeset
|
461 |
shutting_down.change(_ => true) |
65263
c97abf0fa0c1
strict initialization of plugin.session: no user errors to be expected before session.start;
wenzelm
parents:
65262
diff
changeset
|
462 |
session.stop() |
65245 | 463 |
file_watcher.shutdown() |
66458
42d0d5c77c78
more robust shutdown, e.g. when plugin is stopped;
wenzelm
parents:
66351
diff
changeset
|
464 |
PIDE.editor.shutdown() |
73999
6b213c0115f5
clarified global state: allow to deactivate main plugin;
wenzelm
parents:
73998
diff
changeset
|
465 |
|
6b213c0115f5
clarified global state: allow to deactivate main plugin;
wenzelm
parents:
73998
diff
changeset
|
466 |
Document_Model.reset() |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
467 |
} |
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
468 |
} |