popup-el icon indicating copy to clipboard operation
popup-el copied to clipboard

popup-tip ignores margin when beginning of line,and popup is disrupted when end of line.

Open uk-ar opened this issue 13 years ago • 0 comments

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)))
          )))))

uk-ar avatar Sep 23 '12 07:09 uk-ar