Open ChoppinBlockParty opened 6 years ago
(defun +amos*ivy--insert-minibuffer (text)
"Insert TEXT into minibuffer with appropriate cleanup."
(let ((resize-mini-windows nil)
(update-fn (ivy-state-update-fn ivy-last))
(old-mark (marker-position (mark-marker)))
deactivate-mark)
(ivy--cleanup)
(when update-fn
(funcall update-fn))
(ivy--insert-prompt)
;; Do nothing if while-no-input was aborted.
(when (stringp text)
(if ivy-display-function
(funcall ivy-display-function text)
(ivy-display-function-fallback text)))
(unless (frame-root-window-p (minibuffer-window))
(with-selected-window (minibuffer-window)
(set-window-text-height nil
(+ ivy-height
(if ivy-add-newline-after-prompt
1
0)))))
;; prevent region growing due to text remove/add
(when (region-active-p)
(set-mark old-mark))))
(advice-add #'ivy--insert-minibuffer :override #'+amos*ivy--insert-minibuffer)
It'll expand the minibuffer once you input something.
Hmm..., for some reasons it did not fix the behavior for me.
Can't reproduce with Emacs-26.1 on Linux.
Emacs version: 26.1 Operating System: Ubuntu 16.04 Evil version: 1.2.13 Evil installation type: MELPA Graphical/Terminal: X
That is how it looks like. I notice this only happens when the window is maximized (in the screenshot it is not maximized, because I first maximized it switch to another window/desktop, and then resized it).
Tried with emacs -nw
on a maximized terminal window. Still can't reproduce. Did you try with make plain
?
I found exactly when it happens, it happens when there is resizing. Long story, I am using awesome wm, and when window is focused I have 1px red border, so when the windows are tiled on the screen and I switch from one window to another a window is actually resized due to this border.
Is it possible to preserve the minibuffer window during resizing?
When I am using ivy minibuffer, I sometimes need to switch to another OS window (Alt-TAB), after I come back to this emacs window ivy minibuffer is collapsed to one line and only prompt is seen. Is it possible to avoid this behavior?