vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Tabbing through snippet placeholders is circular, the cycle breaks on ENTER or ESC. Need better user experience

Open medifle opened this issue 10 years ago • 7 comments

  • VSCode Version: 1.0.0-stable
  • OS Version: 10.11.4

Steps to Reproduce:

  1. Open VS Code using --disable-extensions flag
  2. Cmd-N to open an empty file
  3. Cmd-K M to choose Language Mode to HTML
  4. Enter ! or html:5 and hit TAB to expand
  5. Use TAB to jump to inside the body tag
  6. Enter any legal emmet syntax like .container>.row and hit TAB

Here is an animated GIF:

vscode-emmet-html5

What I expect to happen:

As the last step above has been executed, normally the emmet in other editors should perform its expand action and the result is:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <div class="conainer">
    <div class="row"></div>
  </div>
</body>
</html>

However, VS Code does not do that, just jumping back to inside the title tag.

medifle avatar Apr 18 '16 03:04 medifle

You need to press [ENTER] when focus is on .

traktraktrugui avatar May 17 '16 13:05 traktraktrugui

@traktraktrugui This experience is not very good.We should add an option to disable looping focus

yisibl avatar Jun 21 '16 03:06 yisibl

If it helps with debugging, pressing [Esc] after the first expansion, means that the next expansion will work.

atwright147 avatar Sep 09 '16 21:09 atwright147

This is totally unexpected behavior:( While @mrmlnc don't ask me to press Enter or Esc I can't write my emmet expressions.

Sapunov avatar Oct 06 '16 09:10 Sapunov

This is due to the way we treat snippets with placeholders. Tabs always circle among the placeholders. Hitting ENTER or ESC breaks the cycle.

@jrieken You have any thoughts here on how we could make the experience better?

ramya-rao-a avatar Feb 01 '17 01:02 ramya-rao-a

Yeah, that how snippets are currently implemented. I personally also like the tab-tab-done mode better. I am planning a bigger redo of the snippet controller in Spring and could tackle this than

jrieken avatar Feb 01 '17 09:02 jrieken

This got implemented via https://github.com/Microsoft/vscode/pull/26042. Snippet insertion now follows the tab-tab-done model, meaning snippet mode exits as soon as the the final tab stop is reached. Also Enter doesn't exit snippet anymore by default.

jrieken avatar May 15 '17 10:05 jrieken