(py-compute-indentation): Check for multiline stringness and
commentness so that hitting TAB in the middle of a comment will still indent the line.
This commit is contained in:
parent
8c4a8de75e
commit
3b3ff4e96e
|
@ -1363,13 +1363,13 @@ the new line indented."
|
||||||
;; break, continue, and pass force one level of outdenting.
|
;; break, continue, and pass force one level of outdenting.
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let* ((bod (py-point 'bod))
|
(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)
|
(beginning-of-line)
|
||||||
(cond
|
(cond
|
||||||
;; are we inside a multi-line string or comment?
|
;; are we inside a multi-line string or comment?
|
||||||
((or (and (nth 3 pps)
|
((or (and (nth 3 pps) (nth 3 boipps))
|
||||||
(nth 3 (parse-partial-sexp bod (py-point 'boi))))
|
(and (nth 4 pps) (nth 4 boipps)))
|
||||||
(nth 4 pps))
|
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(if (not py-align-multiline-strings-p) 0
|
(if (not py-align-multiline-strings-p) 0
|
||||||
;; skip back over blank & non-indenting comment lines
|
;; skip back over blank & non-indenting comment lines
|
||||||
|
|
Loading…
Reference in New Issue