Each word turning into a tag when editing in XML?

A few days ago I started having a problem that is driving me mad (it happened with the two latest EAPs, I'm now using IU-94.539). When typing in an XML file, every word is turned into a tag after I press enter...

So, for instance, in this file

<messagebundle >
  <msg name="InvalidIp"
       desc="Error message shown when max filters number is exceeded.">
    Too many blocked sites. The maximum number of urls that can be blocked is <ph name="MAX_FILTERS"><ex>1500</ex>%1</ph>.
    You have <ph name="REMAINING_FILTERS"><ex>4</ex>%2</ph> remaining filters.
  </msg>
</messagebundle>



If I type "aaa" followed by a space right after the msg tag I get:


<messagebundle >
  <aaa></aaa>
  <msg name="InvalidIp"
       desc="Error message shown when max filters number is exceeded.">
    Too many blocked sites. The maximum number of urls that can be blocked is <ph name="MAX_FILTERS"><ex>1500</ex>%1</ph>.
    You have <ph name="REMAINING_FILTERS"><ex>4</ex>%2</ph> remaining filters.
  </msg>
</messagebundle>


if I type fast, only a part of the word is used for the tag. E.g. if I type "test" fast I get:


<messagebundle >
  te
  <st></st>
  <msg name="InvalidIp"
       desc="Error message shown when max filters number is exceeded.">
    Too many blocked sites. The maximum number of urls that can be blocked is <ph name="MAX_FILTERS"><ex>1500</ex>%1</ph>.
    You have <ph name="REMAINING_FILTERS"><ex>4</ex>%2</ph> remaining filters.
  </msg>
</messagebundle>


any idea about what could be causing this?

Just in case I attach my live templates configuration files.


Attachment(s):
live-templates.zip
3 comments

Hello Davide,

This is not a problem, but a new feature:
http://blogs.jetbrains.com/idea/2010/03/zen-coding-support-in-intellij-idea/
It can be turned off in Settings | Editor | Smart Keys.

A few days ago I started having a problem that is driving me mad (it
happened with the two latest EAPs, I'm now using IU-94.539). When
typing in an XML file, every word is turned into a tag after I press
enter...

So, for instance, in this file

<messagebundle >

<msg name="InvalidIp"
desc="Error message shown when max filters number is
exceeded.">
Too many blocked sites. The maximum number of urls that can be
blocked is <ph name="MAX_FILTERS"><ex>1500</ex>%1</ph>.
You have <ph name="REMAINING_FILTERS"><ex>4</ex>%2</ph> remaining
filters.
</msg>
</messagebundle>
If I type "aaa" followed by a space right after the msg tag I get:

<messagebundle >
<aaa></aaa>
<msg name="InvalidIp"
desc="Error message shown when max filters number is
exceeded.">
Too many blocked sites. The maximum number of urls that can be
blocked is <ph name="MAX_FILTERS"><ex>1500</ex>%1</ph>.
You have <ph name="REMAINING_FILTERS"><ex>4</ex>%2</ph> remaining
filters.
</msg>
</messagebundle>
if I type fast, only a part of the word is used for the tag. E.g. if I
type "test" fast I get:

<messagebundle >
te
<st></st>
<msg name="InvalidIp"
desc="Error message shown when max filters number is
exceeded.">
Too many blocked sites. The maximum number of urls that can be
blocked is <ph name="MAX_FILTERS"><ex>1500</ex>%1</ph>.
You have <ph name="REMAINING_FILTERS"><ex>4</ex>%2</ph> remaining
filters.
</msg>
</messagebundle>
any idea about what could be causing this? Just in case I attach my
live templates configuration files.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5258771#5258771

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

yole wrote:

Hello Davide,

This is not a problem, but a new feature:
http://blogs.jetbrains.com/idea/2010/03/zen-coding-support-in-intellij-idea/
It can be turned off in Settings | Editor | Smart Keys.

Uh, that was unexpected!

I understand the rationale for the feature, but its implementation leaves me puzzled.

For instance: why do I get tags created when I'm typing inside a string? E.g.:

<msg name="InvalidIp"
       desc="Error message shown |when max filters number is exceeded.">



Type "test" where the caret is, I get:

<msg name="InvalidIp"
       desc="Error message shown <test></test>when max filters number is exceeded.">



also, there's no way to get a comment. Typing "<!--" followed by space I get:

<!<-->
  </-->



fix the thing by hand, get this: <!-- | --> and start typing, I get:

<!-- <typing></typing> -->

Also, if I type:

form.form-comment

too fast and press space, I get:

form.form-comme
    <nt></nt>



only if I wait a bit before pressing space I get this:

<form ></form>

Also, if I type "a" followed by a number of "space" chars, I get this:

<a
    <><><><><><><><>></>></>></>></>></>></>></>></>></a>



which doesn't make much sense.

I think I will turn the feature off for now.
0

yup, I thought I had an error in my templates because I was having same issues. I have my templates triggered on "space" character and this new feature is really pain in the ass.
I ended up turning my templates be triggered by the tab key..

0

Please sign in to leave a comment.