In functions, if-queries, and foreach loops, I noticed that the next line is indented, which is desired. However, in version "v1.32.12920", it also indents the content of the curly braces again if it is already indented, for example, if the document is formatted multiple times because something has been added. If this is repeated, the indentation also repeats.

It does not take into account the position of the function and indent accordingly, but rather adds another indentation or similar.

Edit: This happens when pure HTML code comes after the parenthesis and the PHP part is closed using "?>".

    Hello,

    Thank you for reporting. Would you happen to have a simple test snippet where we can replicate it?

    Thank you

      Try it here with:

      <?php if (isset($Day['from']) and is_array($Day['from'])) { ?>
      <div class="col-12 col-lg-6 m-0">
      <?php foreach ($Day['from'] as $cKey => $From) { ?>
      <div class="col m-0 p-lg-0 row" <?php echo (isset($Day['from']) and is_array($Day['from'])) ? '' : 'hidden'; ?>>
      <input name="exist[<?php echo $number; ?>][]"
      value="<?php echo (isset($Day['coupons_times_id'][$cKey]) and $Day['coupons_times_id'][$cKey]) ? $Day['coupons_times_id'][$cKey] : 'NEW'; ?>"
      hidden>
      <div class="col pl-0">
      <div class="input-group">
      <input type="time" class="form-control text-center"
      name="day_from[<?php echo $number; ?>][]"
      value="<?php echo $Day['from'][$cKey]; ?>" required>
      <div class="input-group-prepend">
      <span class="bg-light border-0 input-group-text"> &ndash; </span>
      </div>
      <input type="time" class="form-control text-center"
      name="day_to[<?php echo $number; ?>][]"
      value="<?php echo $Day['to'][$cKey]; ?>" required>
      </div>
      </div>
      </div>
      <?php } ?>
      </div>
      <?php } ?>

        This is what I got when formatting it. Looks ok, should I try something specific?

          In the current latest pre-release, it seems to have already been fixed, perhaps it was a side effect caused by something that was fixed by the latest adjustments.

          Edit: Okay, it seems like it still hasn't been fixed. I took a screenshot - the first one shows the previous formatting, and the second screenshot shows the same code after being formatted five times.


          Maybe this works with this code snippet to reproduce
          function pageerror($Grund = false)
          {
          global $langlink, $admin_site;
          ?><div class="col">
          <?php if (!$Grund) { ?>
          <h1>
          <?php echo translate_text('Fehler beim laden!'); ?>
          </h1>
          <?php } else { ?>
          <h1>
          <?php echo translate_text($Grund); ?>
          </h1>
          <?php } ?>
          <script type="application/javascript">
          window.setTimeout(function() {
          window.location.href =
          "index.php<?php echo (isset($langlink) and $langlink) ? '?'.$langlink : NULL;
          echo (isset($admin_site) and $admin_site) ? ((isset($langlink) and $langlink) ? '&'.$admin_site : '?'.$admin_site) : NULL; ?>";
          }, 5000);
          </script>
          </div>
          <?php
          }

            6 days later

            And has anything been found out about it yet?

              Hello,

              Thanks for the snippet. Something is not correct here. We're looking into it right now, I will get back as soon as I know more.

              Thank you!

                The fix for this one will be present in the upcoming pre-release.

                Thanks again for reporting it.

                  5 days later

                  So with version 1.33.12973, it still happens that upon reformatting, it is shifted one tab stop to the right, and even if repeated, it is shifted further...

                    Thanks for trying. I removed this from Solved issues and will look into that.

                      3 months later

                      We're no longer able to replicate this. Can you confirm it's solved?

                      Thank you!

                        Write a Reply...