@@ -69,10 +69,11 @@ func (self *GlobalController) GetKeybindings(opts types.KeybindingsOpts) []*type
6969			Modifier : gocui .ModNone ,
7070			// we have the description on the alt key and not the main key for legacy reasons 
7171			// (the original main key was 'x' but we've reassigned that to other purposes) 
72- 			Description :      self .c .Tr .OpenKeybindingsMenu ,
73- 			Handler :          self .createOptionsMenu ,
74- 			ShortDescription : self .c .Tr .Keybindings ,
75- 			DisplayOnScreen :  true ,
72+ 			Description :       self .c .Tr .OpenKeybindingsMenu ,
73+ 			Handler :           self .createOptionsMenu ,
74+ 			ShortDescription :  self .c .Tr .Keybindings ,
75+ 			DisplayOnScreen :   true ,
76+ 			GetDisabledReason : self .optionsMenuDisabledReason ,
7677		},
7778		{
7879			ViewName :    "" ,
@@ -156,6 +157,17 @@ func (self *GlobalController) createOptionsMenu() error {
156157	return  (& OptionsMenuAction {c : self .c }).Call ()
157158}
158159
160+ func  (self  * GlobalController ) optionsMenuDisabledReason () * types.DisabledReason  {
161+ 	ctx  :=  self .c .Context ().Current ()
162+ 	// Don't show options menu while displaying popup. 
163+ 	if  ctx .GetKind () ==  types .PERSISTENT_POPUP  ||  ctx .GetKind () ==  types .TEMPORARY_POPUP  {
164+ 		// The empty error text is intentional. We don't want to show an error 
165+ 		// toast for this, but only hide it from the options map. 
166+ 		return  & types.DisabledReason {Text : "" }
167+ 	}
168+ 	return  nil 
169+ }
170+ 
159171func  (self  * GlobalController ) createFilteringMenu () error  {
160172	return  (& FilteringMenuAction {c : self .c }).Call ()
161173}
0 commit comments