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

fix(snippets): allow snippets jumps after edition #70

Closed
wants to merge 1 commit into from
Closed

fix(snippets): allow snippets jumps after edition #70

wants to merge 1 commit into from

Conversation

tkapous
Copy link

@tkapous tkapous commented Oct 9, 2024

This PR fixes a bug which prevents from jumping to the next snippet item after a value is modified.

Mentioned in #60.

fix(snippets): allow snippets jumps after edition
@Saghen Saghen closed this in a89ae20 Oct 9, 2024
@Saghen
Copy link
Owner

Saghen commented Oct 9, 2024

Thanks! The root issue was slightly different so implemented in a separate commit

@scottmckendry
Copy link
Collaborator

@Saghen, just a heads up your commit is missing the union_keys definition in utils. Might want to double-check that it isn't still in your working tree.

I'm currently getting the following error:

Error executing vim.schedule lua callback: ...local/share/nvim/lazy/blink.cmp/lua/blink/cmp/keymap.lua:56: attempt to call field 'union_keys' (a nil value)
stack traceback:
	...local/share/nvim/lazy/blink.cmp/lua/blink/cmp/keymap.lua:56: in function 'apply_keymap_to_current_buffer'
	...local/share/nvim/lazy/blink.cmp/lua/blink/cmp/keymap.lua:45: in function 'setup'
	.../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:16: in function 'callback'
	...are/nvim/lazy/blink.cmp/lua/blink/cmp/fuzzy/download.lua:19: in function <...are/nvim/lazy/blink.cmp/lua/blink/cmp/fuzzy/download.lua:19>
``

@scottmckendry
Copy link
Collaborator

I have a fix in this commit that uses a built-in function to merge the two tables, but I'm not confident it's doing the same thing.

scottmckendry@a4482f3

@Saghen
Copy link
Owner

Saghen commented Oct 9, 2024

Sorry about that, fixed

lopi-py pushed a commit to lopi-py/blink.cmp that referenced this pull request Oct 10, 2024
lopi-py pushed a commit to lopi-py/blink.cmp that referenced this pull request Oct 10, 2024
@tkapous
Copy link
Author

tkapous commented Oct 10, 2024

There's still a problem, @scottmckendry's fix is working.

utils.union_keys(insert_keys_to_commands, snippet_keys_to_commands) does not merge snippet keys.
It looks like the second 'for' is not being entered, which makes no sense to me.

Edit: is there a reason why union_keys use both pair and ipair?
Using pair only fixes the problem.

@tkapous
Copy link
Author

tkapous commented Oct 11, 2024

@Saghen should I post a PR to change ipair to pair, or event use vim.tbl_extend as mentioned above?

@Saghen
Copy link
Owner

Saghen commented Oct 11, 2024

Sorry about that, fixed on main

@tkapous
Copy link
Author

tkapous commented Oct 11, 2024

Thanks a lot!

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.

4 participants