Author Topic: Script Idea - Close Tag, Select Tag, etc.  (Read 2498 times)

Offline scunliffe

  • Registered User
  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Script Idea - Close Tag, Select Tag, etc.
« on: February 08, 2011, 05:13:03 PM »
I write a lot of code in some form of SGML (e.g. HTML, XML, XSL, SVG, JSP, PHP) and thus I write a lot of tags.

There are 5 scripts I created for another editor that I would love to be able to use/re-create in Hippo Edit.

  • Close Active Tag
  • Move to Next Tag
  • Move to Previous Tag
  • Select to Next Tag
  • Select to Previous Tag

1.) Close Active Tag:
This worked by closing the current tag I was editing... e.g. If I wrote:

Code: [Select]
<select name="foo">
and my cursor was anywhere after the open angled bracket, pressing a hotkey would run my script... which would search backwards for the open angled bracket, then search forward for whitespace, save the tagname as a variable, search forward for the closing angle bracket, then insert after it...

Code: [Select]
</{variableValue}>
Thus closing whatever tag I was editing... regardless if it was a random XML/XSL tag, a JSP tag, or whatever.

2.,3.,4.,5.) Similarly, these would move my cursor (optionally selecting) to tag start/stop positions.

To quote Martha... its a little thing, but a good thing.

If there were some way to accomplish the same kind of thing in HippoEdit, I would love it.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2219
  • Karma: +37/-3
    • HippoEDIT
Re: Script Idea - Close Tag, Select Tag, etc.
« Reply #1 on: February 09, 2011, 12:12:16 AM »
Hi Steve,

thanks for suggested help! It should be possible in month or less. At least with dev version ;)

Best regards,
Alex.