elvish-mode-bindings.patch 724 B

12345678910111213141516171819
  1. diff --git a/pkg/cli/modes/mode.go b/pkg/cli/modes/mode.go
  2. index c1def4f5..0ce3ce69 100644
  3. --- a/pkg/cli/modes/mode.go
  4. +++ b/pkg/cli/modes/mode.go
  5. @@ -17,9 +17,13 @@ var ErrFocusedWidgetNotCodeArea = errors.New("focused widget is not a code area"
  6. // FocusedCodeArea returns a CodeArea widget if the currently focused widget is
  7. // a CodeArea. Otherwise it returns the error ErrFocusedWidgetNotCodeArea.
  8. func FocusedCodeArea(a cli.App) (tk.CodeArea, error) {
  9. - if w, ok := a.FocusedWidget().(tk.CodeArea); ok {
  10. + widget := a.FocusedWidget()
  11. + if w, ok := widget.(tk.CodeArea); ok {
  12. return w, nil
  13. }
  14. + if w, ok := widget.(tk.ComboBox); ok {
  15. + return w.CodeArea(), nil
  16. + }
  17. return nil, ErrFocusedWidgetNotCodeArea
  18. }