echasnovski / mini.nvim

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

Surround keymap broken #1058

Closed Lukalukito closed 1 month ago

Lukalukito commented 1 month ago

Contributing guidelines

Module(s)

surround

Description

mini surround keymaps are not working after last update. before, s will show which-key and wait for next action (add, delete ...) but now it just uses nvims default s action( replacing current char going into insert mode). I am not sure if this has to do anything with which-key or my settings, but all i did is update every plugin with lazy.nvim. if this is a which-key problem i'll report there

Neovim version

0.10.0

Steps to reproduce

i have no idea what to put here

Expected behavior

mini.surround default keymap (s) opens which-key (like before, without any configuration needed)

Actual behavior

surround keymap doesn't get registered so nvim uses default action.

echasnovski commented 1 month ago

if this is a which-key problem i'll report there

There was no big updates in 'mini.surround', yet there was a big update in 'folke/which-key.nvim'. As everything still works without which-key, I think it is safe to assume the problem is not inside 'mini.surround'.

Lukalukito commented 1 month ago

thanks. will report it there too

yavorski commented 1 month ago

@Lukalukito DId you report it, I am having the same issue?

yavorski commented 1 month ago

@echasnovski I deleted all my plugins and left only mini.surround with default configuration. Pressing just s in normal or visual mode is not indicating that another key is needed to continue it just delete the character or selected text and puts neovim in insert mode.

nvim --version
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1720049189
Run "nvim -V1 -v" for more info
:verbose map s - click to expand ```vim Last set from Lua (run Nvim with -V1 for more details) n sfn * Find next right surrounding Last set from Lua (run Nvim with -V1 for more details) n srn * Replace next surrounding Last set from Lua (run Nvim with -V1 for more details) n sdn * Delete next surrounding Last set from Lua (run Nvim with -V1 for more details) n shl * Highlight previous surrounding Last set from Lua (run Nvim with -V1 for more details) n sFl * Find previous left surrounding Last set from Lua (run Nvim with -V1 for more details) n sfl * Find previous right surrounding Last set from Lua (run Nvim with -V1 for more details) n srl * Replace previous surrounding Last set from Lua (run Nvim with -V1 for more details) n sdl * Delete previous surrounding Last set from Lua (run Nvim with -V1 for more details) x sa * :lua MiniSurround.add('visual') Add surrounding to selection Last set from Lua (run Nvim with -V1 for more details) n sn * Update `MiniSurround.config.n_lines` Last set from Lua (run Nvim with -V1 for more details) n sh * Highlight surrounding Last set from Lua (run Nvim with -V1 for more details) n sF * Find left surrounding Last set from Lua (run Nvim with -V1 for more details) n sf * Find right surrounding Last set from Lua (run Nvim with -V1 for more details) n sr * Replace surrounding Last set from Lua (run Nvim with -V1 for more details) n sd * Delete surrounding Last set from Lua (run Nvim with -V1 for more details) n sa * Add surrounding Last set from Lua (run Nvim with -V1 for more details) Press ENTER or type command to continue ```
echasnovski commented 1 month ago

Pressing just s in normal or visual mode is not indicating that another key is needed to continue it just delete the character or selected text and puts neovim in insert mode.

Yes, nor it should indicate. Neovim waits for 'timeoutlen' milliseconds if it is not sure which mapping user wants to activate. After they pass, it executes the input as is.

What value of 'timeoutlen' do you have set? See it via :=vim.o.timeoutlen.

Edit: If occasional s bothers too much, consider following documented advice.

yavorski commented 1 month ago

What value of 'timeoutlen' do you have set? See it via :=vim.o.timeoutlen.

1000

Edit: If occasional s bothers too much, consider following documented advice.

Thanks, I will try the suggestion!

echasnovski commented 1 month ago

What value of 'timeoutlen' do you have set? See it via :=vim.o.timeoutlen.

1000

Then inputting any mapping sequence should not have delays more than one second between each adjacent keys. If you press s and do nothing for more than a second, it will execute s. If you press <Leader> and do nothing for more than a second, it will execute the <Leader> as is.

This is how Neovim works regarding mappings (without 'folke/which-key.nvim' or 'mini.clue').

Lukalukito commented 1 month ago

I haven't reported it yet. I just set notimeout option so it will wait forever for next key( without displaying whichkey, other keymaps do display whichkey) but that's ok for now