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

Insert Mode and Append do not work anymore! #101

Open
MrMic opened this issue Jul 28, 2024 · 8 comments
Open

Insert Mode and Append do not work anymore! #101

MrMic opened this issue Jul 28, 2024 · 8 comments

Comments

@MrMic
Copy link

MrMic commented Jul 28, 2024

  • [ X ] Did you check Readme and existing issues?

Describe the bug
When I switch to Insert Mode (with "i") or Append Mode with ("a")
and I type letter(s) they only appear on the last selected text and not
all! It is as if the other(s) selection(s) do not exist!

To Reproduce

  • make a selection
  • press "i" or "a"
  • press letter(s)
  • only the last selection is impacted by new letter(s). Nothing is inserted or appended in the other(s) selection(s)

Expected behavior
Insert or append letter(s) in all selection(s)

Nvim version:
v0.10.1

Multicursor version:
"multicursors.nvim": { "branch": "main", "commit": "782820896b1691ed664e4c24f1cd9793dcb33dfb" }

I am working with AstroNvim but your plugin is loaded as is. It was working like a charm a few
weeks ago...

@DeadlySquad13
Copy link

DeadlySquad13 commented Sep 19, 2024

Unfortunately, stumbled upon the same problem… Tried syncing all plugins and updating neovim to nightly and now the error occurs:

   Error  8:14:47 PM msg_show.lua_error Error executing Lua callback: ...im-data/lazy/multicursors.nvim/lua/multicursors/init.lua:66: attempt to index field 'normal_hydra' (a nil value)
stack traceback:
	...im-data/lazy/multicursors.nvim/lua/multicursors/init.lua:66: in function 'new_under_cursor'
	...im-data/lazy/multicursors.nvim/lua/multicursors/init.lua:28: in function <...im-data/lazy/multicursors.nvim/lua/multicursors/init.lua:27>
   Error  8:12:51 PM msg_show.lua_error Error executing Lua callback: ...im-data/lazy/multicursors.nvim/lua/multicursors/init.lua:60: attempt to index field 'normal_hydra' (a nil value)
stack traceback:
	...im-data/lazy/multicursors.nvim/lua/multicursors/init.lua:60: in function 'start'
	...im-data/lazy/multicursors.nvim/lua/multicursors/init.lua:20: in function <...im-data/lazy/multicursors.nvim/lua/multicursors/init.lua:19>
   Error  8:12:37 PM notify.error vim-illuminate: An internal error has occured: false"...ightly/current/share/nvim/runtime/lua/vim/treesitter.lua:201: attempt to call method 'range' (a nil value)"
   Error  8:12:37 PM notify.error lazy.nvim Failed to run `config` for multicursors.nvim

vim/shared.lua:764: s: expected string, got number (1)

# stacktrace:
  - vim\shared.lua:1002 _in_ **validate**
  - vim\shared.lua:764 _in_ **startswith**
  - vim\_init_packages.lua:76 _in_ **__index**
  - vim\shared.lua:692 _in_ **islist**
  - vim\shared.lua:360 _in_ **can_merge**
  - vim\shared.lua:377 _in_ **tbl_deep_extend**
  - hydra.nvim\lua\hydra\layer\init.lua:116 _in_ **initialize**
  - hydra.nvim\lua\hydra\lib\class.lua:14 _in_ **Layer**
  - hydra.nvim\lua\hydra\init.lua:437 _in_ **_setup_pink_hydra**
  - hydra.nvim\lua\hydra\init.lua:281 _in_ **initialize**
  - hydra.nvim\lua\hydra\lib\class.lua:14 _in_ **Hydra**
  - multicursors.nvim\lua\multicursors\layers.lua:196 _in_ **create_normal_hydra**
  - multicursors.nvim\lua\multicursors\init.lua:108 _in_ **setup**

I suppose author of multicursors assumed specific version of hydra? But I don't see it pinned anywhere in README or help file.

@smoka7
Copy link
Owner

smoka7 commented Sep 20, 2024

I'm on nvimtools/hydra.nvim@7f53416 and nvim nightly, still cant reproduce this.

@MrMic
Copy link
Author

MrMic commented Sep 20, 2024

I am with the stable release: 3ced42c
And I am with AstroNvim

@smoka7
Copy link
Owner

smoka7 commented Sep 21, 2024

Try using the https://github.com/nvimtools/hydra.nvim as dependency.

@MrMic
Copy link
Author

MrMic commented Sep 21, 2024

I just did it but that did not fix the issue...
but I try what @smoka7 said:

return {
  "smoka7/multicursors.nvim",
  event = "VeryLazy",
  dependencies = {
    "nvimtools/hydra.nvim",
    commit = "7f5341643107d05a8d7d4fdea00b29af28517380",
  },
  opts = {},
  cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
  keys = {
    {
      mode = { "v", "n" },
      "<Leader>mM",
      "<cmd>MCstart<cr>",
      desc = "Create a selection for selected text or word under the cursor",
    },
  },
}

And it works again! 😌

@smoka7 are you able to update your hydra package?
Thanks.

Rgds,

@rachartier
Copy link

I tried @MrMic fix, but it does not work on my setup.

nvim nightly (g3b54acdc6c)
nvimtools/hydra.nvim (7f53416)
multicursors.nvim (562809a)

@MrMic
Copy link
Author

MrMic commented Sep 24, 2024

@rachartier My nvim is a stable version: v0.10.1

Capture d’écran du 2024-09-24 18-34-18

I hope it may help you.

@jamestrew
Copy link

Yeah works on neovim v0.10.1 but on nightly 0.11 the error from above pops up

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

5 participants