[all-commits] [llvm/llvm-project] ad83be: [clang-format] Don't move comments if AlignTrailin...

Maíra Canal via All-commits all-commits at lists.llvm.org
Thu Dec 1 16:07:40 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ad83bead3d42082f858d810a5b9f43ed096a6e3c
      https://github.com/llvm/llvm-project/commit/ad83bead3d42082f858d810a5b9f43ed096a6e3c
  Author: Maíra Canal <mairacanal at riseup.net>
  Date:   2022-12-01 (Thu, 01 Dec 2022)

  Changed paths:
    M clang/lib/Format/WhitespaceManager.cpp
    M clang/unittests/Format/FormatTestComments.cpp

  Log Message:
  -----------
  [clang-format] Don't move comments if AlignTrailingComments: Leave

For comments that start after a new line, currently, the comments are
being indented. This happens because the OriginalWhitespaceRange
considers newlines on the range. Therefore, when AlignTrailingComments:
Kind: Leave, deduct the number of newlines before the token to calculate
the number of spaces for trailing comments.

Fixes #59203.

Differential Revision: https://reviews.llvm.org/D139029




More information about the All-commits mailing list