From: "Sammy Mitchell"
A couple of ideas:
1) Use templates. For instance, define a "type" template, so that when you
type "type", the following is entered:
type
end type
And the cursor is positioned just after the "type" on the first line. Same
goes for "if end if", etc. Your indenting is already done (for the
bracketing portion of the statement), and, you save keystrokes also.
2) You could hook _ON_SELFINSERT_, and when you get a 'd', look to see if
the 2 previous characters were 'n' and 'e', and if before that there is a
space or tab. If so, you could CursorLeft(2), TabLeft(), CursorRight(2).
It would probably be better look for a space, and then see if the word to
the left was "end". That way you could also have identifiers starting with
"end", and not have them get indented .
Is this the kind of info you were looking for?
Sammy Mitchell
SemWare Corp.
>I need to modify the c formatting feature of tse pro 2.5 and I'm not quite
>sure how to go about it.
>I need the formatter to do something like the following
>type typetest
> integer is i
> integer is l
>end type
>
>I can get it to do the indenting to the right, what I need it to do is
>move the end type so that it is under the type statement
>same with if, else, end if
>etc
>How do I modify the source to do this left movement correctly?
>It currently correctly indents but doesn't move left correctly, for some
>reason when it does move left, it goes to the beginning of the line.
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)
|