1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-20 18:17:20 +00:00

Fix cperl list indentation problem

* lisp/progmodes/cperl-mode.el (cperl-calculate-indent): Indent
foo:bar() in lists correctly (bug#57829).
This commit is contained in:
Lars Ingebrigtsen 2022-09-16 13:05:54 +02:00
parent 37e9d6a35a
commit 711f908f5d
3 changed files with 30 additions and 1 deletions

View File

@ -3016,7 +3016,7 @@ and closing parentheses and brackets."
;; Now it is a hash reference
(+ cperl-indent-level cperl-close-paren-offset))
;; Labels do not take :: ...
(if (looking-at "\\(\\w\\|_\\)+[ \t]*:")
(if (looking-at "\\(\\w\\|_\\)+[ \t]*:[^:]")
(if (> (current-indentation) cperl-min-label-indent)
(- (current-indentation) cperl-label-offset)
;; Do not move `parse-data', this should

View File

@ -0,0 +1,26 @@
Code:
(lambda ()
(cperl-mode)
(indent-region (point-min) (point-max)))
Name: cperl-indent1
=-=
{
print "",
"",
foo::bar(),
"";
}
=-=-=
Name: cperl-indents1
=-=
{
print "",
"",
foobar(),
"";
}
=-=-=

View File

@ -1103,4 +1103,7 @@ as a regex."
(funcall cperl-test-mode)
(should-not (nth 3 (syntax-ppss 3)))))
(ert-deftest test-indentation ()
(ert-test-erts-file (ert-resource-file "cperl-indents.erts")))
;;; cperl-mode-tests.el ends here