vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 593 forks source link

Moving lines with alt + arrow breaks indentation and formatting #534

Open ankitsinghaniyaz opened 6 years ago

ankitsinghaniyaz commented 6 years ago

Info

Problem

Using Alt + Arrow keys to move lines up and down doesn't do the right indentation/formating

Reproducible Case

Write a few nested blocks in template section like so:

<template>
  <el-container>
    <el-header class="nav">
      <div class="brand">
        <h2><strong>Shareito</strong></h2>
      </div>
      <div class="menu-wrapper">
        <el-menu default-active="1" class="no-border-bottom" mode="horizontal">
          <el-menu-item index="1">Activity</el-menu-item>
          <el-menu-item index="2">Integrations</el-menu-item>
          <el-menu-item index="3" class="no-border-bottom">
            <a href="/team/invite">
              <el-button type="primary">Add User</el-button>
            </a>
          </el-menu-item>
        </el-menu>
      </div>
    </el-header>
    <el-main>
      <!-- all content goes here -->
      <slot></slot>
    </el-main>
    <el-footer>
      <!-- add content here as we need -->
    </el-footer>
  </el-container>
</template>

Now use the arrow + up/down key to move any line, the formatting seems to be broken, the line is not indented to the right position.

octref commented 6 years ago

Yes, you need to reformat the template region after moving lines.

ctf0 commented 6 years ago

@octref cant we have support like the docs says ?

octref commented 6 years ago

@ctf0 Thanks — I gave it a try. Seems it does not work correctly for embedded languages. I'll open an issue in VS Code to track this.