···1919 | Prompt of string * cmd_args
2020 | Selection_prompt of
2121 string
2222- * (unit-> 'a Nottui.W.Lists.selectable_item list Lwd.t)
2222+ * (unit -> 'a Nottui.W.Lists.selectable_item list Lwd.t)
2323 * (string -> 'a -> bool)
2424 * ('a -> 'a command_variant)
2525 | Prompt_r of string * cmd_args
···9090 :: render_commands ~indent_level:(indent_level + 1) subs
9191 ;;
92929393- let commands_list_ui ?(include_arrows=false) commands =
9393+ let commands_list_ui ?(include_arrows = false) commands =
9494 let move_command =
9595 render_command_line
9696 ~indent_level:0
9797 ("Alt+Arrows" |> String.to_seq |> Seq.map Uchar.of_char |> Array.of_seq)
9898 "navigation between windows"
9999 in
100100- (commands |> render_commands) @ (if include_arrows then [move_command] else[] )
100100+ ((commands |> render_commands) @ if include_arrows then [ move_command ] else [])
101101 |> I.vcat
102102 |> Ui.atom
103103 |> Lwd.pure
···140140 $= Some
141141 W.Overlay.
142142 {
143143- items=items()
143143+ items = items ()
144144 ; filter_predicate
145145 ; label = str
146146 ; on_exit =
···205205 (** Try mapching the command mapping to the provided key and run the command if it matches *)
206206 and command_input ~is_sub keymap key =
207207 (* Use exceptions so we can break out of the list*)
208208+ let input = Lwd.peek ui_state.input in
208209 try
209210 keymap
210211 |> List.iter (fun cmd ->
···212213 `Unhandled
213214 with
214215 | Handled ->
215215- if is_sub then ui_state.input $= `Normal;
216216+ (*If this is a sub command and we didn't change to some other subcommand we should exit back to normal command operation*)
217217+ if is_sub && input == Lwd.peek ui_state.input then ui_state.input $= `Normal;
216218 `Handled
217219 | Jj_process.JJError (cmd, error) ->
218220 handle_jj_error cmd error;
···249251 ; cmd =
250252 Fun
251253 (fun _ ->
252252- ui_state.show_popup $= Some (commands_list_ui ~include_arrows:true default_list, "Help");
254254+ ui_state.show_popup
255255+ $= Some (commands_list_ui ~include_arrows:true default_list, "Help");
253256 ui_state.input $= `Mode (fun _ -> `Unhandled))
254257 }
255258 ]
···262265 let confirm_prompt prompt cmd =
263266 SubCmd [ { key = 'y'; description = "Yes I want to " ^ prompt; cmd } ]
264267 ;;
268268+265269 (** Handles raw command mapping without regard for modes or the current intput state. Should be used when setting a new input mode*)
266266- let command_input=command_input;;
270270+ let command_input = command_input
267271268272 (** Handles input and sub_commands.*)
269273 let handleInputs command_mapping =