[Top][All Lists]

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

[elpa] externals/objed 919a72d 071/216: Adjust python block object

From: Stefan Monnier
Subject: [elpa] externals/objed 919a72d 071/216: Adjust python block object
Date: Tue, 8 Jan 2019 12:29:14 -0500 (EST)

branch: externals/objed
commit 919a72dbabc3cf730ae7609951ce60a13874a70a
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>

    Adjust python block object
 objed-objects.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index c81a63a..5f92908 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1129,13 +1129,13 @@ If SYN is given use it instead of syntax at point."
     (cons (objed--skip-forward (car bounds)'ws)
           (objed--skip-backward (cdr bounds)'ws))))
-(defun objed--skip-ws (&optional back)
+(defun objed--skip-ws (&optional back limit)
   "Skip whitspace.
 Defaults to forward, if BACK is non-nil skip backwards."
   (if back
-      (skip-chars-backward " \r\n\t")
-    (skip-chars-forward " \r\n\t")))
+      (skip-chars-backward " \r\n\t" limit)
+    (skip-chars-forward " \r\n\t" limit)))
 (defun objed--skip-forward (from &optional ws comment)
@@ -2056,8 +2056,11 @@ non-nil the indentation block can contain empty lines."
-    (let ((start (save-excursion (python-nav-beginning-of-block) (point)))
-            (end (save-excursion (python-nav-end-of-block))))
+    (let* ((objed--block-p t)
+           (end (save-excursion (python-nav-end-of-block) (forward-line 1) 
+           (start (save-excursion (python-nav-beginning-of-block)
+                                  (objed--skip-ws t (line-beginning-position))
+                                  (point))))
         (cons start end))))
 (provide 'objed-objects)

reply via email to

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