| Author | DaveJarvis <email> |
|---|---|
| Date | 2020-07-10 19:17:55 GMT-0700 |
| Commit | c6db50e1b55e53829a3401e924e060971f1f9ff5 |
| Parent | 8a9eead |
| Delta | 13 lines added, 3 lines removed, 10-line increase |
| } | ||
| + /** | ||
| + * Cuts the actively selected text; if no text is selected, this will cut | ||
| + * the entire paragraph. | ||
| + */ | ||
| public void cut() { | ||
| - getEditor().selectParagraph(); | ||
| - getEditor().cut(); | ||
| + final var editor = getEditor(); | ||
| + final var selected = editor.getSelectedText(); | ||
| + | ||
| + if( selected == null || selected.isEmpty() ) { | ||
| + editor.selectParagraph(); | ||
| + } | ||
| + | ||
| + editor.cut(); | ||
| } | ||
| /** | ||
| - * Inserts the variable | ||
| + * Inserts the currently selected variable from the {@link DefinitionPane}. | ||
| */ | ||
| public void injectSelectedItem() { |