mirror of
https://github.com/ryuslash/mode-icons.git
synced 2024-11-21 17:40:30 +01:00
Fix the wrong color replacement problem in xpm images
With specific color combinations, some of the colors could be replaced twice. This commit avoids that problem.
This commit is contained in:
parent
1b3ab62793
commit
cc0e6f241c
1 changed files with 8 additions and 2 deletions
|
@ -318,9 +318,15 @@ If ICON-PATH is a string, return that."
|
||||||
"Get xpm image from ICON-PATH and reaplce REP-ALIST in file.
|
"Get xpm image from ICON-PATH and reaplce REP-ALIST in file.
|
||||||
When NAME is non-nil, also replace the internal xpm image name."
|
When NAME is non-nil, also replace the internal xpm image name."
|
||||||
(let ((case-fold-search t)
|
(let ((case-fold-search t)
|
||||||
(img (mode-icons-get-xpm-string icon-path)))
|
(img (mode-icons-get-xpm-string icon-path))
|
||||||
|
(i 0))
|
||||||
(dolist (c rep-alist)
|
(dolist (c rep-alist)
|
||||||
(setq img (replace-regexp-in-string (regexp-quote (car c)) (cdr c) img t t)))
|
(setq img (replace-regexp-in-string (regexp-quote (car c)) (format "COLOR<%d>" i) img t t)
|
||||||
|
i (1+ i)))
|
||||||
|
(let ((i 0))
|
||||||
|
(dolist (c rep-alist)
|
||||||
|
(setq img (replace-regexp-in-string (format "COLOR<%d>" i) (cdr c) img t t)
|
||||||
|
i (1+ i))))
|
||||||
(when name
|
(when name
|
||||||
(setq img (replace-regexp-in-string "^[ ]*static[ ]+char[ ]+[*][ ]+.*?\\[" (concat "static char * " name "[") img t t)))
|
(setq img (replace-regexp-in-string "^[ ]*static[ ]+char[ ]+[*][ ]+.*?\\[" (concat "static char * " name "[") img t t)))
|
||||||
img))
|
img))
|
||||||
|
|
Loading…
Reference in a new issue