[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Aug 1 01:46:03 PDT 2020


teemperor added a comment.

In D81001#2188888 <https://reviews.llvm.org/D81001#2188888>, @gedatsu217 wrote:

> Although I thought of how to clear all the following characters, I did not come up with it. So, I will try to fill the space. Should I add how many spaces? If I add too many spaces, sequences will be two lines, but if  I add a few spaces, I can't handle some of the cases.

It should be possible to keep track of how long the previous autosuggestion was and then print the difference between the current autosuggestion length and the previous one in spaces to clear the buffer. So, something like `spaces_to_print = line.size() + to_add.size - m_previous_autosuggestion_size` (and if that's positive we add that many spaces).

Also could you rebase the diff here when you have time (e.g., regenerate the diff from you changes on top of the latest master commit)? It no longer applies at the moment without having to manually resolve a conflict.



================
Comment at: lldb/include/lldb/Host/Editline.h:364
   void *m_completion_callback_baton = nullptr;
-
   std::mutex m_output_mutex;
----------------
Unrelated removed line.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81001/new/

https://reviews.llvm.org/D81001



More information about the lldb-commits mailing list