emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/objed 1dc62ca 089/166: Improve block expansion


From: Clemens Radermacher
Subject: [elpa] externals/objed 1dc62ca 089/166: Improve block expansion
Date: Sun, 29 Dec 2019 08:21:06 -0500 (EST)

branch: externals/objed
commit 1dc62ca236e7eac4d269ff9ab869c5f5b7e0914e
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Improve block expansion
---
 objed.el | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/objed.el b/objed.el
index bbfca15..118d98b 100644
--- a/objed.el
+++ b/objed.el
@@ -1606,7 +1606,8 @@ See also `objed--block-objects'."
                        (equal as bs))))))
     (if (and init
              (not (eq objed--object 'line)))
-        (objed--switch-to 'line)
+        (progn (objed--switch-to 'line)
+               (goto-char (objed--beg)))
       (when blocks
         (let ((sdiff (abs (- (point) (objed--beg))))
               (ediff (abs (- (point) (objed--end)))))
@@ -1645,11 +1646,17 @@ See also `objed--block-objects'."
                          (>= as (point))))))))
   (cond ((or (eq last-command this-command)
              (eq last-command 'move-beginning-of-line))
-         (when blocks
-           (let ((end (objed--end)))
-             (objed--restore-state (pop blocks))
-             (objed--change-to :end end :iend end)
-             (goto-char (objed--beg)))))
+         (if (and (eq objed--object 'line)
+                  (objed--inner-p)
+                  (not (bolp))
+                  (objed--point-in-periphery))
+             (progn (objed--toggle-state)
+                    (goto-char (objed--beg)))
+           (when blocks
+             (let ((end (objed--end)))
+               (objed--restore-state (pop blocks))
+               (objed--change-to :end end :iend end)
+               (goto-char (objed--beg))))))
         (t
          (objed--switch-to 'line
                            (unless (<= (point)



reply via email to

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