]> granicus.if.org Git - python/commitdiff
(py-compute-indentation): Check for multiline stringness and
authorBarry Warsaw <barry@python.org>
Wed, 26 Nov 1997 20:58:48 +0000 (20:58 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 26 Nov 1997 20:58:48 +0000 (20:58 +0000)
commentness so that hitting TAB in the middle of a comment will still
indent the line.

Misc/python-mode.el

index 688bb82068c3f4c4d7106c0494c2cbbbf81eb7d9..0cd3dd57367febef5040e6cbdacedd32786e37d3 100644 (file)
@@ -1363,13 +1363,13 @@ the new line indented."
   ;; break, continue, and pass force one level of outdenting.
   (save-excursion
     (let* ((bod (py-point 'bod))
-          (pps (parse-partial-sexp bod (point))))
+          (pps (parse-partial-sexp bod (point)))
+          (boipps (parse-partial-sexp bod (py-point 'boi))))
       (beginning-of-line)
       (cond
        ;; are we inside a multi-line string or comment?
-       ((or (and (nth 3 pps)
-                (nth 3 (parse-partial-sexp bod (py-point 'boi))))
-           (nth 4 pps))
+       ((or (and (nth 3 pps) (nth 3 boipps))
+           (and (nth 4 pps) (nth 4 boipps)))
        (save-excursion
          (if (not py-align-multiline-strings-p) 0
            ;; skip back over blank & non-indenting comment lines