
I'm using the SyntaxEditor with the Web languages add-on and I'm hitting a conflict between a custom behavior I've written and intelliprompt.
The behavior is for indenting. Specifically, let's say I type the element <Toys. When I type > to close the element, I want:
1. The end tag to appear automatically (already works).
2. The end tag to be two lines beneath the start tag so there's an empty line in between.
3. The cursor to be within the empty line in between, and be indented.
So, in the end, it should look like:
<Toys>
</Toys>
with the cursor beneath the 's' in <Toys>.
However, when the indent occurs and then the user presses < (at the new cursor position), a completion list doesn't appear as it should. I've narrowed the problem down to my behavior's use of InsertText to insert the newline. I suspect the intelliprompt logic treats the newline as user input, doesn't find a match, and thus doesn't pop-up on the following keypress of <.
What I'd like to know is:
1. Does the XML add-on have a built in way to provide this style of indenting so I don't need custom logic.
2. If it doesn't, is there a way to insert the new line without interferring with intelliprompt?
3. Do you have any recommendations on how can I improve my behavior's indenting logic?
Thanks,
-Craig
The behavior:
The behavior is for indenting. Specifically, let's say I type the element <Toys. When I type > to close the element, I want:
1. The end tag to appear automatically (already works).
2. The end tag to be two lines beneath the start tag so there's an empty line in between.
3. The cursor to be within the empty line in between, and be indented.
So, in the end, it should look like:
<Toys>
</Toys>
with the cursor beneath the 's' in <Toys>.
However, when the indent occurs and then the user presses < (at the new cursor position), a completion list doesn't appear as it should. I've narrowed the problem down to my behavior's use of InsertText to insert the newline. I suspect the intelliprompt logic treats the newline as user input, doesn't find a match, and thus doesn't pop-up on the following keypress of <.
What I'd like to know is:
1. Does the XML add-on have a built in way to provide this style of indenting so I don't need custom logic.
2. If it doesn't, is there a way to insert the new line without interferring with intelliprompt?
3. Do you have any recommendations on how can I improve my behavior's indenting logic?
Thanks,
-Craig
The behavior:
[Modified at 07/13/2011 03:26 PM]