Giter Site home page Giter Site logo

Comments (6)

rsaihe avatar rsaihe commented on July 21, 2024

Very interestingly, just after I finished writing the previous message I decided to test the same snippet in an XML file and it indented correctly, so it definitely is specific to Vim's indentation of HTML.

from minisnip.

Jorengarenar avatar Jorengarenar commented on July 21, 2024

Yes, this is related to how Vim indents HTML. If you write it by hand, you get the following behaviour:

<div>
  test|
<div>
  test
  </div|
<div>
  test
</div>|

Notice how closing tag was re-indented after finishing it with >.
When you enter it via your snippet, the rule is not triggered since <<{}>> and </<{~1}>> aren't matching pair.

from minisnip.

rsaihe avatar rsaihe commented on July 21, 2024

Ah, that makes sense. Any idea why it does still work in XML files?

from minisnip.

Jorengarenar avatar Jorengarenar commented on July 21, 2024

Indentation for XML is implemented differently, because all XML tags need to have a closing tag, while in HTML not all of them. Thus when Vim sees any closing tag in XML, it just decreases the indent; while in HTML needs to check whether you are closing <li> or the <ul> above it.

from minisnip.

rsaihe avatar rsaihe commented on July 21, 2024

Alright, I see.

from minisnip.

Jorengarenar avatar Jorengarenar commented on July 21, 2024

Yeah, unfortunately, I don't see any straightforward way to fix the problem.

from minisnip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.