Closed biozz closed 1 year ago
My guess is that this has to do with surrounding multi-byte characters (which I thought I fixed), but I'll look into it when I have the time.
Maybe try using yss
to surround the current line instead?
I'm actually unable to replicate this issue. Can you send me what version of Neovim you're using, as well as if you're using the nightly version of this plugin? In any case, please try updating your plugin to see if it fixes things.
NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@HMBRW-A-001-M1-004.local
Features: +acl +iconv +tui
nvim-surround ❯ git status
HEAD detached at v1.0.0
Thanks for the suggestion about yss
, but that defeats the purpose of the plugin for me. I want to be able to visually select stuff before surrounding.
I didn't have this issue with tpope/vim-surround
.
I tried nvim --clean
and put in the sample text that you gave, and also tried using the stable release of the plugin. Unfortunately, I was still unable to replicate the issue. If possible, could you also provide a minimal configuration via nvim -u minimal_config.lua
that produces the issue?
I think it has to do with one of or a combination of dhruvasagar/vim-table-mode
and preservim/vim-markdown
. I tried disabling those and it worked. I also enabled them back and it works as well. 🤷♂️
Not sure if it needs further investigation. My issue is resolved (for now). Feel free to close the ticket.
Thanks again for the suggestions.
Yeah I'm not 100% sure what it could be either, if you didn't update your other plugins. Feel free to re-open this issue if the bug pops up again, with a minimal config and steps to reproduce it
Checklist
main
branch?:h nvim-surround
to see if there might be any relevant information there?To reproduce
Sample buffer:
Starting from the beginning of the document type:
v$S)
. (visually surround the line)Then go to the beginning of the next line and do the same.
Expected behavior
I expect the plugin to work the same on both lines and get this:
Without breaking the encoding.
Actual behavior
Instead I see something like that:
Those
<d0>
and<b9>
are greyed out like control characters.It also breaks the file encoding. After I open the file again I get:
And if I do
:set fileencoding
, it showslatin1
instead ofutf8
.Note that I have properly set
encoding
andfileencoding
toutf-8
in my config.Additional context
No response