Skip to content

Commit

Permalink
Fix color picker disappearing when minibuffer input fails
Browse files Browse the repository at this point in the history
There was a mistake in the fix for an issue that occurs when the
minibuffer is re-entered.
  • Loading branch information
misohena committed Feb 15, 2025
1 parent 7d557a3 commit 9efaaea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
21 changes: 11 additions & 10 deletions edraw-color-picker.el
Original file line number Diff line number Diff line change
Expand Up @@ -3053,14 +3053,9 @@ H:%5.1fdeg, S:%5.1f%%, B:%5.1f%%, RL:%5.1f%%"
'(:transient-keymap-var
. edraw-color-picker-minibuffer-mode-map)
options)))
(setup-p nil)
(on-minibuffer-setup
(lambda ()
(unless setup-p
(setq setup-p t)
(edraw-color-picker-minibuffer--on-minibuffer-setup picker))))
(minibuffer-setup-hook (cons on-minibuffer-setup
minibuffer-setup-hook))
(edraw-color-picker-minibuffer--on-minibuffer-setup picker)))
(edraw-color-picker-read-color--history
(edraw-color-picker-make-history-list options initial-color)))

Expand All @@ -3087,10 +3082,16 @@ H:%5.1fdeg, S:%5.1f%%, B:%5.1f%%, RL:%5.1f%%"
(edraw-get-current-color picker) options))))
(result nil))
(while (null result)
(let ((input (read-string (edraw-color-picker-minibuffer--prompt
prompt allow-strings options)
initial-input
'edraw-color-picker-read-color--history)))
(let ((input
(minibuffer-with-setup-hook
;; If the minibuffer is re-entered recursively,
;; on-minibuffer-setup will only be called
;; once, for the outermost use of the minibuffer.
on-minibuffer-setup
(read-string (edraw-color-picker-minibuffer--prompt
prompt allow-strings options)
initial-input
'edraw-color-picker-read-color--history))))
(when (or (member input allow-strings)
(edraw-color-picker-color-from-string input options))
(setq result input))))
Expand Down
3 changes: 3 additions & 0 deletions todo.org
Original file line number Diff line number Diff line change
Expand Up @@ -6484,3 +6484,6 @@ edraw-color-picker-modeは単独のバッファ内で動作する。

edraw-color-picker-global-mode
- 使用するモードの設定
** DONE 色/edraw-color-picker-read-colorで無効な色を入力したとき
CLOSED: [2025-02-15 Sat 18:26]
再度入力になるがカラーピッカーが消えてしまう。

0 comments on commit 9efaaea

Please sign in to comment.