[Format] Work around current vim bugs in clang-format.py
authorSam McCall <sam.mccall@gmail.com>
Wed, 15 Apr 2020 13:12:30 +0000 (15:12 +0200)
committerSam McCall <sam.mccall@gmail.com>
Wed, 15 Apr 2020 18:11:14 +0000 (20:11 +0200)
commit591be7ec500c151d9232366042e21c74e006292c
tree21c58b5f87ec588fc3c476f82efe113c3843976c
parent2dd17ff08165e6118e70f00e22b2c36d2d4e0a9a
[Format] Work around current vim bugs in clang-format.py

Summary:
Do line/col to byte conversions on the python side rather than relying on vim.
Its calculations are off when text annotations are present:
- https://github.com/vim/vim/issues/5930
- https://github.com/vim/vim/issues/3718 (fixed, but vim 8.1 is still common)

Reviewers: hokein

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78198
clang/tools/clang-format/clang-format.py