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:
parent
37e9d6a35a
commit
711f908f5d
@ -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
|
||||
|
26
test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts
Normal file
26
test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts
Normal 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(),
|
||||
"";
|
||||
}
|
||||
=-=-=
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user