How does ClearEditLine() work?

#1
When I do this in a plugin keystroke handler (with/without the commented stuff)

Code:
ClearEditLine(lpki->pszLine);
lpki->nKey = 13;
//lpki->pszCurrent = lpki->pszLine;
//lpki->nColumn = lpki->nHomeColumn;
//lpki->nRow = lpki->nHomeRow;
return 0;
the command line is executed. I was hoping to get the command line as it was when the prompt was issued.
 
#2
And TakeCmd.h file says
Code:
  int     nHomeRow;     // start row
   int     nHomeColumn;   // start column
   int     nRow;       // current row in window
   int     nColumn;     // current column in window
while they are all in screen buffer coordinates.
 
#4
ClearEditLine takes a pointer to the current position in the line and writes spaces from there to the end of the string.

Exactly what is it that you're trying to do?
See my first post in this thread. I want to get rid of a command-line-in-progress. So are you saying it clears what the user sees but doesn't actually get rid of the string? Is there any value in that which I'm missing? It actually seems dangerous. I get around the difficulty with a simple "lpki->pszLine[0] = 0". Why doesn't ClearEditLine() do that when I say ClearEditLine(lpki->pszLine)?
 

rconn

Administrator
Staff member
May 14, 2008
10,532
94
#5
It does not delete the remainder of the line. It's intended for clearing the remainder of the display line before inserting or deleting characters, before redisplaying the line.

Why doesn't ClearEditLine() do that when I say ClearEditLine(lpki->pszLine)?
It's more important that ClearEditLine() does what I need than what you imagine it should! ;)