This is an archive of the discontinued LLVM Phabricator instance.

[include-fixer] try to make vim header selection more friendly.
ClosedPublic

Authored by ioeric on Jun 6 2016, 5:13 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

ioeric updated this revision to Diff 59707.Jun 6 2016, 5:13 AM
ioeric retitled this revision from to [include-fixer] try to make vim header selection more friendly..
ioeric updated this object.
ioeric added reviewers: bkramer, hokein.
ioeric added a subscriber: cfe-commits.
hokein added inline comments.Jun 6 2016, 7:39 AM
include-fixer/tool/clang-include-fixer.py
53 ↗(On Diff #59707)

We can handle the , a, q cases after res=vim.eval(to_eval) instead of handling them in exception block. They don't look like errors in my opinion.

132 ↗(On Diff #59707)

For error message, it might be better to print to stderr print >> sys.stderr, error.message?

ioeric updated this revision to Diff 59722.Jun 6 2016, 7:59 AM
ioeric marked 2 inline comments as done.
  • Addressed reviewer's comments.
bkramer edited edge metadata.Jun 7 2016, 1:46 AM

Nice! Can we somehow make the user not press enter after putting in the number? getchar() maybe?

ioeric updated this revision to Diff 59858.Jun 7 2016, 3:38 AM
ioeric edited edge metadata.
  • fixed a bug with index.
ioeric added a comment.Jun 7 2016, 3:38 AM

As per our offline discussion, getchar() does not work with options with more than 2 digits (e.g. index number > 9). I'll keep it as it is now until we come up with a better solution.

bkramer accepted this revision.Jun 7 2016, 5:25 AM
bkramer edited edge metadata.

lg then.

This revision is now accepted and ready to land.Jun 7 2016, 5:25 AM
This revision was automatically updated to reflect the committed changes.