Class Redwood::BufferManager
In: lib/sup/buffer.rb
Parent: Object

Methods

Included Modules

Singleton

Constants

CONTINUE_IN_BUFFER_SEARCH_KEY = "n"   we have to define the key used to continue in-buffer search here, because it has special semantics that BufferManager deals with—current searches are canceled by any keypress except this one.

Attributes

focus_buf  [R] 

Public Class methods

Public Instance methods

for simplicitly, we always place the question at the very bottom of the screen

returns true (y), false (n), or nil (ctrl-g / cancel)

a little tricky because we can‘t just delete_at id because ids are relative (they‘re positions into the array).

turns an input keystroke into an action symbol. returns the action if found, nil if not found, and throws InputSequenceAborted if the user aborted a multi-key sequence. (Because each of those cases should be handled differently.)

this is in BufferManager because multi-key sequences require prompting.

we reset force_to_top when rolling buffers. this is so that the human can actually still move buffers around, while still programmatically being able to pop stuff up in the middle of drawing a window without worrying about covering it up.

if we ever start calling roll_buffers programmatically, we will have to change this. but it‘s not clear that we will ever actually do that.

requires the mode to have done? and value methods

if the named buffer already exists, pops it to the front without calling the block. otherwise, gets the mode from the block and creates a new buffer. returns two things: the buffer, and a boolean indicating whether it‘s a new buffer or not.

[Validate]