emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/csharp-mode fbcb363 315/459: Make sure attributes are n


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode fbcb363 315/459: Make sure attributes are not arrays and new has whitespace
Date: Sun, 22 Aug 2021 13:59:52 -0400 (EDT)

branch: externals/csharp-mode
commit fbcb363bbf23605b74bc5483551ca579b3048613
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Theodor Thornhill <theo@thornhill.no>

    Make sure attributes are not arrays and new has whitespace
    
    Attributes don't end with a semi, so the vsemi should not be added if the 
line
    is followed by a real semi, as in the array subscript notation:
    
    Fentry get_fentry (string name) {
        foreach (Fentry f in fentry_table) {
            if (name == f.name)
                return fentry_table[i];
                    return null;                 <-- indented improperly
        }
    }
    
    Fentry get_fentry (string name) {
        foreach (Fentry f in fentry_table) {
            if (name == f.name)
                return fentry_table[i];
            return null;                 <-- indented properly after this commit
        }
    }
    
    Also, added whitespace around 'new' in the object inits so the token isn't 
seen
    as a separate token inside other tokens.
---
 csharp-mode.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/csharp-mode.el b/csharp-mode.el
index 27552c9..8ebc771 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -201,7 +201,8 @@
        (eq (char-before) ?\])
        (save-excursion
          (c-backward-sexp)
-         (looking-at "\\[")))
+         (looking-at "\\["))
+       (not (eq (char-after) ?\;)))
       (and
        ;; Heuristics to find object initializers
        (save-excursion
@@ -211,7 +212,7 @@
        (save-excursion
          ;; 'new' should be part of the line
          (beginning-of-line)
-         (looking-at ".*new.*"))
+         (looking-at ".*\\s * new\\s *.*"))
        ;; Line should not already be terminated
        (not (eq (char-after) ?\;)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]