From 5b13384e1b5bd4f11f22036f4eb83c63a4ae88c2 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Mon, 29 Oct 2018 15:48:47 +0100 Subject: 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 --- ide/preferences.ml | 15 ++++++++++----- 1 file 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:"" ~repr:Repr.(string) -let _ = attach_modifiers modifier_for_navigation "/Navigation/" -let _ = attach_modifiers modifier_for_templates "/Templates/" -let _ = attach_modifiers modifier_for_tactics "/Tactics/" -let _ = attach_modifiers modifier_for_display "/View/" -let _ = attach_modifiers modifier_for_queries "/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 "/Navigation/" in + let _ = attach_modifiers modifier_for_templates "/Templates/" in + let _ = attach_modifiers modifier_for_tactics "/Tactics/" in + let _ = attach_modifiers modifier_for_display "/View/" in + let _ = attach_modifiers modifier_for_queries "/Queries/" in + () let modifiers_valid = new preference ~name:["modifiers_valid"] ~init:"" ~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 () -- cgit v1.2.3