Add an API to determine whether there are any characters on the current input line.

llvm-svn: 157789
This commit is contained in:
Jim Ingham 2012-06-01 01:03:40 +00:00
parent 5c502811f1
commit 6d10c17a31
2 changed files with 14 additions and 0 deletions

View File

@ -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 ()
{

View File

@ -96,6 +96,9 @@ public:
const char *
GetPrompt ();
bool
EditLineHasCharacters ();
void
EraseCharsBeforeCursor ();