I was reading through the online help for the GetLineInfo callback, and a few questions surfaced in my mind. First of all, the help emphasizes the difference between the line count in buffer and actual count of lines recieved. I can appreciate that but what count should I use with GetLineInfo exactly? I am guessing that it's GetLinesInBufferCount but would like to be sure about that.
Another question pertains to the part of the help which mentions the possibility of the last line being blank. This is more important for me, due to the task I am employing GetLineInfo for. I want to make a trigger which would match on a specific message and call a script to:
1. Find the line number of the matched line
2. Get the text of the line that follows immediately next
3. See if the latter line does NOT match a specific regexp
4. Perform some actions based on the results of 3
Now, I know that the line in 1 will be coming with a newline, so I need to know exactly if Muclient will add a blank line after that one or not. Meaning: whether I should do GetLineInfo(lastLine + 1) or GetLineInfo(lastLine + 2) (exact syntax ommited) to grab the following line? Hope that makes sense.
This also brings up another question: if Muclient will add a blank line after a newline, then would doing GetLinesInBufferCount in script called by a trigger return the number of the matched line or the number of the blank line following it? Sorry, but field testing all of this is just plain painful, so I am hoping that the answers exist already.
Thanks in advance.
Another question pertains to the part of the help which mentions the possibility of the last line being blank. This is more important for me, due to the task I am employing GetLineInfo for. I want to make a trigger which would match on a specific message and call a script to:
1. Find the line number of the matched line
2. Get the text of the line that follows immediately next
3. See if the latter line does NOT match a specific regexp
4. Perform some actions based on the results of 3
Now, I know that the line in 1 will be coming with a newline, so I need to know exactly if Muclient will add a blank line after that one or not. Meaning: whether I should do GetLineInfo(lastLine + 1) or GetLineInfo(lastLine + 2) (exact syntax ommited) to grab the following line? Hope that makes sense.
This also brings up another question: if Muclient will add a blank line after a newline, then would doing GetLinesInBufferCount in script called by a trigger return the number of the matched line or the number of the blank line following it? Sorry, but field testing all of this is just plain painful, so I am hoping that the answers exist already.
Thanks in advance.