I am trying to set up auto replace triggers in my language (sql) - so i'd like begin to be replaced with:
begin
end
so what I do is replace begin with begin\r\n\t\r\nend
Then in autoreplaceperformed, i use the following:
switch (e.AutoReplaceEntry.FindText)
{
case "begin":
{
shtb.Caret.Offset = e.Offset + 7;
} break;
}
However, this makes me end up
begin
end
- it seems like the enter after the auto replace is added after the autoreplaceperformed event - but i cannot find where to cancel this.
Doing it in KeyTyping doesn't seem to make any difference - KeyTyped seems to be too late, and handling it in KeyPress doesn't seem to make any difference either...
any ideas?
begin
end
so what I do is replace begin with begin\r\n\t\r\nend
Then in autoreplaceperformed, i use the following:
switch (e.AutoReplaceEntry.FindText)
{
case "begin":
{
shtb.Caret.Offset = e.Offset + 7;
} break;
}
However, this makes me end up
begin
end
- it seems like the enter after the auto replace is added after the autoreplaceperformed event - but i cannot find where to cancel this.
Doing it in KeyTyping doesn't seem to make any difference - KeyTyped seems to be too late, and handling it in KeyPress doesn't seem to make any difference either...
any ideas?