/jEdit/tags/jedit-4-3-pre5/macros/Clipboard/Copy_Selection_or_Line.bsh
Unknown | 34 lines | 29 code | 5 blank | 0 comment | 0 complexity | 0aa4b0beab9076d5599f6feb84954d6f MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- /*
- * Copy_Selection_or_Line.bsh - a BeanShell macro for jEdit
- * which copies either the selected text, or the current line
- * if no text is selected, to the clipboard.
- *
- * Copyright (C) 2003 Ollie Rutherfurd <oliver@jedit.org>
- *
- * $Id: Copy_Selection_or_Line.bsh 5098 2004-08-03 21:31:48Z orutherfurd $
- */
- copySelectionOrLine(){
- selections = textArea.getSelection();
- if(selections.length == 0){
- textArea.smartHome(false);
- textArea.smartEnd(true);
- }
- Registers.copy(textArea,'$');
- }
- copySelectionOrLine();
- /*
- Macro index data (in DocBook format)
- <listitem>
- <para><filename>Copy_Selection_or_Line.bsh</filename>
- <abstract><para>
- If no text is selected, the current line is copied to
- the clipboard, otherwise the selected text is copied
- to the clipboard.
- </para></abstract>
- </listitem>
- */