emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 604ce91: (eww-process-text-input): Fix deletion at


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 604ce91: (eww-process-text-input): Fix deletion at the start of the field, too.
Date: Thu, 27 Nov 2014 16:42:33 +0000

branch: master
commit 604ce9124efd295b46e3fbb2d6880302fe55a33f
Author: Lars Magne Ingebrigtsen <address@hidden>
Date:   Thu Nov 27 17:42:28 2014 +0100

    (eww-process-text-input): Fix deletion at the start of the field, too.
---
 lisp/ChangeLog  |    1 +
 lisp/net/eww.el |   10 +++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 26c68df..6f22474 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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.
 
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 75af7fb..63a6c0d 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]