(not (eobp)))
(delete-char 1)))
(goto-char (point-min))
- (let ((count 0))
+ (let ((seen 0)
+ (thumb-prev-pos 0)
+ (thumb-width-chars
+ (ceiling (/ (+ (* 2 image-dired-thumb-relief)
+ (* 2 image-dired-thumb-margin)
+ (image-dired-thumb-size 'width))
+ (float (frame-char-width))))))
(while (not (eobp))
(forward-char)
(if (= image-dired-thumbs-per-row 1)
(insert "\n")
- (insert " ")
- (setq count (1+ count))
- (when (and (= count (- image-dired-thumbs-per-row 1))
+ (cl-incf thumb-prev-pos thumb-width-chars)
+ (insert (propertize " " 'display `(space :align-to ,thumb-prev-pos)))
+ (cl-incf seen)
+ (when (and (= seen (- image-dired-thumbs-per-row 1))
(not (eobp)))
(forward-char)
(insert "\n")
- (setq count 0)))))
+ (setq seen 0)
+ (setq thumb-prev-pos 0)))))
(goto-char (point-min))))
(defun image-dired-line-up-dynamic ()