Doesn't do tab completion yet, but it's enough to get working
Ctrl-P in clang-repl.
Details
Diff Detail
Unit Tests
Event Timeline
When this gets further along, maybe we can get LLDB to use it instead of EditLine.
llvm/lib/LineEditor/LineEditor.cpp | ||
---|---|---|
30 | Nit: In theory, this should be followed with a flush of Out. In practice, it won't matter in most cases because stdio will ensure flushing stdout before accepting input on stdin. But there's no guarantee here that In and Out correspond to the standard streams. And since the prompt probably doesn't end with '\n', you cannot count on that flushing either. |
When this gets further along, maybe we can get LLDB to use it instead of EditLine.
+1
Are the presubmit errors related to this?
The change itself lgtm
llvm/lib/LineEditor/LineEditor.cpp | ||
---|---|---|
30 | +1 I'd flush here just to be sure. | |
43 | Maybe use Line.back() instead of Line[Line.size() - 1] here and below. | |
47 | Could be pop_back() instead, which would be a nice match if using Line.back() == .. for the condition above. |
Nit: In theory, this should be followed with a flush of Out.
In practice, it won't matter in most cases because stdio will ensure flushing stdout before accepting input on stdin. But there's no guarantee here that In and Out correspond to the standard streams. And since the prompt probably doesn't end with '\n', you cannot count on that flushing either.