Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing cl breaks into new lines during multiple cursors when using with noice.nvim #260

Open
kohane27 opened this issue Feb 18, 2024 · 2 comments

Comments

@kohane27
Copy link

Hello! Hope you're doing well.

Description

vm-issue_2.mp4

When there are multiple cursors, pressing cl breaks into new lines. Disabling noice.nvim fixed it; but I want vim-visual-multi to play nicely with noice.nvim.

Steps to reproduce

  1. <C-S-n> 2 times to create a column of cursors
  2. cl to delete the character to the right
  3. issue occurred

Config

I'm using lazy.nvim:

return {
  "mg979/vim-visual-multi",
  config = function()
    -- create a column of cursors from visual mode
    vim.api.nvim_set_keymap(
      "n",
      "<C-S-n>",
      ":call vm#commands#add_cursor_down(0, v:count1)<cr>",
      { noremap = true, silent = true }
    )
    vim.cmd([[
    " all mappings disabled except <C-n> (<C-n> can't be remapped)
    let g:VM_default_mappings = 0

    " To change any mapping you must first initialize the variable:
    let g:VM_maps = {}
    let g:VM_maps['Find Under'] = "<C-n>"

    " https://github.com/mg979/vim-visual-multi/issues/172
    let g:VM_maps['I BS'] = "" " disable backspace mapping
    let g:VM_maps['I CtrlC'] = "" " disable backspace mapping

]])
  end,
}

System

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742

ArchLinux (Linux 6.7.4-arch1-1)

Thank you!

@Ajaymamtora
Copy link

Did you manage to find a way to fix this? I have the same issue

@kohane27
Copy link
Author

kohane27 commented Dec 6, 2024

@Ajaymamtora

I just disable noice.nvim when triggering vim-visual-multi:

    vim.api.nvim_create_augroup("VM_noice_fix", { clear = true })

    vim.api.nvim_create_autocmd("User", {
      group = "VM_noice_fix",
      pattern = "visual_multi_start",
      callback = function()
        vim.cmd("redraw")
        vim.cmd("silent! Noice disable")
      end,
    })

    vim.api.nvim_create_autocmd("User", {
      group = "VM_noice_fix",
      pattern = "visual_multi_exit",
      callback = function()
        vim.cmd("silent! Noice enable")
        vim.cmd("redraw")
      end,
    })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants