examples/dsl_editor.rb in vedeu-0.6.39 vs examples/dsl_editor.rb in vedeu-0.6.40
- old
+ new
@@ -6,10 +6,11 @@
class EditorApp
Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
Vedeu.configure do
+ debug!
log '/tmp/editor.log'
renderers Vedeu::Renderers::File.new(filename: '/tmp/editor.out')
fake!
end
@@ -33,19 +34,26 @@
end
# When pressing Return/Enter in the editor view, the :_command_
# event will be triggered with any typed content you have provided.
#
- # Bind to this event to retrieve the content entered, and then
- # process yourself in whatever way appropriate.
+ # The :_command_ event in turn triggers the :command event. Bind to
+ # :command to retrieve the content entered, and then process
+ # yourself in whatever way appropriate.
#
- # Vedeu.bind(:_command_) do |data|
+ # Vedeu.bind(:command) do |data|
# # ... do something with 'data'
# end
#
Vedeu.keymap :editor_view do
key(:enter) { Vedeu.trigger(:_editor_execute_, :editor_view) }
+ key(:insert) do
+ Vedeu.log(type: :debug,
+ message: "Commands: #{Vedeu.all_commands.inspect}")
+ Vedeu.log(type: :debug,
+ message: "Keypresses: #{Vedeu.all_keypresses.inspect}")
+ end
end
Vedeu.keymap '_global_' do
key('q') { Vedeu.exit }
end
@@ -58,10 +66,10 @@
Vedeu.render do
view(:help_view) do
lines do
line 'Type into the editor dialog above,'
line 'and press Return. This will trigger the'
- line ':_command_ event with the contents of '
+ line ':command event with the contents of '
line 'the view.'
# @todo Not implemented yet:
#
# text 'Type into the editor dialog above, and press Return. This will ' \