Author Topic: Can SlickEdit do this?  (Read 3588 times)

Colen

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Can SlickEdit do this?
« on: November 28, 2007, 03:41:20 am »
Hey all,

I'm trying out SlickEdit for the first time, and I'm blown away - it does some really nice stuff, AND it's easy to use. The last time I saw an editor this capable, the default keybindings were from 20 years ago and I couldn't use it. Good job!

I have some questions about stuff that I can or can't do with SlickEdit.

1) We use a kinda weird indenting style like this:

Code: [Select]
if (whatever) {
  do stuff
  }

And for XML:

Code: [Select]
<tag attr="hello"> {
  text goes here
  </tag>

I.e., the closing } or </tag> is indented. Is there any way to configure SlickEdit to indent stuff this way?

2) For a bunch of the XML documents that we edit, we don't specify a DTD at the top of the document. Is it possible to associate an XML DTD with a file extension, so for example saying "All .xxx files use xxx.dtd"?

Thanks for your help!

Ding Zhaojie

  • Senior Community Member
  • Posts: 194
  • Hero Points: 37
Re: Can SlickEdit do this?
« Reply #1 on: November 28, 2007, 01:02:55 pm »
Very weired style... I did some experiments and found a way (C-like languages only), but not perfect.

1. Choose the Begin-end Style 3
2. Uncheck the "Insert braces immediately".
3. Uncheck the "Syntax expansion" in the " Extension setup -> Indent Tab" (optical)

When you typing, SE will help you indent the "}".
« Last Edit: November 28, 2007, 01:05:56 pm by Ding Zhaojie »

David_O

  • Senior Community Member
  • Posts: 152
  • Hero Points: 8
Re: Can SlickEdit do this?
« Reply #2 on: November 28, 2007, 02:21:33 pm »
For XML, SlickEdit 2007 added a feature called XML/HTML formatting.  One of it's purposes is to do element/tag layout for you.  If enabled, it will add an end tag, blank lines, and any indents etc. when the closing '>' is typed on a new start tag.  The layout options are very flexible and can be set differently for individual tags.  Whole formatting schemes can be created so that you can have different setting for different XML languages.

That said, the automatic layout assumes that the start and end tags of an element will be at the same indent level.  Sorry, this is one use case we did not anticipate.  Fortunately, this is not a difficult capability to add if it is done simply.  By that, I mean, we could add a variable to hold this extra end tag indent and then you could set at the command line (via the set-var() command) to however many spaces you like.  It would not be set via a gui and it would be the same for all tags in all schemes.  I doubt that we would want to add such an option to the gui since this is a rare style and there are already many options.

I will add a feature request for this that could go out with the next release or hotfix.  If you let me know what version you're using, I might be able to post one here for you to test.

Thanks for the feedback.

Colen

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: Can SlickEdit do this?
« Reply #3 on: November 28, 2007, 09:35:06 pm »
For XML, SlickEdit 2007 added a feature called XML/HTML formatting.  One of it's purposes is to do element/tag layout for you.  If enabled, it will add an end tag, blank lines, and any indents etc. when the closing '>' is typed on a new start tag.  The layout options are very flexible and can be set differently for individual tags.  Whole formatting schemes can be created so that you can have different setting for different XML languages.

That said, the automatic layout assumes that the start and end tags of an element will be at the same indent level.  Sorry, this is one use case we did not anticipate.  Fortunately, this is not a difficult capability to add if it is done simply.  By that, I mean, we could add a variable to hold this extra end tag indent and then you could set at the command line (via the set-var() command) to however many spaces you like.  It would not be set via a gui and it would be the same for all tags in all schemes.  I doubt that we would want to add such an option to the gui since this is a rare style and there are already many options.

I will add a feature request for this that could go out with the next release or hotfix.  If you let me know what version you're using, I might be able to post one here for you to test.

Just a simple command line variable would be fantastic. I'm using SlickEdit Version 12.0.3.0.