nvim-surround icon indicating copy to clipboard operation
nvim-surround copied to clipboard

Visual mode select won't surround

Open esn89 opened this issue 1 year ago • 9 comments

Checklist

  • [X] Have you tried updating the plugin to the latest version?
  • [X] Have you checked the Breaking Changes issue?
  • [X] Have you read through :h nvim-surround to see if there might be any relevant information there?

Neovim Version

NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1700008891

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/local/share/nvim"

Run :checkhealth for more info

Plugin Version

Tagged (Stable)

Minimal Configuration

    {
        'kylechui/nvim-surround',
        version = '*',
        event = 'VeryLazy',
        config = function()
            require('nvim-surround').setup({})
        end,
    },

Sample Buffer

I have a similar issue in Visual mode as well, with this block of text:

image

Keystroke Sequence

I select it by:

vEE then

S), but it doesn't surround.

Expected behavior

I expect to see:

(cipher.Stream, error)

Actual behavior

No surround.

Additional context

No response

esn89 avatar Dec 21 '23 00:12 esn89

This works fine for me btw

func decryptStream(key string, iv []byte) (cipher.Stream, error) {

}

if my cursor is on the c in cipher and I push vEES) it surrounds

9mm avatar Dec 21 '23 00:12 9mm

heres my config

-- https://github.com/kylechui/nvim-surround/blob/main/lua/nvim-surround/config.lua

return {
  "kylechui/nvim-surround",
  version = "*",
  event = "InsertEnter",
  config = function()
    require("nvim-surround").setup()
  end,
}

I notice some plugins have problems with passing an empty {} instead of () into setup. I have no idea if thats it but maybe?

9mm avatar Dec 21 '23 00:12 9mm

I notice some plugins have problems with passing an empty {} instead of () into setup. I have no idea if thats it but maybe?

Shouldn't be an issue; was patched a long long time ago.

Is your base problem that it works after you already add the parentheses (and it adds a second pair), but doesn't in your original image? I'm unable to reproduce your error on my system.

kylechui avatar Dec 21 '23 00:12 kylechui

Hmm, has there been known issues in the past where it doesn't play well with other plugins?

esn89 avatar Dec 21 '23 00:12 esn89

Typically plugins like targets.vim or mini.ai, but what usually happens is that it causes unintended/unexpected behavior, not no behavior at all.

kylechui avatar Dec 21 '23 00:12 kylechui

@kylechui Hm, I am using none of those.

Could it be a keybinding thing?

esn89 avatar Dec 26 '23 18:12 esn89

Ah good question, try verbose xmap S and see what pops up; you might have a completely different plugin/keymap overriding it.

kylechui avatar Dec 26 '23 19:12 kylechui

Aaaaah. I think I see it....

I have this:

https://imgur.com/a/ZhKhnNn

esn89 avatar Dec 28 '23 18:12 esn89

Yeah try remapping either plugin's bindings to avoid conflicts, and that should fix things. Perhaps plugin authors should check for keymaps before setting them (mine included) :thinking:

kylechui avatar Dec 28 '23 23:12 kylechui

Feel free to re-open if you are still having issues.

kylechui avatar Feb 25 '24 19:02 kylechui