HenriAugusto / completion-plugin

Completion for Pure Data
BSD 3-Clause "New" or "Revised" License
19 stars 1 forks source link

Plugin should get the object text at each update? #29

Open HenriAugusto opened 4 years ago

HenriAugusto commented 4 years ago

Problem:

  1. Create an box
  2. type li
  3. select the liwith the mouse
  4. trigger the pluggin
  5. type n
  6. plugin will display line, line~, and vline~ (and others depending on what you have installed)
  7. but object will only have an n since li was selected

(but the autocomplete at least will type the correct text for you :smile: )

Maybe a solution would be to actually query the object text after each key is pressed.

HenriAugusto commented 4 years ago

In ::completion::insert_key I've tried adding

set ::current_text [$::current_canvas itemcget $::current_tag -text]

instead of

append ::current_text $key

but it doesn't work. The plugin will always be "one char late" in comparison with what is in the box.