branch: elpa/yaml-mode commit 40067a10ac1360f0b9533f0bbbb2eea128e2574d Merge: 3fc5a33 78b3ba5 Author: Vasilij Schneidermann <m...@vasilij.de> Commit: GitHub <nore...@github.com>
Merge pull request #62 from ts4z/master fill while in a comment should behave as in text modes --- yaml-mode.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yaml-mode.el b/yaml-mode.el index c3416dd..9f76c38 100644 --- a/yaml-mode.el +++ b/yaml-mode.el @@ -438,13 +438,15 @@ otherwise do nothing." (defun yaml-fill-paragraph (&optional justify region) "Fill paragraph. -This behaves as `fill-paragraph' except that filling does not -cross boundaries of block literals." +Outside of comments, this behaves as `fill-paragraph' except that +filling does not cross boundaries of block literals. Inside comments, +this will do usual adaptive fill behaviors." (interactive "*P") (save-restriction (yaml-narrow-to-block-literal) (let ((fill-paragraph-function nil)) - (fill-paragraph justify region)))) + (or (fill-comment-paragraph justify) + (fill-paragraph justify region))))) (defun yaml-set-imenu-generic-expression () (make-local-variable 'imenu-generic-expression)