mirror of https://github.com/python/cpython.git
(py-honor-comment-indentation, py-compute-indentation): Fix the
implementation to match the documentation for py-honor-comment-indentation w.r.t. not nil or t value. In that case it should still ignore ## for indentation purposes. Closes SF bug #523825, w/ patch provided by Christian Stork (mod'd by Barry). Python 2.2.1 candidate.
This commit is contained in:
parent
15b6893d95
commit
d36cfe495e
|
@ -184,8 +184,8 @@ indentation is used as a hint for this line's indentation. Lines that
|
||||||
begin with `py-block-comment-prefix' are ignored for indentation
|
begin with `py-block-comment-prefix' are ignored for indentation
|
||||||
purposes.
|
purposes.
|
||||||
|
|
||||||
When not nil or t, comment lines that begin with a `#' are used as
|
When not nil or t, comment lines that begin with a single `#' are used
|
||||||
indentation hints, unless the comment character is in column zero."
|
as indentation hints, unless the comment character is in column zero."
|
||||||
:type '(choice
|
:type '(choice
|
||||||
(const :tag "Skip all comment lines (fast)" nil)
|
(const :tag "Skip all comment lines (fast)" nil)
|
||||||
(const :tag "Single # `sets' indentation for next line" t)
|
(const :tag "Single # `sets' indentation for next line" t)
|
||||||
|
@ -1902,7 +1902,11 @@ dedenting."
|
||||||
(and (not (eq py-honor-comment-indentation t))
|
(and (not (eq py-honor-comment-indentation t))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(back-to-indentation)
|
(back-to-indentation)
|
||||||
(not (zerop (current-column)))))
|
(and (not (looking-at prefix-re))
|
||||||
|
(or (looking-at "[^#]")
|
||||||
|
(not (zerop (current-column)))
|
||||||
|
))
|
||||||
|
))
|
||||||
))
|
))
|
||||||
)))
|
)))
|
||||||
;; if we landed inside a string, go to the beginning of that
|
;; if we landed inside a string, go to the beginning of that
|
||||||
|
|
Loading…
Reference in New Issue