]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix indentation of XML comments
authorEli Zaretskii <eliz@gnu.org>
Sat, 10 May 2025 10:11:22 +0000 (13:11 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 10 May 2025 14:04:52 +0000 (16:04 +0200)
* lisp/nxml/nxml-mode.el (nxml-compute-indent-in-delimited-token):
Fix indentation in XML comments with empty lines.  Patch by John
Ciolfi <ciolfi@mathworks.com>.  (Bug#73206)

(cherry picked from commit 0d493864cee2ea1d7661d51b973db58667b6b65b)

lisp/nxml/nxml-mode.el

index 1f2c7e81a09e0f36f152c72cda16e276890a7b81..ae27824fdc99065a814c4ddbb392ef674b3e6fc4 100644 (file)
@@ -1523,6 +1523,8 @@ of the line.  This expects the xmltok-* variables to be set up as by
        ((progn
           (goto-char pos)
           (forward-line -1)
+           (while (looking-at "^[[:blank:]]*$")
+             (forward-line -1))
           (<= (point) xmltok-start))
         (goto-char (+ xmltok-start (length open-delim)))
         (when (and (string= open-delim "<!--")