Closed 60-hz closed 4 years ago
When you click save do you get any error messages?
If not, can you search your file system for completion.cfg to see if it is being written somewhere not expected?
No error message.
My completion plugin is in a classic path: user/Document/Pd/externals/completion-plugin
I see that a completion.cfg is written in user/Document/Pd/externals/completion.cfg But it is shorter than the one in user/Document/Pd/externals/completion-plugin:
This file was generated by PD AutoComplete in the absence of the original file that comes with the plugin.
hotkey Control-space max_lines 20 font DejaVu Sans Mono font_size 12 max_scan_depth 1 auto_complete_libs 1 bg #ff0000 fg white skipbg #0ad871 monobg #9832ff offset 0
Oh, i think i get it!
My theory:
The problem is with the current_plugin_loadpath
variable. You are probably loading another plugin (or even a duplicate version of the completion-plugin as in #25 ) and this is messing with this variable because it is set in the pd-gui.tcl
code even if the plugin is not loaded
proc load_startup_plugins {} {
[...]
# load other installed plugins
foreach pathdir [concat $::sys_searchpath $::sys_temppath $::sys_staticpath] {
set dir [file normalize $pathdir]
if { ! [file isdirectory $dir]} {continue}
foreach filename [glob -directory $dir -nocomplain -types {f} -- \
*-plugin/*-plugin.tcl *-plugin.tcl] {
set ::current_plugin_loadpath [file dirname $filename]
load_plugin_script $filename
}
}
}
proc load_plugin_script {filename} {
global errorInfo
set basename [file tail $filename]
if {[lsearch $::loaded_plugins $basename] > -1} {
::pdwindow::post [_ "'$basename' already loaded, ignoring: '$filename'\n"]
return
}
[...]
}
I've just realized the plugin is reading this global variable when it actually should have saved it's value in the plugin's initialization.
To test my theory:
completion-plugin.tcl
and see if you find duplicates of the plugin itself.Ok, I think you guessed right. Some other plugins are in conflict with completion-plugins settings, so I removed all and everything looks ok.
For exemple dnd-plugin, Trigerize and Patcherize plugins are saving completion-plugin.cfg in their own folders, so it breaks the settings restoration.
I've put a fix in 0.47.1. It should be on Deken soon or you can get it on the releases page.
Also, you might be interested in issue #32
I tried to go change the hotkey in prefs (because on OSX control+space lead to spotlight search) and font size to 12, but nothing is saved even when I click "save to file" and restart. Editing completion.cfg file is ok.
Also clicking "Default" changed back the font size but not the hotkey.
OSX 10.9.5, pd 0.50, completion-plugin version 0.47.0-test1