lib/textbringer/commands/windows.rb in textbringer-1.0.9 vs lib/textbringer/commands/windows.rb in textbringer-1.1.0
- old
+ new
@@ -82,18 +82,18 @@
else
raise EditorError, "No such buffer: #{buffer}"
end
end
- define_command(:list_buffers, doc: <<~EOD) do
+ define_command(:list_buffers, doc: <<~EOD) do |buffers = Buffer.list|
List the existing buffers.
EOD
buffer = Buffer.find_or_new("*Buffer List*",
undo_limit: 0, read_only: true)
buffer.apply_mode(BufferListMode)
buffer.read_only_edit do
buffer.clear
- buffer.insert(Buffer.list.map(&:name).join("\n"))
+ buffer.insert(buffers.map(&:name).join("\n"))
buffer.beginning_of_buffer
end
switch_to_buffer(buffer)
end