Greetings,
This is a feature that Netbeans has that I really like.
Suppose you have
<component>
<foo></foo>
</
As soon as you type the forward slash the word component is emitted by textpad because that would complete the open xml tag.
Saves typing and is helpful to see if you are prorperly closing tags because if the completion does not happen you know something is incorrectly closed.
Completion for XML tags
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- BenjiSmith
- Posts: 49
- Joined: Fri Jan 16, 2004 9:37 pm
- Contact:
This is exactly the kind of thing that I think could be implemented as a user-defined function, if we had a powerful enough Macro language at our disposal.
Here's the pseudocode I'd write:
In my opinion, the MOST IMPORTANT aspect of any Macro language that we get is that we have access to application objects and events. If you agree, chip in your opinion here:
http://textpad.com/forum/viewtopic.php?t=3775
Here's the pseudocode I'd write:
Code: Select all
on event(KEY_PRESS) {
if (currentFile.fileExtension == 'XML') {
if (lastKeysPressed(2) == '</') {
String xmlTag = searchBackwardForOpenTag();
autocomplete.addChoice(xmlTag);
}
}
}
String searchBackwardForOpenTag() {
// BLAH BLAH BLAH
}
http://textpad.com/forum/viewtopic.php?t=3775
-
- Posts: 9
- Joined: Mon Apr 26, 2004 8:32 pm
You must submit your macro code
Okay, I voted for the feature. In exchange when the time comes you need to submit back your macro code to the user community.
Regards,
Dave
Regards,
Dave