Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b3ff4e

Browse files
committed
(py-compute-indentation): Check for multiline stringness and
commentness so that hitting TAB in the middle of a comment will still indent the line.
1 parent 8c4a8de commit 3b3ff4e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Misc/python-mode.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,13 +1363,13 @@ the new line indented."
13631363
;; break, continue, and pass force one level of outdenting.
13641364
(save-excursion
13651365
(let* ((bod (py-point 'bod))
1366-
(pps (parse-partial-sexp bod (point))))
1366+
(pps (parse-partial-sexp bod (point)))
1367+
(boipps (parse-partial-sexp bod (py-point 'boi))))
13671368
(beginning-of-line)
13681369
(cond
13691370
;; are we inside a multi-line string or comment?
1370-
((or (and (nth 3 pps)
1371-
(nth 3 (parse-partial-sexp bod (py-point 'boi))))
1372-
(nth 4 pps))
1371+
((or (and (nth 3 pps) (nth 3 boipps))
1372+
(and (nth 4 pps) (nth 4 boipps)))
13731373
(save-excursion
13741374
(if (not py-align-multiline-strings-p) 0
13751375
;; skip back over blank & non-indenting comment lines

0 commit comments

Comments
 (0)