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

Undo after using autocomplete does not adjust the view to the code location #2621

Open
tkgaolol opened this issue Jan 26, 2025 · 1 comment

Comments

@tkgaolol
Copy link

Description:

When I use the autocomplete feature in VS Code (triggered by pressing "Tab"), it inserts the suggested code as expected. However, if I immediately undo the autocomplete action (using Ctrl + Z or Cmd + Z), the code is reverted correctly, but the editor view does not automatically jump to the location of the undo. This creates a mismatch between what is shown on the screen and where the cursor/code change actually occurs.


Steps to Reproduce:

  1. Open any file in Cursor.
  2. Start typing a variable or function name and trigger the autocomplete suggestions.
  3. Press Tab to accept an autocomplete suggestion.
  4. Scroll to anywhere and press Ctrl + Z (or Cmd + Z on Mac) to undo the autocomplete action.

Expected Behavior:

After undoing the autocomplete action, the editor view should automatically scroll to the location of the undo operation, ensuring that the cursor and the visible code are synchronized.


Actual Behavior:

The autocomplete action is undone (code is removed as expected), but the editor view does not scroll to the location of the undo operation. The cursor is moved to the correct position in the code, but the visible part of the editor remains unchanged, causing confusion.


Environment:

  • Cursor Version: 0.45.3
  • VSCode Version: 1.96.2
  • OS: Win11

Additional Information:

This behavior disrupts the workflow because the user has to manually scroll to the location of the undo operation to understand what changed. This issue seems to only occur with autocomplete actions and does not happen with other undo operations like typing or deleting code.

@neil0306
Copy link

Same!

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

2 participants