Smart Copy/Cut/Paste Text macro for JEdit (v1.0 rerelease 2004/04/06)

A set of three simple bean shell macros that are designed to replace the built in copy/cut/paste functions in JEdit. They basically allow for treating the current line as selected if there is no selection. Detailed behaviour follows below. I map these to ctrl-c/ctrl-x/ctrl-v and map the toolbar buttons to these.

The three macros are in a zip file so that all 3 travel together as they are only useful as a set.

Tested on JEdit 4.1pre2 4.1pre7
There is no change to code from previous release on JEdit community site

Copy/Cut Standard Feature
If a selection exists then copy and cut apply to that selection.
Copy/Cut Extra Feature
If no selection exists then copy and cut make a copy or cut of the line the caret is on.
Paste Standard Feature
If a selection exists it is replaced with contents of copy buffer. If no selection exists and the copy buffer contains a standard copy/cut buffer (not a default copy or cut of the current line when copy buffer was created) then the contents of the copy buffer are inserted at the caret.
Paste Extra Feature
If no selection exists and the copy buffer contains a smart copy/cut buffer (a default copy or cut of the current line when copy buffer was created) then the contents of the copy buffer are inserted as a line before the line the caret is on. The caret is not moved from its position just the line of data is inserted prior to the line the caret is on.