By registering with us, you'll be able to discuss, share and exchange private messages with other members of our community.

SignUp Now!

How does ClearEditLine() work?

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

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.
And TakeCmd.h file says
  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.
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)?
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! ;)
OK. Thanks. That's fine. I didn't think of how to handle insertions.

Similar threads