[llvm-bugs] [Bug 37868] New: clang-format 7.0.0 does not account for lines inserted due to include regrouping when computing new cursor position

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 19 23:12:20 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37868

            Bug ID: 37868
           Summary: clang-format 7.0.0 does not account for lines inserted
                    due to include regrouping when computing new cursor
                    position
           Product: new-bugs
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: developer at martinwinter.com
                CC: llvm-bugs at lists.llvm.org

In clang-format 7.0.0, when the option “IncludeBlocks: Regroup” is active with
at least two “IncludeCategories”, the new cursor position after formatting does
not account for any inserted lines between include groups. I can reliable
reproduce this: For example, when an existing number of includes (not separated
by empty lines) is grouped into three new groups, the inserted two lines are
not accounted for, causing a cursor located below the includes to jump towards
the beginning of the document by two characters. In other words, the numeric
cursor position remains the same (e. g. 913) when it should have been increased
(e. g. by 2 to 915). Positioning works fine above or within the includes
themselves.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180620/d84b2a1c/attachment.html>


More information about the llvm-bugs mailing list