]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix alignment of Java String[] and the like
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 28 Dec 2020 01:47:25 +0000 (02:47 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 28 Dec 2020 01:47:25 +0000 (02:47 +0100)
* lisp/align.el (align-rules-list): Allow aligning Java String[] etc
(bug#19385).

Test case:

class X
{
    String field1;
    String[] field2;
    int field3;
    int[] field4;
    X field5;
    X[] field6;
}

lisp/align.el

index a11d834b823ff4eb310261e1f3a5db658f645c24..905328b6625fa34f3a1395362d47fc563b66b663 100644 (file)
@@ -411,7 +411,7 @@ The possible settings for `align-region-separate' are:
      (modes    . align-c++-modes))
 
     (c-variable-declaration
-     (regexp   . ,(concat "[*&0-9A-Za-z_]>?[&*]*\\(\\s-+[*&]*\\)"
+     (regexp   . ,(concat "[*&0-9A-Za-z_]>?[][&*]*\\(\\s-+[*&]*\\)"
                          "[A-Za-z_][][0-9A-Za-z:_]*\\s-*\\(\\()\\|"
                          "=[^=\n].*\\|(.*)\\|\\(\\[.*\\]\\)*\\)"
                          "\\s-*[;,]\\|)\\s-*$\\)"))