diff options
| author | Hugo Herbelin | 2018-10-29 15:48:47 +0100 |
|---|---|---|
| committer | Hugo Herbelin | 2019-09-10 12:03:18 +0200 |
| commit | 5b13384e1b5bd4f11f22036f4eb83c63a4ae88c2 (patch) | |
| tree | 34ece0e165462d5910979a4d36b5663049839dde | |
| parent | 29592216820248bfc78b137595fdd5e31d28f5b6 (diff) | |
Fixing #8269: adding callback on changed modifiers only after pref loading.
Otherwise, probably for the reason suspected in [1], loading the
preference file (coqiderc) is interpreted as a change of the
modifiers, and this overrides what the more fine-grained preferences
(coqide.keys) was telling.
[1] https://github.com/coq/coq/issues/8269#issuecomment-415971367
| -rw-r--r-- | ide/preferences.ml | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ide/preferences.ml b/ide/preferences.ml index bf9fe8922a..ed51eb0b91 100644 --- a/ide/preferences.ml +++ b/ide/preferences.ml @@ -347,11 +347,15 @@ let modifier_for_display = let modifier_for_queries = new preference ~name:["modifier_for_queries"] ~init:"<Control><Shift>" ~repr:Repr.(string) -let _ = attach_modifiers modifier_for_navigation "<Actions>/Navigation/" -let _ = attach_modifiers modifier_for_templates "<Actions>/Templates/" -let _ = attach_modifiers modifier_for_tactics "<Actions>/Tactics/" -let _ = attach_modifiers modifier_for_display "<Actions>/View/" -let _ = attach_modifiers modifier_for_queries "<Actions>/Queries/" +let attach_modifiers_callback () = + (* Tell to propagate changes done in preference menu to accel map *) + (* To be done after the preferences are loaded *) + let _ = attach_modifiers modifier_for_navigation "<Actions>/Navigation/" in + let _ = attach_modifiers modifier_for_templates "<Actions>/Templates/" in + let _ = attach_modifiers modifier_for_tactics "<Actions>/Tactics/" in + let _ = attach_modifiers modifier_for_display "<Actions>/View/" in + let _ = attach_modifiers modifier_for_queries "<Actions>/Queries/" in + () let modifiers_valid = new preference ~name:["modifiers_valid"] ~init:"<Alt><Control><Shift>" ~repr:Repr.(string) @@ -665,6 +669,7 @@ let load_pref () = in Util.String.Map.iter iter m in (* Load file for bindings *) + attach_modifiers_callback () let () = try GtkData.AccelMap.load loaded_accel_file with _ -> () in () |
