Class: Tuile::EventQueue::PasteEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/tuile/event_queue.rb,
sig/tuile.rbs

Overview

Text arrived from the clipboard rather than the keyboard: the terminal bracketed it in Keys::PASTE_STARTKeys::PASTE_END because Screen#run_event_loop enabled mode 2004. The whole paste is one event, so a component sees one mutation instead of a keystroke per character — and a pasted line break can no longer be mistaken for a typed Enter.

Screen#event_loop routes it to Component#handle_paste down the focus chain. It never enters the key ladder: no Tab traversal, no global shortcut, no Component#handle_key.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text:) ⇒ PasteEvent

@param text

Parameters:

  • text: (String)


185
186
187
# File 'lib/tuile/event_queue.rb', line 185

def initialize(text:)
  super(text: text.freeze)
end

Instance Attribute Details

#textString (readonly)

@return — the pasted text, \n-normalized by Keys.normalize_paste.

Returns:

  • (String)


183
184
185
186
187
188
# File 'lib/tuile/event_queue.rb', line 183

class PasteEvent < Data.define(:text)
  # @param text [String]
  def initialize(text:)
    super(text: text.freeze)
  end
end