class RatatuiRuby::Event::Paste

Encapsulates pasted text.

Users frequently paste text into terminals. Without specific handling, a paste appears as a flood of rapid keystrokes, often triggering accidental commands or confusing the input state.

This event makes pasting safe. It groups the entire inserted block into a single atomic action.

Handle this event to support bulk text insertion cleanly. Insert the content directly into your field or buffer without triggering per-character logic.

Examples

Using predicates:

if event.paste?
  puts "Pasted: #{event.content}"
end

Using pattern matching:

case event
in type: :paste, content:
  puts "Pasted: #{content}"
end