echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.47k stars 175 forks source link

mini.surround delete surrounding stopped working #927

Closed TheComet closed 1 month ago

TheComet commented 1 month ago

Contributing guidelines

Module(s)

mini.surround

Description

At some point last month, my shortcut for deleting surrounding characters stopped working. All other shortcuts still work, though, such as adding.

Neovim version

0.10.0-dev

Steps to reproduce

  1. .config/nvim/init.lua:
    return require('packer').startup(function(use)
    use 'wbthomason/packer.nvim'
    use 'echasnovski/mini.nvim'
    end)
  2. .config/nvim/after/plugin/mini.lua:
    require('mini.surround').setup({})
  3. :PackerSync
  4. Open nvim, type some text, highlight it (viw), and press sa). It will surround the text with brackets
  5. Highlight the word again (viw), press sd) to delete the brackets --> Doesn`t work!

Expected behavior

Using sd) should delete the surrounding brackets.

Actual behavior

The highlighted text is replaced with "d" instead of being surrounded

echasnovski commented 1 month ago

The default mapping sd to delete surrounding has been working the same way for the past (at least) year.

5. Highlight the word again (viw), press sd) to delete the brackets --> Doesn`t work!

I am pretty sure that doing viw followed immediately by sd) never worked as "delete brackets for visual selection".

Now visual selection is needed. Pressing sd) in Normal mode will try to find surrounding parts with id ) and delete them. This is described in the help.