Closed LeviticusNelson closed 2 years ago
Can you update the plugin and see if the latest commit fixes the issue? If not, please give me an example of the buffer you're editing, where your cursor is, and what keystrokes you're using to change the tag. Thanks!
It's an HTML File, I think it crashes if you try to change the tag of an element while the cursor is on the child element. Example:
<c-carousel>
<div> // the cursor would be on the div
</div>
</c-carousel>
I am using cst
as the keystroke
Unfortunately I'm unable to replicate this, I've copy-pasted your HTML into my own test file, and have run cst
while the cursor is on the div (in varying locations as well), and can't seem to crash Neovim. Have you updated the plugin to the latest commit?
Yes I have
Maybe try to uninstall/reinstall the plugin; I'll try to reproduce it using a minimal config when I have the time later
Try this:
<c-carousel>
<div for:each={results} for:item="result" key={result.Id}> // cursor on this div
<c-hero-carousel-image
src={result.ImageURL}
href={result.href}
title={result.Title__c}
body={result.Body_Text__c}
>
</c-hero-carousel-image>
</div>
</c-carousel>
I've just tried that exact test file with the following config:
---@diagnostic disable: undefined-global
return require("packer").startup(function()
use({
"kylechui/nvim-surround",
config = function()
require("nvim-surround").setup({})
end,
})
end)
but I still can't reproduce the issue. I'm able to change the tag contents/delete them just fine (with the exception of the inner c-hero-carousel-image
tag, but that's because I forgot that dashes are valid characters in tag types).
For what it's worth, I see a very similar issue (perhaps the same one), but using the deletion keybinding. Reproduction:
nvim-surround
using packer, default settings. use({ "x/y" })
use({ "a/b" })
use({
"d/f",
requires = { "q/r" },
})
ds(
. Nothing happens (as expected, since nvim-surround
doesn't "look ahead").ds(
. NeoVim crashes with "segmentation fault /usr/local/bin/nvim /tmp/x.lua".Clearly NeoVim shouldn't crash, so that may be/is an issue with NeoVim itself. But probably nvim-surround
is "provoking" it by asking the API for something invalid. Hopefully the above helps narrow down the issue.
@andrewferrier Do you mind doing me a favor and testing on the latest commit in fix-keymaps
? For the record, I wasn't able to reproduce the issue on the latest commit in main
either; both deletions worked fine for me.
Edit: fix-keymaps
has been merged into main
, so the latest commit there should suffice as well.
Yep, the latest main
seems to fix the issue for me! Thanks.
I'll be marking this issue as completed for now then, feel free to re-open in case things change
Whenever I try to change a tag (
cst
) my neovim crashes, printing