examples/dsl_editor.rb in vedeu-0.6.46 vs examples/dsl_editor.rb in vedeu-0.6.47
- old
+ new
@@ -31,11 +31,11 @@
x use(:editor_view).left
y use(:editor_view).south
end
end
- # When pressing Return/Enter in the editor view, the :_command_
+ # When pressing Escape in the editor view, the :_command_
# event will be triggered with any typed content you have provided.
#
# 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.
@@ -43,11 +43,12 @@
# Vedeu.bind(:command) do |data|
# # ... do something with 'data'
# end
#
Vedeu.keymap :editor_view do
- key(:enter) { Vedeu.trigger(:_editor_execute_, :editor_view) }
+ key(:escape) { Vedeu.trigger(:_editor_execute_, :editor_view) }
+ key(:enter) { Vedeu.trigger(:_editor_insert_line_, :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}")
@@ -65,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 'and press Escape. This will trigger the'
line ':command event with the contents of '
line 'the view.'
# @todo Not implemented yet:
#