Sha256: 94e52ff864049428302ed8bc2fe6da09d64380e632f129098bdf3c850954280a

Contents?: true

Size: 551 Bytes

Versions: 10

Compression:

Stored size: 551 Bytes

Contents

module Textbringer
  class BufferListMode < Mode
    define_keymap :BUFFER_LIST_MODE_MAP
    BUFFER_LIST_MODE_MAP.define_key("\C-m", :this_window_command)

    def initialize(buffer)
      super(buffer)
      buffer.keymap = BUFFER_LIST_MODE_MAP
    end

    define_local_command(:this_window,
                         doc: "Change the current account.") do
      name = @buffer.save_excursion {
        @buffer.beginning_of_line
        @buffer.looking_at?(/.*/)
        @buffer.match_string(0)
      }
      switch_to_buffer(name)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
textbringer-1.4.1 lib/textbringer/modes/buffer_list_mode.rb
textbringer-1.3.0 lib/textbringer/modes/buffer_list_mode.rb
textbringer-1.2.0 lib/textbringer/modes/buffer_list_mode.rb
textbringer-1.1.2 lib/textbringer/modes/buffer_list_mode.rb
textbringer-1.1.1 lib/textbringer/modes/buffer_list_mode.rb
textbringer-1.1.0 lib/textbringer/modes/buffer_list_mode.rb
textbringer-1.0.9 lib/textbringer/modes/buffer_list_mode.rb
textbringer-1.0.4 lib/textbringer/modes/buffer_list_mode.rb
textbringer-1.0.3 lib/textbringer/modes/buffer_list_mode.rb
textbringer-1.0.2 lib/textbringer/modes/buffer_list_mode.rb