branch: externals/objed
commit 210d3db7d3eabb31bba6089a9c6b545bceedfaa0
Author: Clemens Radermacher <clem...@posteo.net>
Commit: Clemens Radermacher <clem...@posteo.net>

    Improve sexp object for non symetric commands
---
 objed-objects.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index a60bd2f..7add776 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1763,12 +1763,16 @@ comments."
       'identifier))
   :get-obj
   (let ((bounds (or (objed--at-sexp-p)
+                    ;; for commands which are not symetric
+                    ;; like C-M-f at beg of python funtions
                     (save-excursion
                       (ignore-errors
-                        (let ((real-this-command 'forward-sexp))
+                        (let* ((pos (point))
+                               (real-this-command 'forward-sexp))
                           (forward-sexp 1)
-                          (forward-sexp -1))
-                        (objed--at-sexp-p))))))
+                          (when (/= pos (point))
+                            (cons pos
+                                  (point)))))))))
 
     (when bounds
       (objed-make-object

Reply via email to