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

Cutting or deleting opening tag content causes undo loop #608

Open
phoenixeliot opened this issue Apr 19, 2022 · 1 comment
Open

Cutting or deleting opening tag content causes undo loop #608

phoenixeliot opened this issue Apr 19, 2022 · 1 comment

Comments

@phoenixeliot
Copy link

Issue Type: Bug

Write this in a TSX file:

function Foo() {
  return <div className="stuff">
  </div>
}

Select div className="stuff"
Cut with cmd-x
Undo with cmd-z
Undo again with cmd-z
Undo again with cmd-z

Result: Instead of undoing the cut, it simply toggles between these two states forever, and blocks off all undo history before this action:

function Foo() {
  return <div>
  </div>
}
function Foo() {
  return <>
  </>
}

I suspect what's happening is that undoing is causing the extension to trigger a change, which is triggering a new action to be pushed onto the undo stack.

Slightly different results happen if you delete instead of cut:

function Foo() {
  return <div className="">
  </div>
}
function Foo() {
  return < className="">
  </>
}

And if the opening and closing tags are on the same line, it behaves in a more complex but still incorrect fashion.

Extension version: 0.1.10
VS Code version: Code 1.66.2 (Universal) (dfd34e8260c270da74b5c2d86d61aee4b6d56977, 2022-04-11T07:49:20.994Z)
OS version: Darwin arm64 21.4.0
Restricted Mode: No

System Info
Item Value
CPUs Apple M1 Pro (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 7, 5, 4
Memory (System) 32.00GB (1.48GB free)
Process Argv --crash-reporter-id 18db7754-a899-47ab-9295-2cc481e3630e
Screen Reader yes
VM 0%
@phoenixeliot phoenixeliot changed the title Cutting opening tag content causes undo loop Cutting or deleting opening tag content causes undo loop Apr 19, 2022
@phoenixeliot
Copy link
Author

Dupe of #588 #565 and possibly #55

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

1 participant