Package org.aesh.readline.paste
Class PasteManager
java.lang.Object
org.aesh.readline.paste.PasteManager
Keep track of edits for paste
- Author:
- Ståle W. Pedersen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddText(int[] buffer) int[]get(int index) Retrieves text from the paste stack at the specified index.voidsetClipboardWriter(Consumer<int[]> clipboardWriter) Sets a callback that is invoked whenever text is added to the paste stack.
-
Constructor Details
-
PasteManager
public PasteManager()Creates a new PasteManager with an empty paste stack.
-
-
Method Details
-
setClipboardWriter
Sets a callback that is invoked whenever text is added to the paste stack. Used to write killed/copied text to the system clipboard via OSC 52.- Parameters:
clipboardWriter- the callback to invoke with the added text, or null to disable
-
addText
public void addText(int[] buffer) -
get
public int[] get(int index) Retrieves text from the paste stack at the specified index. Index 0 returns the most recently added text.- Parameters:
index- the index in the paste stack (0 = most recent)- Returns:
- the text buffer at the specified index, or the oldest entry if index is out of bounds
-