but how useful is this over setting data on the ScintillaWidget
I've done that before too. With Geany's current architecture where the model and view are so tightly bound, it's effectively the same. The main difference is the `plugin_` functions in this PR which provide the helper API to namespace the data and to remove it when the plugin is unloaded.
As previously mentioned, I'm not fixed on the particular implementation in the PR, I'm only really interested in the `plugin_` API functions, which I think allow the implementation to be done differently without affecting anything.
So yeah, until Geany is re-architected in a way that there's no 1:1 relationship between documents and Scintilla widgets, doing it that way would work. It would make the tiny ce6c0fad9481549c62c308a42ccfe774bacf3b55 commit not required, and require re-working 7b2b9609e473bdc591010a68794df46dac52e1be to operate on the Scintilla widgets' keyed data lists (assuming it's possible to access them in the same way).