bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#36348: 26.2; Indentation problem with Delphi inline variables


From: Stefan Monnier
Subject: bug#36348: 26.2; Indentation problem with Delphi inline variables
Date: Mon, 22 Jul 2019 13:12:04 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Indentation doesn't work properly when using inline variable
> introduced by Delphi 10.3 (using Emacs 26.2, opascal,
> opascal-indent-level is 3):
>
>    for i := 0 to str.Length - 1 do
>       Write (str.Chars[i]);
>       
>    for var i := 0 to str.Length - 1 do
>               Write (str.Chars[i]);

I just pushed the patch below which seems to fix it.


        Stefan


diff --git a/lisp/progmodes/opascal.el b/lisp/progmodes/opascal.el
index 7d51816bf4..9bb62ced3b 100644
--- a/lisp/progmodes/opascal.el
+++ b/lisp/progmodes/opascal.el
@@ -1177,8 +1177,11 @@ opascal-enclosing-indent-of
           (throw 'done (opascal-stmt-line-indent-of
                         (or last-token token) opascal-indent-level)))
 
-         ;; We indent relative to an enclosing declaration section.
-         ((opascal-is token-kind opascal-decl-sections)
+         ;; We indent relative to an enclosing declaration section,
+         ;; unless this is within the a delimited expression
+         ;; (bug#36348).
+         ((and (not expr-delimited)
+               (opascal-is token-kind opascal-decl-sections))
           (throw 'done (opascal-indent-of (if last-token last-token token)
                                          opascal-indent-level)))
 






reply via email to

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