A question - if I need to shut down xretrace before the plugin is loaded so that the timer callback doesn't misbehave, is the definit and _on_load_module_xretrace that I have below ok for this.
void _on_load_module_xretrace(_str module_name)
{
_str sm = strip(module_name, "B", "\'\"");
if (strip_filename(sm, 'PD') == 'xretrace.e') {
xretrace_kill_timer();
xretrace_clear_all_markers();
}
}
definit()
{
//myerror();
if (arg(1)=="L") {
//If this is NOT an editor invocation
xretrace_load_config();
xretrace_kill_timer();
//buffer_history_suspend = true;
// this shouldn't be necessary because _on_load_module does it
xretrace_clear_all_markers();
buffer_retrace_cursor_list._makeempty();
buffer_retrace_modified_lines_list._makeempty();
buffer_bookmark_list._makeempty();
}
files_active_since_startup._makeempty();
retrace_no_re_entry = 0;
goback_is_loaded = false;
if (def_xretrace_no_delayed_start && !file_exists(_ConfigPath() :+ 'DontRunMyMacros.txt')) {
init_xretrace();
xretrace_not_running = false;
} else {
xretrace_not_running = true;
xretrace_has_been_started_id = 0;
}
}
_command void xretrace_kill_timer() name_info(',')
{
if ( retrace_timer_handle != -1 ) {
_kill_timer(retrace_timer_handle);
retrace_timer_handle = -1;
}
}