Skip to content

Emmet wrapping with multiple selections in single line is extremely buggy and unreliable #49138

Closed

Description

  • VSCode Version: 1.22.2
  • OS Version: Windows 10 Home v1709

Steps to Reproduce:

  1. Select multiple words/phrases/tags on the same or different lines in an HTML file.
  2. Invoke Emmet > Wrap Individual Lines With Abbreviation
  3. Type something, then backspace, then type something else, then backspace. The code is completely ruined unless you undo.

Does this issue occur when all extensions are disabled?: Yes

Activity

  1. added
    editor-wrapping
    on May 3, 2018
  2. iansan5653 commented on May 3, 2018

    @iansan5653
    ContributorAuthor

    Here's an example:

    1. Start with The quick brown fox jumps over the lazy dog.
    2. Select quick fox and the lazy. (By holding down alt).
    3. Start Emmet Wrap.
    4. Type b, backspace, a, backspace, p, backspace, esc.
    5. Expected result is The quick brown fox jumps over the lazy dog., but actual result is:
    The quickef="|"><p>foxck</a>foxfox<p>the lazy="|">fox</a>e lazyb>the <a href="|">the lazy</a> dog.
    
  3. changed the title [-]Emmet wrapping with multiple selections is extremely buggy and unreliable[/-] [+]Emmet wrapping with multiple selections in single line is extremely buggy and unreliable[/+] on May 6, 2018
  4. ramya-rao-a commented on May 6, 2018

    @ramya-rao-a
    Contributor

    Thanks for reporting and for the detailed example!
    I've noticed that the issue is restricted to when the multiple selections are in a single line.
    Can you confirm?

  5. added
    bug
    emmet
    and removed
    editor-wrapping
    on May 6, 2018
  6. ramya-rao-a commented on May 6, 2018

    @ramya-rao-a
    Contributor

    Ian Sanders (@iansan5653) I have pushed a change to disable the live preview feature when there are multiple selections in the same line. This should unblock you from using the wrap feature.

    G.M. Hurovich (@gushuro) The logic that calculates the preview range is not quite right when there are multiple selections in the same line and is causing this issue.

    Marking this issue as "help-wanted". For folks who want to try and fix the preview feature for such case, undo the changes done in 57d9f26 to get started

  7. added
    help wanted
    on May 6, 2018
  8. iansan5653 commented on May 7, 2018

    @iansan5653
    ContributorAuthor

    Ramya Rao (@ramya-rao-a) I can confirm -- if the selection consists of several lines, each with a single word/phrase selected, it works fine. If the selection consists of multiple words on the same line, even if it also consists of several lines, then the bug occurs. However, the bug doesn't occur on any lines that just have a single selection.

  9. ramya-rao-a commented on May 7, 2018

    @ramya-rao-a
    Contributor

    Ian Sanders (@iansan5653) Thanks for confirming. The latest Insiders has the live preview of the wrap feature disabled for such cases. Give it a try.

  10. jeanp413 commented on May 8, 2018

    @jeanp413
    Contributor

    Ramya Rao (@ramya-rao-a) I'll take this up

  11. gushuro commented on May 8, 2018

    @gushuro
    Contributor

    Good catch! Hadn't thought about this particular case.
    Jean Pierre (@jeanp413) let me know if you need any guidance through the code.

  12. added a commit that references this issue on May 9, 2018
    d92f85d
  13. ramya-rao-a commented on May 14, 2018

    @ramya-rao-a
    Contributor
  14. added a commit that references this issue on May 14, 2018
  15. locked and limited conversation to collaborators on Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugemmethelp wantedverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions