diff --git a/lldb/tools/driver/IOChannel.cpp b/lldb/tools/driver/IOChannel.cpp index 25274581efed..0ed6fd326794 100644 --- a/lldb/tools/driver/IOChannel.cpp +++ b/lldb/tools/driver/IOChannel.cpp @@ -50,6 +50,17 @@ IOChannel::GetPrompt () return pos->second.c_str(); } +bool +IOChannel::EditLineHasCharacters () +{ + const LineInfo *line_info = el_line(m_edit_line); + if (line_info) + return line_info->cursor != line_info->buffer; + else + return false; +} + + void IOChannel::EraseCharsBeforeCursor () { diff --git a/lldb/tools/driver/IOChannel.h b/lldb/tools/driver/IOChannel.h index e3c44b58d236..fbeaac4a8683 100644 --- a/lldb/tools/driver/IOChannel.h +++ b/lldb/tools/driver/IOChannel.h @@ -96,6 +96,9 @@ public: const char * GetPrompt (); + bool + EditLineHasCharacters (); + void EraseCharsBeforeCursor ();