Skip to content

[html] Mirror cursor devolves into multi-cursor when undoing (ctrl-z) #87732

Closed

Description

Issue Type: Bug

  1. Open html document and add a tag
    <div></div>
  2. Place cursor at the end of the open tag and add a space
    <div ></div>
  3. Undo (ctrl-z) once adds a space to close tag (unexpected, but probably an implementation detail of the space special case 🤷‍♂)
    <div ></div >
  4. Undo (ctrl-z) twice removes the space from the end of both tags
    <div></div>
  5. Add a space and start typing
    <div class="aClass"></div class="aClass">

Expected:
<div class="aClass"></div>

Basically, after the second undo, you're left with a normal multi-cursor. Even if you move the cursor around the document and keep typing the multi-cursor follows.

VS Code version: Code 1.41.1 (26076a4, 2019-12-18T14:58:56.166Z)
OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Xeon(R) E-2176M CPU @ 2.70GHz (12 x 2712)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.74GB (16.78GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (11)
Extension Author (truncated) Version
ng-template Ang 0.900.3
xml Dot 2.5.0
json-tools eri 1.0.2
terraform mau 1.4.0
vscode-json5 mrm 1.0.0
remote-wsl ms- 0.41.6
csharp ms- 1.21.9
vs-keybindings ms- 0.2.0
debugger-for-chrome msj 4.12.3
vscode-icons vsc 9.6.0
better-align wwm 1.1.6

Activity

  1. added
    bug
    on Dec 26, 2019
  2. added
    html
    on Jan 8, 2020
  3. added this to the January 2020 milestone on Jan 8, 2020
  4. octref commented on Jan 8, 2020

    @octref
    Contributor

    Good catch, although I'm wondering why you would use Cmd-Z instead of backspace in this case.

  5. rlyczynski commented on Jan 8, 2020

    @rlyczynski
    Author

    That's a fair question. I guess its just a habit I've built over time. I like to think that I undo my typos instead of deleting so that unwanted changes aren't left on the "undo stack", but honestly it's probably just a weird quirk that I do.

    In fairness this is probably pretty small edge case but something I noticed and the resulting functionality seemed weird so I reported it.

  6. added
    editor-synced-region
    on Jan 10, 2020
  7. octref commented on Jan 30, 2020

    @octref
    Contributor

    This will be fixable if we do #88424.

  8. octref commented on Mar 18, 2020

    @octref
    Contributor

    In tomorrow's insiders html.mirrorCursorOnMatchingTag is replaced with editor.renameOnType. The new implementation fixes this issue. You can find more details here: #88424 (comment)

  9. locked and limited conversation to collaborators on May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugeditor-synced-regionhtmlverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions