Skip to content

Commit

Permalink
coqide: Add “Select All” item in the Edit menu
Browse files Browse the repository at this point in the history
Fixes coq#16141
  • Loading branch information
Frigory33 committed Jul 14, 2023
1 parent 6c052d6 commit f9b0c33
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ide/coqide/coqide.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,8 @@ let build_ui () =
~callback:(cb_on_current_term (fun t -> t.script#undo ()));
item "Redo" ~accel:"<Primary>y" ~stock:`REDO
~callback:(cb_on_current_term (fun t -> t.script#redo ()));
item "Select All" ~accel:"<Primary>a" ~stock:`SELECT_ALL
~callback:(cb_on_current_term (fun t -> t.script#select_all ()));
item "Cut" ~stock:`CUT
~callback:(fun _ -> emit_to_focus w GtkText.View.S.cut_clipboard);
item "Copy" ~stock:`COPY
Expand Down
1 change: 1 addition & 0 deletions ide/coqide/coqide_ui.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ let init () =
<menuitem action='Undo' />
<menuitem action='Redo' />
<separator />
<menuitem action='Select All' />
<menuitem action='Cut' />
<menuitem action='Copy' />
<menuitem action='Paste' />
Expand Down
3 changes: 3 additions & 0 deletions ide/coqide/wg_ScriptView.ml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ object (self)
} in
Gobject.set prop obj show

method select_all () =
self#buffer#select_range self#buffer#start_iter self#buffer#end_iter

method comment () =
let rec get_line_start iter =
if iter#starts_line then iter
Expand Down
1 change: 1 addition & 0 deletions ide/coqide/wg_ScriptView.mli
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ object
method set_right_margin_position : int -> unit
method show_right_margin : bool
method set_show_right_margin : bool -> unit
method select_all : unit -> unit
method comment : unit -> unit
method uncomment : unit -> unit
method apply_unicode_binding : unit -> unit
Expand Down

0 comments on commit f9b0c33

Please sign in to comment.