mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Fix filling of overlong first lines in Python doc strings
* lisp/progmodes/python.el (python-fill-string): Fill overlong first lines correctly (bug#20860). Copyright-paperwork-exempt: yes
This commit is contained in:
parent
0dfe193ec4
commit
7f11dea662
2 changed files with 30 additions and 1 deletions
|
|
@ -4239,6 +4239,11 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
|
|||
(point)))))
|
||||
(num-quotes (python-syntax-count-quotes
|
||||
(char-after str-start-pos) str-start-pos))
|
||||
(str-line-start-pos
|
||||
(save-excursion
|
||||
(goto-char str-start-pos)
|
||||
(beginning-of-line)
|
||||
(point-marker)))
|
||||
(str-end-pos
|
||||
(save-excursion
|
||||
(goto-char (+ str-start-pos num-quotes))
|
||||
|
|
@ -4262,7 +4267,7 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
|
|||
('symmetric (and multi-line-p (cons 1 1)))))
|
||||
(fill-paragraph-function))
|
||||
(save-restriction
|
||||
(narrow-to-region str-start-pos str-end-pos)
|
||||
(narrow-to-region str-line-start-pos str-end-pos)
|
||||
(fill-paragraph justify))
|
||||
(save-excursion
|
||||
(when (and (python-info-docstring-p) python-fill-docstring-style)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue