mirror of
https://github.com/python/cpython.git
synced 2025-11-18 01:57:37 +00:00
(py-continuation-offset): Update docstring to describe that this
additional offset is only applied to continuation lines for block opening statements. (py-compute-indentation): Only add py-continuation-offset if py-statement-opens-block-p is true.
This commit is contained in:
parent
91f2f26d75
commit
40fb452be9
1 changed files with 9 additions and 4 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
;; Created: Feb 1992
|
;; Created: Feb 1992
|
||||||
;; Keywords: python languages oop
|
;; Keywords: python languages oop
|
||||||
|
|
||||||
(defconst py-version "$Revision$"
|
(defconst py-version "4.3"
|
||||||
"`python-mode' version number.")
|
"`python-mode' version number.")
|
||||||
|
|
||||||
;; This software is provided as-is, without express or implied
|
;; This software is provided as-is, without express or implied
|
||||||
|
|
@ -124,9 +124,10 @@ you're editing someone else's Python code."
|
||||||
:group 'python)
|
:group 'python)
|
||||||
|
|
||||||
(defcustom py-continuation-offset 4
|
(defcustom py-continuation-offset 4
|
||||||
"*Additional amount of offset to give for continuation lines.
|
"*Additional amount of offset to give for some continuation lines.
|
||||||
Continuation lines are those that immediately follow a backslash
|
Continuation lines are those that immediately follow a backslash
|
||||||
terminated line."
|
terminated line. Only those continuation lines for a block opening
|
||||||
|
statement are given this extra offset."
|
||||||
:type 'integer
|
:type 'integer
|
||||||
:group 'python)
|
:group 'python)
|
||||||
|
|
||||||
|
|
@ -1833,7 +1834,11 @@ dedenting."
|
||||||
(progn
|
(progn
|
||||||
(goto-char startpos)
|
(goto-char startpos)
|
||||||
(skip-chars-forward "^ \t\n")))
|
(skip-chars-forward "^ \t\n")))
|
||||||
(+ (current-column) py-continuation-offset 1)
|
;; if this is a continuation for a block opening
|
||||||
|
;; statement, add some extra offset.
|
||||||
|
(+ (current-column) (if (py-statement-opens-block-p)
|
||||||
|
py-continuation-offset 0)
|
||||||
|
1)
|
||||||
))))
|
))))
|
||||||
|
|
||||||
;; not on a continuation line
|
;; not on a continuation line
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue