vertico-posframe icon indicating copy to clipboard operation
vertico-posframe copied to clipboard

Question: how to redraw the posframe after toggling vertico-posframe-truncate-lines

Open fuyu0425 opened this issue 1 year ago • 0 comments

Hi I have a question: I want to redraw the vertico-posframe after toggle vertico-posframe-truncate-lines

This is my code.

(defun leo/toggle-vertico-posframe-truncate-lines ()
      (interactive)
      (setq vertico-posframe-truncate-lines
            (not vertico-posframe-truncate-lines))
      (vertico-posframe-cleanup))

    (define-key vertico-multiform-map (kbd "M-L") #'leo/toggle-vertico-posframe-truncate-lines))

I have also tested (redraw-frame posframe--frame) but it does not work either.

Use case. test with find-file with long directory path (longer than vertico-posframe-width)

Without posframe 圖片

posframe with truncate line 圖片

posframe without truncate line

(setq vertico-posframe-width 100
		  vertico-posframe-height 21)
圖片

And I want to Hit M-L to toggle between two.

But when I toggle from with truncate line to without truncate line

It does not work, only when I move the cursor back a little, the truncate line get back to having an effect.

Like the following GIF. vertico-posframe

Initially with truncate-line off => M-L => truncate-line on => M-L => truncate-line off again but I need to move cursor back to have the same effect the the initial one.

Not sure whether I should ask this question in vertico-posframe or vertico

fuyu0425 avatar Jul 19 '23 17:07 fuyu0425