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

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

[elpa] externals/csharp-mode 2697c95 332/459: Move bobp checking in one


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode 2697c95 332/459: Move bobp checking in one level
Date: Sun, 22 Aug 2021 13:59:55 -0400 (EDT)

branch: externals/csharp-mode
commit 2697c953102e680788802cd792a454e14114e6c0
Author: Theodor Thornhill <theodor.thornhill@frende.no>
Commit: Theodor Thornhill <theodor.thornhill@frende.no>

    Move bobp checking in one level
    
    It is always safe to use 'c-backward-syntactic-ws', so we can do that before
    checking for bobp.  The reason this is smart is that the 'backward-char' can
    fail with a 'beginning-of-buffer' error.  This causes indentation with 'C-x 
h
    TAB' sometimes to fail.  Since a lambda function is super unlikely to be at
    beginning of buffer, or only after some doc comments (syntactic ws), this 
is an
    ok move.
---
 csharp-mode.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/csharp-mode.el b/csharp-mode.el
index e5bb1fd..fae784a 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -487,9 +487,9 @@
       (apply orig-fun args))))
 
 (defun csharp-at-lambda-header ()
-  (unless (bobp)
-    (save-excursion
-      (c-backward-syntactic-ws)
+  (save-excursion
+    (c-backward-syntactic-ws)
+    (unless (bobp)
       (backward-char)
       (c-safe (goto-char (scan-sexps (point) -1)))
       (when (or (looking-at "([[:alnum:][:space:]_,]*)[ \t\n]*=>[ \t\n]*{")



reply via email to

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