class Reline::KillRing
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/reline/kill_ring.rbs class Reline::KillRing def process: () -> nil end
def append(string, before_p = false)
def append(string, before_p = false) case @state when State::FRESH, State::YANK @ring << RingPoint.new(string) @state = State::CONTINUED when State::CONTINUED, State::PROCESSED if before_p @ring.head.str.prepend(string) else @ring.head.str.concat(string) end @state = State::CONTINUED end end
def each
def each start = head = @ring.head loop do break if head.nil? yield head.str head = head.backward break if head == start end end
def initialize(max = 1024)
def initialize(max = 1024) @ring = RingBuffer.new(max) @ring_pointer = nil @buffer = nil @state = State::FRESH end
def process
Experimental RBS support (using type sampling data from the type_fusion
project).
def process: () -> nil
This signature was generated using 2 samples from 1 application.
def process case @state when State::FRESH # nothing to do when State::CONTINUED @state = State::PROCESSED when State::PROCESSED @state = State::FRESH when State::YANK # nothing to do end end
def yank
def yank unless @ring.empty? @state = State::YANK @ring_pointer = @ring.head @ring_pointer.str else nil end end
def yank_pop
def yank_pop if @state == State::YANK prev_yank = @ring_pointer.str @ring_pointer = @ring_pointer.backward [@ring_pointer.str, prev_yank] else nil end end