lib/input_sequencer.rb in markdown_exec-2.4.0 vs lib/input_sequencer.rb in markdown_exec-2.5.0
- old
+ new
@@ -92,15 +92,22 @@
# self.imw_ins now_menu, 'now_menu'
break if exit_when_bq_empty && bq_is_empty? && !now_menu.prior_block_was_link
if now_menu.display_menu
+ # !!b
+ break if run_yield(:end_of_cli, &block) == :exit
+ # !!b
+
exit_when_bq_empty = false
run_yield :display_menu, &block
+ # !!b
choice = run_yield :user_choice, &block
+ # !!b
break if choice == :break
+ # !!b
raise BlockMissing, 'Block not recognized.' if choice.nil?
# Exit loop and method to terminate the app
break if run_yield(:exit?, choice&.to_s.downcase, &block)
@@ -111,11 +118,16 @@
next_menu = next_state
else
if now_menu.block_name && !now_menu.block_name.empty?
block_name = now_menu.block_name
else
- break if bq_is_empty? # Exit loop if no more blocks to process
+ # break if bq_is_empty? # Exit loop if no more blocks to process
+ if bq_is_empty? # Exit loop if no more blocks to process
+ # !!b
+ run_yield :end_of_cli, &block
+ break
+ end
block_name = @block_queue.shift
end
# self.imw_ins block_name, 'block_name'
@@ -132,9 +144,11 @@
next_menu
# imw_ins next_menu, 'next_menu'
end
now_menu = InputSequencer.merge_link_state(now_menu, next_menu)
end
+
+ # run_yield :end_of_cli, &block
run_yield :close_ux, &block
end
end