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

Uses js/ts indenting inside the template instead of the template language's indenting #14

Open
cormacrelf opened this issue Sep 29, 2017 · 1 comment

Comments

@cormacrelf
Copy link

cormacrelf commented Sep 29, 2017

With minimal vimrc, this is what :JsPreTmpl html indents as:

let tmpl = `
  <div>
  <div class="nested">
  <p> content </p>
  </div>
  </div>
`;

That is, =ap on that will not change anything. Every level of nesting will be on the same indent level, no matter what. Whereas the below will indent as:

let tmpl = `
let js = {
  aaa: blah.connect().map(x => {
    one.two(
      three
    ).four(() => {
      five
    });
    return [
      "six",
      7
    ];
  })
}
`;

Indenting in vim is a mystery to me, so I have no idea how to fix that.

Edit: I should mention I tried :setf typescript.html, but then this plugin has no effect at all. That works with vim-pandoc-syntax and the code blocks feature, but not here.

@Quramy
Copy link
Owner

Quramy commented Sep 29, 2017

@cormacrelf . Thanks for using this plugin 😄

This plugin effects only syntax highlighting. This never change your indenting.

I guess that the above indenting example get the same results without this plugin. The first(HTML) will be indented flatly, the second(js in js) are indented in the JavaScript way 🤔

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

No branches or pull requests

2 participants