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

Temporary fix for snippets and undo #1084

Closed
wants to merge 3 commits into from
Closed

Conversation

almounah
Copy link

A bug was detected on this environment

  • NVIM v0.9.4
  • typescript-language-server tsserver version 4.2.0 (installed with Mason)
  • These plugins to get snippets (installed with packer):
 use {
        "hrsh7th/nvim-cmp",
        "hrsh7th/cmp-nvim-lsp",
        "L3MON4D3/LuaSnip",
        "saadparwaiz1/cmp_luasnip",
        "rafamadriz/friendly-snippets"
    }   

To reproduce

  1. Open a Javascript file
  2. Write a for using a snippet, but don't fill anything.
  3. Press Esc then undo the snippet with u
  4. Recreate a for using the snippet

You should see an indexin error as follows:
image

This PR proposes a temporary fix. It may not be the best solution but it should work if I am not mistaken...
Any improvement ideas and critiques are very appreciated

@L3MON4D3
Copy link
Owner

Sorry, forgot to comment on this before:
I think I know what's going wrong there, lemme create a branch with (what I think) could be the fix

@L3MON4D3
Copy link
Owner

Nvm I don't know what's going wrong.. Could you create a MWE?

@L3MON4D3
Copy link
Owner

Ha, I do know what went wrong (Or, at least I think that's what went wrong for you).
Could you try the undo-fix-branch?

@almounah
Copy link
Author

@L3MON4D3 The undo-fix works and actually fix the bug :-)

@L3MON4D3
Copy link
Owner

Nice, I'll put that on master then :D

@L3MON4D3
Copy link
Owner

Okay, 43c8963 is on master

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

Successfully merging this pull request may close these issues.

2 participants