Hi, I'm looking for a bit of advice after spending hours looking at this and getting no where. I'll offer a bit of background so bear with the explanation.
I'm trying to auto-create the ending for an outlining node whenever the user presses Enter after having typed out the beginning of an outlining node.
For example, if an outlining node consists of BEGIN....END then after typing BEGIN, followed by enter, I want to auto-type the END keyword so as to close the node.
If kind of got this working by handling the SmartIndent event. Essentially, what I do is (starting from the end of the document), I iterate backwards looking for EndToken. If I find one, I check to see if it has a matching BeginToken, in which case I move on. If I find no EndToken then I know that I should create one automatically.
The problem comes when working with nested outlining nodes.
For example:
begin
begin
end
What happens here is that when pressing enter at the inner BeginToken, the EndToken that previously was paired up with the outer BeginToken is now paired up with the inner one. And as a result the EndToken is never created.
Has anyone implemented this type of functionality successfully, if so could please provide me with some pointers?
Thanks,
Karl
I'm trying to auto-create the ending for an outlining node whenever the user presses Enter after having typed out the beginning of an outlining node.
For example, if an outlining node consists of BEGIN....END then after typing BEGIN, followed by enter, I want to auto-type the END keyword so as to close the node.
If kind of got this working by handling the SmartIndent event. Essentially, what I do is (starting from the end of the document), I iterate backwards looking for EndToken. If I find one, I check to see if it has a matching BeginToken, in which case I move on. If I find no EndToken then I know that I should create one automatically.
The problem comes when working with nested outlining nodes.
For example:
begin
begin
end
What happens here is that when pressing enter at the inner BeginToken, the EndToken that previously was paired up with the outer BeginToken is now paired up with the inner one. And as a result the EndToken is never created.
Has anyone implemented this type of functionality successfully, if so could please provide me with some pointers?
Thanks,
Karl