[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master a5b07aa 2/2: eww input field fixup
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master a5b07aa 2/2: eww input field fixup |
Date: |
Thu, 27 Nov 2014 16:20:05 +0000 |
branch: master
commit a5b07aa6b55b4158bf51457e4cb8649d48423a4d
Author: Lars Magne Ingebrigtsen <address@hidden>
Date: Thu Nov 27 17:19:52 2014 +0100
eww input field fixup
Fixes: debbugs:19085
(eww-process-text-input): Don't shorten the input field if
deleting at the last character.
---
lisp/ChangeLog | 2 ++
lisp/net/eww.el | 7 ++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b0b1d74..50c8e40 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
* net/eww.el (eww): Record the new URL immediately, so that if the
HTTP fetch fails, we have the right URL in the buffer.
+ (eww-process-text-input): Don't shorten the input field if
+ deleting at the last character (bug#19085).
* dom.el (dom-pp): New function.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index a8c9109..23f3653 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -953,9 +953,9 @@ appears in a <link> or <a> tag."
See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
(defun eww-process-text-input (beg end length)
- (let* ((form (get-text-property (min (1+ end) (point-max)) 'eww-form))
+ (let* ((form (get-text-property (min (1- end) (point-max)) 'eww-form))
(inhibit-read-only t)
- (properties (text-properties-at end))
+ (properties (text-properties-at (1- end)))
(type (plist-get form :type)))
(when (and form
(member type eww-text-input-types))
@@ -976,10 +976,11 @@ See URL
`https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
((> length 0)
;; Add padding.
(save-excursion
+ (goto-char (1- end))
(goto-char
(if (equal type "textarea")
(1- (line-end-position))
- (eww-end-of-field)))
+ (1+ (eww-end-of-field))))
(let ((start (point)))
(insert (make-string length ? ))
(set-text-properties start (point) properties)))))