mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-07 15:21:46 +00:00
Make toggling checkboxes work again
* eww.el (eww-update-field): Make toggling checkboxes work again (bug#21881).
This commit is contained in:
parent
9f0fd7cb1a
commit
5e56f60695
@ -1181,16 +1181,19 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
|
||||
(eww-update-field display))))
|
||||
|
||||
(defun eww-update-field (string &optional offset)
|
||||
(if (not offset) (setq offset 0))
|
||||
(unless offset
|
||||
(setq offset 0))
|
||||
(let ((properties (text-properties-at (point)))
|
||||
(start (+ (eww-beginning-of-field) offset))
|
||||
(current-end (1+ (eww-end-of-field)))
|
||||
(new-end (1+ (+ (eww-beginning-of-field) (length string)))))
|
||||
(new-end (+ (eww-beginning-of-field) (length string)))
|
||||
(inhibit-read-only t))
|
||||
(delete-region start current-end)
|
||||
(forward-char offset)
|
||||
(insert string
|
||||
(make-string (- (- (+ new-end offset) start) (length string)) ? ))
|
||||
(if (= 0 offset) (set-text-properties start new-end properties))
|
||||
(when (= 0 offset)
|
||||
(set-text-properties start new-end properties))
|
||||
start))
|
||||
|
||||
(defun eww-toggle-checkbox ()
|
||||
|
Loading…
Reference in New Issue
Block a user