This is an archive of the discontinued LLVM Phabricator instance.

Make clang-include-fixer--insert-line work when the difference is on an empty line
ClosedPublic

Authored by tmarek on Feb 23 2017, 3:16 AM.

Details

Summary

clang-include-fixer--insert-line has an off-by-one error because it uses (goto-char (point-min)) (forward-char chars), which is (goto-char (1+ chars)). Because of this, when the first difference was on an empty line (i.e. an include was appended to the block of includes), the pointer in the to` buffer would be on the next line.

Also wrapped calls inside another process sentinel inside with-local-quit.

Diff Detail

Event Timeline

tmarek created this revision.Feb 23 2017, 3:16 AM
This revision is now accepted and ready to land.Feb 23 2017, 8:13 AM
This revision was automatically updated to reflect the committed changes.