Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Folding loses scope in multi-line text values #33

Closed
jgeorgeson opened this issue Jul 17, 2015 · 3 comments
Closed

Folding loses scope in multi-line text values #33

jgeorgeson opened this issue Jul 17, 2015 · 3 comments

Comments

@jgeorgeson
Copy link

I originally filed this as atom/atom#7934 and was told to refile it here.

Looking at an Ant build file with a target that uses an echo task with an task using a multi-line text value. Something like this

<?xml version="1.0" encoding="UTF-8"?>
<project name="lgcbuildutils">
<target name="init">
...
</target>
<target name="clean">
...
</target>
<target name="compile">
...
</target>
<target name="special">
        ...
        <echo file="${reportFile}"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="file:///usr/share/mylib/conversion.xsl"?>
<modules/>]]>
        </echo>
        ....
</target>
<target name="deploy">
...
</target>
</project>

When I fold all, it leaves the <?xml-stylesheet> unfolded, and everything after that line is folded under it. In the first screenshot you can see that everything between two such echo tasks was folder under the first <?xml-stylesheet>. In the second you can see the and the first <?xml-stylesheet> unfolded.

folded

unfolded

My original submission I thought it was from the <?xml ...?> elements but it turned out to be any multi-line text value.

@50Wliu
Copy link
Contributor

50Wliu commented Sep 27, 2015

Folding is currently indentation-based, so I don't think language-xml can solve this right now. Sorry 😦.

@50Wliu 50Wliu closed this as completed Sep 27, 2015
@tekdj1
Copy link

tekdj1 commented Oct 14, 2015

I am trying to move away from Notepad++ and start using Atom, since I find myself using both Windows and MAC. Atom works on both OS's, while Notepad++ works only on Windows.

I work on prepping Cisco Network scripts all the time, and use XML to better organize my changes. However, folding doesn't seem to work, unless I do indent. Problem with doing indents is that when I need to paste config on some of my devices, they don't like indents, and if I remove indents, the folding breaks.

In notepad++, it doesn't care about indents.

int gig0/1
desc workstation
switchport mode access
switchport access vlan 33
no shut

Also, in notepad++, it doesn't care if I put an ! in front of . Putting an ! is helpful, so that when I paste configs, I can paste the section too into my config, and it will be ignored because of !, and I won't get an Error.

!

int gig0/1
desc workstation
switchport mode access
switchport access vlan 33
no shut

!

It just seems that Notepad++ is much more flexible in these terms. It would be nice if Atom can be more flexible, since it can have many functions.

@tekdj1
Copy link

tekdj1 commented Oct 14, 2015

Also, it appears that its folding from int gig0/1 all the way down, just because it has a slight indent for subsequent commands, even though int gig0/1 is not surrounded with < >. Wish it wouldn't do this, and instead it respected folding on the < > sections, especially when having file saved as an XML. Again it appears that Notepad++ is much more flexible in this.

int gig0/1
desc workstation
switchport mode access
switchport access vlan 33
no shut

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants