1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
/*
* Copy_Visible_Lines.bsh - Copies visible (non-folded) lines from
* the current buffer to the clipboard.
*
* Copyright (C) 2002-2004 Ollie Rutherfurd <oliver@jedit.org>
*
* $Id: Copy_Visible_Lines.bsh 5098 2004-08-03 21:31:48Z orutherfurd $
*/
void copyVisibleLines(View view){
JEditTextArea textArea = view.getTextArea();
DisplayManager dm = textArea.getDisplayManager();
StringBuffer buff = new StringBuffer();
for(int i=0; i < buffer.getLineCount(); i++){
if(dm.isLineVisible(i))
buff.append(textArea.getLineText(i)).append('\n');
}
Registers.setRegister('$', buff.toString());
}
copyVisibleLines(view);
/*
<listitem>
<para><filename>Copy_Visible_Lines.bsh</filename></para>
<abstract><para>Copies the visible lines from the current
buffer to the Clipboard. Lines that are not visible
becuase they are folded are not copied.
</para></abstract>
</listitem>
*/
|