Skip to content

Commit

Permalink
completion plugin update #192
Browse files Browse the repository at this point in the history
  • Loading branch information
uliss committed Aug 23, 2023
1 parent 29d1365 commit 3971e6a
Show file tree
Hide file tree
Showing 8 changed files with 859 additions and 822 deletions.
2 changes: 2 additions & 0 deletions ceammc/distrib/dev_sync_tcl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ else
fi

cp -v @PROJECT_SOURCE_DIR@/tcl/*.tcl "${TCL_DIR}/"

cp -v @PROJECT_SOURCE_DIR@/ceammc/gui/plugins/*.tcl "${TCL_DIR}/ceammc"
10 changes: 3 additions & 7 deletions ceammc/distrib/mac/make_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,11 @@ do
copy ${tcl} "${BUNDLE_TCL}/ceammc"
done

section "Copying Tk Completion plugin"
mkdir -p "${BUNDLE_TCL}/completion-plugin"
for tcl in ${SRC_DIR}/ceammc/gui/plugins/completion-plugin/*.tcl
for f in ${SRC_DIR}/ceammc/gui/plugins/completion-plugin/*.@(tcl|cfg|pd)
do
copy ${tcl} "${BUNDLE_TCL}/ceammc"
done

for cfg in ${SRC_DIR}/ceammc/gui/plugins/completion-plugin/*.cfg
do
copy ${cfg} "${BUNDLE_TCL}/ceammc"
copy ${f} "${BUNDLE_TCL}/ceammc"
done

section "Copying Tk Drag-and-Drop plugin"
Expand Down
2 changes: 2 additions & 0 deletions ceammc/gui/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ file(GLOB GUI_PLUGINS "${CMAKE_CURRENT_SOURCE_DIR}/*-plugin.tcl")
list(APPEND GUI_PLUGINS "${CMAKE_CURRENT_SOURCE_DIR}/ceammc_popup_menu_tree.tcl")
file(GLOB GUI_COMPLETION_PLUGIN "${CMAKE_CURRENT_SOURCE_DIR}/completion-plugin/*-plugin.tcl")
list(APPEND GUI_COMPLETION_PLUGIN "${CMAKE_CURRENT_SOURCE_DIR}/completion-plugin/completion.cfg")
list(APPEND GUI_COMPLETION_PLUGIN "${CMAKE_CURRENT_SOURCE_DIR}/completion-plugin/manual.pd")
list(APPEND GUI_COMPLETION_PLUGIN "${CMAKE_CURRENT_SOURCE_DIR}/completion-plugin/COPYING")

install(FILES ${GUI_PLUGINS} ${GUI_COMPLETION_PLUGIN} DESTINATION ${PD_GUI_PLUGINS_PATH}/ceammc)

Expand Down
2 changes: 1 addition & 1 deletion ceammc/gui/plugins/completion-plugin/COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2018 by the respective owner.
Copyright (c) 2011 by the respective owner.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
35 changes: 0 additions & 35 deletions ceammc/gui/plugins/completion-plugin/README.pd

This file was deleted.

1,565 changes: 822 additions & 743 deletions ceammc/gui/plugins/completion-plugin/completion-plugin.tcl

Large diffs are not rendered by default.

37 changes: 1 addition & 36 deletions ceammc/gui/plugins/completion-plugin/completion.cfg
Original file line number Diff line number Diff line change
@@ -1,46 +1,11 @@
# ===== Completion Plugin =====

# you can change this settings on this file but it is recommended to use the plugin menu while using PD

# hotkey for bringing the completion window.
# for syntax check:
# https://www.tcl.tk/man/tcl8.4/TkCmd/bind.htm
# some examples: "Tab", "Control-Alt-space", "Control"
hotkey Tab

# maximum lines shown in completion window
max_lines 16

# completion font family
font DejaVu Sans Mono

# fontsize (it usually looks bigger in the completion window so you might need to use a smaller size here)
font_size 12

# The max depth the plugin will scan for externals when descending a folder tree.
max_scan_depth 1

# Auto complete library names. Example:
# On: "[list-abs/list-compare]"
# Off: "[list-compare]"
auto_complete_libs 1

# ===== Colors =====

# selected completion background color (the color used in the current selected element)
bg #0a85fe

# selected completion background color in the skipping search
skipbg #0ad871

# selected completion background color in the monolithic search
monobg #9832ff
hotkey Tab

# selected completion foreground color
fg white

# ===== Positions =====

# (vertical) offset for the popup position
# this can be needed if your window manager removes title bar (like awesome, etc)
offset 0
28 changes: 28 additions & 0 deletions ceammc/gui/plugins/completion-plugin/manual.pd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#N canvas 414 25 754 641 10;
#X obj 22 59 cnv 11 170 17 empty empty How\ does\ it\ work? 8 9 0 14 #dfdfdf #202020 0;
#X obj 40 15 cnv 11 290 27 empty empty Completion-plugin\ Manual 16 12 0 18 #000000 #ffffff 0;
#X msg 32 573 browse https://github.com/porres/completion-plugin;
#X obj 32 604 pdcontrol;
#X obj 22 247 cnv 11 170 17 empty empty How\ to\ use\ it? 8 9 0 14 #dfdfdf #202020 0;
#X text 376 189 The best practice is to use [declare] in your patch so you do not need to worry about prefixes. Also \, some externals (like 'zexy') are a single binary that do not take a library prefix., f 56;
#X obj 60 484 cnv 11 232 17 empty empty Link\ to\ the\ Repository 17 9 0 14 #000000 #ffffff 0;
#X obj 32 528 bng 30 250 50 0 empty empty empty 0 -8 0 10 #dfdfdf #000000 #000000;
#X text 71 533 <-- browse it;
#X text 376 385 - Clicking on 'Save settings' saves the settings for the next time you open Pd. If you restore to the factory default it is also saved for the next time you open Pd., f 56;
#X text 20 401 There is an extra search mode called "skipping" \, which requires you to start the search with "." (a period). If you type ".mfn" and the hotkey it searches anything that contains the 'm' \, 'f' and 'n' letters in that order. This gives you [makefilename] \, for instance., f 54;
#X text 20 326 Use up/down arrow keys to navigate through suggested selections and press enter to choose it. The object selection is highlighted with a selection color that you can choose in preferences as well. Alternatively you can just click with the left mouse button onto a suggested object name., f 54;
#X text 376 425 - You can click on 'Rescan externals' to rescan for externals \, do this if you installed a new library and don't want to restart Pd., f 56;
#X text 376 465 - Clicking the 'Open Manual' button opens this file., f 56;
#X obj 382 26 cnv 11 55 17 empty empty Hint: 8 9 0 14 #dfdfdf #202020 0;
#X text 443 19 You can type in a library name and hit the hotkey to get all objects from that library. Hitting the hotkey on an empty object gives you ALL objects options!, f 49;
#X text 177 529 Go to the repository for posting bugs and stuff., f 24;
#X obj 382 92 cnv 11 100 17 empty empty Namespaces 8 9 0 14 #dfdfdf #202020 0;
#X text 376 118 When you select the object \, you can press the shift key \, which includes the library name as a prefix. So \, if you have Cyclone \, you can be suggested [cyclone/coll]. If you choose it \, just [coll] is created \, but if you press shift then [cyclone/coll] is created., f 56;
#X text 23 90 - The plugin scans for externals in all usual places like the ones set in "Path->Preferences" and its containing folders. The search looks for help files in order to find externals to suggest. Note that the library name is included as a prefix so you know where the external comes from. The plugin also has a list of internal objects that do not come with a prefix (of course). You can also define your own suggestions in any .txt inside the folder "custom_completions"., f 54;
#X obj 379 319 cnv 11 110 17 empty empty Preferences 8 9 0 14 #000000 #ffffff 0;
#X text 20 272 When typing in an object box \, press the hotkey to see suggestions. The hot key is set in preferences \, which is found in Pd->Preferences->Completion-plugin. The default hotkey is the tab key (TAB)., f 54;
#X text 353 572 <-- Check the completion-plugin readme for more details.;
#X text 376 240 You may want to use a prefix if you have two externals with the same name from different libraries \, like [ceammc/xfade~] and [else/xfade~]. Nonetheless \, you can also just add the prefix yourself after you added the object., f 56;
#X text 376 345 - You can set the hotkey (default TAB). This requires you to save and restart the plugin in order for this change to take effect., f 56;
#X connect 2 0 3 0;
#X connect 7 0 2 0;

0 comments on commit 3971e6a

Please sign in to comment.