popup-el
popup-el copied to clipboard
popup-tip ignores margin when beginning of line,and popup is disrupted when end of line.
popup-tip ignore margin when beginning of line,and popup is disrupted when end of line. Here is the test code.
(ert-deftest popup-test-margin-at-left ()
(popup-test-with-temp-buffer
(let ((popup (popup-tip "Margin?" :nowait t :margin t)))
(with-current-buffer (popup-test-helper-get-overlays-buffer)
(let ((points (popup-test-helper-match-points '(" Margin? "))))
(should (every #'identity points))
(should (equal (car (popup-test-helper-points-to-columns points))
0))
)))))
(ert-deftest popup-test-margin-at-right ()
(popup-test-with-temp-buffer
(insert (make-string (- (window-width) 1) ? ))
(let ((popup (popup-tip "Margin?" :nowait t :margin t)))
(with-current-buffer (popup-test-helper-get-overlays-buffer)
(let ((points (popup-test-helper-match-points '(" Margin? "))))
(should (every #'identity points))
(should (equal (car (popup-test-helper-points-to-columns points))
(- (window-width) 9)))
)))))