Skip to content

Commit

Permalink
Fix color history (M-p/M-n)
Browse files Browse the repository at this point in the history
  • Loading branch information
misohena committed Feb 18, 2025
1 parent 9cde5ec commit 838ecce
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions edraw-color-picker.el
Original file line number Diff line number Diff line change
Expand Up @@ -578,20 +578,10 @@ Do not pass a color name, as it may change between CSS and Emacs color names."
color
edraw-color-picker-recent-colors-max-size))

(defun edraw-color-picker-make-history-list (options initial-color)
(defun edraw-color-picker-make-history-list (options _initial-color)
"Create a color history list for `read-from-minibuffer'."
(let ((hist (mapcar #'edraw-color-picker-palette-color-to-string
(edraw-color-picker-get-recent-colors options))))
(when (or
;; Use car of HIST as initial-color
(null initial-color)
;; Same color
(and
hist
(equal (edraw-color-picker-palette-color-to-string initial-color)
(car hist))))
(pop hist))
hist))
(mapcar #'edraw-color-picker-palette-color-to-string
(edraw-color-picker-get-recent-colors options)))


;;;; SVG Common
Expand Down

0 comments on commit 838ecce

Please sign in to comment.