Skip to content

Don't reset state when the target frame is a childframe #145

Description

@certainty

First of all, thanks for making boon publicly available. I really enjoy using it thus far.

I'm using corfu and I noticed, that when the corfu childframe is created, boon resets the state of the buffer to command state.

This is expected since boon-reset-state-for-switchw does that when the window selection changes.

For non-child frames I think resetting the state is what you want, but for child frames it seems to be problematic.
For the moment I worked around like so:

(defun madmacs-reset-state-unless-target-is-childframe (orig-fn frame)
    (unless (frame-parent frame)
      ;; no parent means this is not a child frame so we can reset
      (funcall orig-fn frame)))
  
  (advice-add 'boon-reset-state-for-switchw :around #'madmacs-reset-state-unless-target-is-childframe)

I think however it would make sense to extend boon-reset-state-for-switch to account for that. I am not sure if that has any negative side-effects though. Hence I opened an issue rather than a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions