You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If minibuffer is called when insert-mode is active - it must not revert to command mode when minibuffer exits
Some workflow such as when using consult-completions-in-region as the completion-in-region-function requires calling another minibuffer session to handle when completions is called. This causes the command-mode to be activated prematurely after the completions has completed -- instead when the minibuffer has actually exited.
Possible solution
Define a logic to determine when minibuffer session has actually exited using a post-command-hook when switchover from command to insert is required -- this adds some extra overheads.
(defun xah-fly--minibuffer-setup ()
"Activate `xah-fly-insert-mode` in the minibuffer."
(unless xah-fly-insert-state-p
(xah-fly-insert-mode-activate)
(add-hook 'post-command-hook #'xah-fly--check-minibuffer-exit)))
(defun xah-fly--check-minibuffer-exit ()
"Check if the minibuffer has been exited and activate command mode."
(unless (active-minibuffer-window)
(xah-fly-command-mode-activate)
(remove-hook 'post-command-hook #'xah-fly--check-minibuffer-exit)))
Some workflow such as when using consult-completions-in-region as the completion-in-region-function requires calling another minibuffer session to handle when completions is called. This causes the command-mode to be activated prematurely after the completions has completed -- instead when the minibuffer has actually exited.
This is relevant only when using eval-expressionM-: (default overwritten by xah-fly-keys as <space> , r) - we can use autocompletions (minibuffer on top of another minibuffer) in consult-completions-in-region here.
But also as implied - this type of autocompletions constantly reverts xah-fly-keys to command-mode due to the minibuffer-exit-hook even when called when insert-mode is currently active (during normal data entry operations).
Currently the following logic is implemented in
xah-fly-keys
modeProblem description:
If minibuffer is called when insert-mode is active - it must not revert to command mode when minibuffer exits
Some workflow such as when using consult-completions-in-region as the
completion-in-region-function
requires calling another minibuffer session to handle when completions is called. This causes the command-mode to be activated prematurely after the completions has completed -- instead when the minibuffer has actually exited.Possible solution
Define a logic to determine when minibuffer session has actually exited using a
post-command-hook
when switchover from command to insert is required -- this adds some extra overheads.Please let me know if some other trivial solution exists.
Best,
The text was updated successfully, but these errors were encountered: