]> git.eshelyaron.com Git - emacs.git/commitdiff
(eww-process-text-input): Fix deletion at the start of the field, too.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 27 Nov 2014 16:42:28 +0000 (17:42 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 27 Nov 2014 16:42:28 +0000 (17:42 +0100)
lisp/ChangeLog
lisp/net/eww.el

index 26c68df7395692a87936fbbf09a4d29c1f5a8722..6f22474d199bcda2b7d6c366df7edfe166b99b26 100644 (file)
@@ -6,6 +6,7 @@
        deleting at the last character (bug#19085).
        (eww-restore-history): Inhibit change functions while restoring
        the history.
+       (eww-process-text-input): Fix deletion at the start of the field, too.
 
        * dom.el (dom-pp): New function.
 
index 75af7fbf64d7ef5dd0b80008c11c09be01eca12a..63a6c0d7af03b9928aed4ceb1d8a496fd2ac1c9a 100644 (file)
@@ -674,7 +674,6 @@ the like."
    (setq-local tool-bar-map eww-tool-bar-map))
   ;; desktop support
   (setq-local desktop-save-buffer 'eww-desktop-misc-data)
-  (buffer-disable-undo)
   (setq buffer-read-only t))
 
 ;;;###autoload
@@ -954,9 +953,14 @@ 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* ((pos (cond
+              ((get-text-property (1- end) 'eww-form)
+               (1- end))
+              ((get-text-property (1+ end) 'eww-form)
+               (1+ end))))
+        (form (get-text-property pos 'eww-form))
+        (properties (text-properties-at pos))
         (inhibit-read-only t)
-        (properties (text-properties-at (1- end)))
         (type (plist-get form :type)))
     (when (and form
               (member type eww-text-input-types))