Page 1 of 1

Possible to add paste-from-clipboard to Code Template variables?

Posted: Fri Jan 27, 2017 11:28 pm
by dsewell
Would it be possible to extend the code template utility so that one can have the current system clipboard contents pasted into a specific point? For an example, I have a template that allows me to select text so I can add a target URL:

Code: Select all

<a href="${caret}">${selection}</ref>
That puts my cursor at the point where I can paste the clipboard manually. A nice shortcut for this would be

Code: Select all

<a href="${clipboard}">${selection}</ref>
so that the pasting happens automatically. I realize that it saves me only one keystroke but if I have to do this repetitively, any savings of time is helpful. If it would be easy to implement, perhaps consider.

Re: Possible to add paste-from-clipboard to Code Template variables?

Posted: Mon Jan 30, 2017 10:27 am
by Radu
Hi David,

We do have some plans for such an editor variable, probably we'll do this in Oxygen 19.1 this summer. We'll update the forum thread when we do.
In the meantime we have API which allows registering resolvers for custom editor variables. And one of the sample Javascript-based plugins for Oxygen that I created:

https://github.com/oxygenxml/wsaccess-j ... le-plugins

is called customEditorVariables and it does exactly what you want, it expands the ${clipboard} editor variable.
So you can try to install that plugin.

Regards,
Radu

Re: Possible to add paste-from-clipboard to Code Template variables?

Posted: Mon Jan 30, 2017 5:39 pm
by dsewell
Very good, thank you!