Vi edit mode: cross phrase register support
This commit is contained in:
parent
952f97a460
commit
c0109a6da6
|
@ -718,14 +718,20 @@ let execute_phrase = Toploop.execute_phrase
|
||||||
| Main loop |
|
| Main loop |
|
||||||
+-----------------------------------------------------------------+ *)
|
+-----------------------------------------------------------------+ *)
|
||||||
|
|
||||||
|
let registers= ref LTerm_vi.Vi.Interpret.RegisterMap.empty
|
||||||
|
|
||||||
let rec read_phrase term =
|
let rec read_phrase term =
|
||||||
Lwt.catch
|
Lwt.catch
|
||||||
(fun () ->
|
(fun () ->
|
||||||
let read_line= new read_phrase ~term in
|
let read_line= new read_phrase ~term in
|
||||||
(match !UTop.edit_mode with
|
(match !UTop.edit_mode with
|
||||||
| LTerm_editor.Default-> ()
|
| LTerm_editor.Default-> ()
|
||||||
| LTerm_editor.Vi as mode-> read_line#set_editor_mode mode);
|
| LTerm_editor.Vi as mode-> read_line#set_editor_mode mode);
|
||||||
read_line#run)
|
let vi_state= read_line#vi_state in
|
||||||
|
vi_state#set_registers !registers;
|
||||||
|
read_line#run >>= fun result->
|
||||||
|
registers:= vi_state#get_registers;
|
||||||
|
return result)
|
||||||
(function
|
(function
|
||||||
| Sys.Break ->
|
| Sys.Break ->
|
||||||
LTerm.fprintl term "Interrupted." >>= fun () ->
|
LTerm.fprintl term "Interrupted." >>= fun () ->
|
||||||
|
|
Loading…
Reference in New Issue