Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template/HTML Folding not folding multi line elements properly #1294

Closed
3 tasks done
mika76 opened this issue May 15, 2019 · 5 comments
Closed
3 tasks done

Template/HTML Folding not folding multi line elements properly #1294

mika76 opened this issue May 15, 2019 · 5 comments

Comments

@mika76
Copy link

mika76 commented May 15, 2019

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: MacOs
  • Vetur version: 0.20.0
  • VS Code version:1.33.1

Problem

With the following htm (where attributes have been split over multiple lines and closing bracket is on own line)

<div
    class="someclass"
    style="somestyle"
>
   <div class="inner"></div>
   <div class="inner2"></div>
</div>

When trying to fold/collapse the first div, it does not collapse until it's closing </div> tag but only collapses the opening tag and it's attributes. The rest of the inner tags are still exposed...

Basically it ends up looking like:

<div...
   <div class="inner"></div>
   <div class="inner2"></div>
</div>

In a normal HTML file all the inner tags are also folded and hidden and only the start and end tag are visible. eg:

<div...
</div>

Reproducible Case

Very easy to reproduce. Just split multiple attributes of a tag onto their own lines. Then try and fold that element.

@alensiljak
Copy link

alensiljak commented May 25, 2019

The closing ">" is in a separate line.

<div
    class="someclass"
    style="somestyle"
>

If I move it up after the last attribute, the folding works as expected.

<div
    class="someclass"
    style="somestyle">

However, the next doc formatting moves it back into a separate line.

@mika76
Copy link
Author

mika76 commented May 25, 2019

Yeah, prettier too. The thing is that a normal html file does not collapse like this. So all I'm saying is it should be consistent.

@octref
Copy link
Member

octref commented Jun 19, 2019

Vetur now only have indentation based folding: #899 (comment).

This becomes possible after #899.

@mika76
Copy link
Author

mika76 commented Jun 19, 2019

@octref awesome - can't wait 😊

@mika76
Copy link
Author

mika76 commented Sep 10, 2020

This is related to #2234 and was fixed in #2244

@mika76 mika76 closed this as completed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants