gabesoft / evil-mc

Multiple cursors implementation for evil-mode
MIT License
387 stars 36 forks source link

Can't type at cursors #5

Closed justmytwospence closed 8 years ago

justmytwospence commented 8 years ago

I can create multiple cursors, but then only the real cursor inserts text.

gabesoft commented 8 years ago

What major mode do you have enabled?

gabesoft commented 8 years ago

Some modes use a different command for inserting than self-insert-command. If you want to know what command is used run evil-mc-recording-command-on interactively and then check the Messages buffer

justmytwospence commented 8 years ago

This is in any/all modes (emacs-lisp-mode, for example). I don't actually have an evil-mc-recording-command-on function. When I run evil-mc-recording-debug-on, and then run, say, evil-mc-make-all-cursors on the word ":config" from the normal state, a bunch of cursors appear in the appropriate positions, and I get the message:

evil-mc Created 90 cursors matching "\_<:config\_>"

After that point, everything seems to operate any differently. I've got a bunch of cursors all over the place, but only the real one inserts text. No messages appear in the message buffer either.

gabesoft commented 8 years ago

Sorry, yea the correct function is evil-mc-recording-debug-on. After calling that function, and assuming you have some active cursors, you should see some messages every time you do something. For example, what happens when you just try to move the cursors back and forth with b and w? In my messages buffer I see statements like evil-mc Command evil-forward-word-begin.

justmytwospence commented 8 years ago

Nope, nada. Just to confirm, b is bound to evil-backward-word-begin, and w to evil-forward-word-begin.

Enabled minor modes:

Enabled minor modes: Anzu Async-Bytecomp-Package Auto-Composition
Auto-Compression Auto-Encryption Blink-Cursor Column-Number Company
Company-Quickhelp Company-Statistics Diff-Auto-Refine Eldoc
Electric-Indent Erc-Autojoin Erc-Button Erc-Fill Erc-Hl-Nicks
Erc-Irccontrols Erc-List Erc-Log Erc-Match Erc-Menu Erc-Move-To-Prompt
Erc-Netsplit Erc-Networks Erc-Noncommands Erc-Pcomplete Erc-Readonly
Erc-Ring Erc-Spelling Erc-Stamp Erc-Track Erc-Track Evil-Commentary
Evil-Leader Evil-Local Evil-Mc Evil-Smartparens Evil-Surround
Evil-Visualstar File-Name-Shadow Flx-Ido Font-Lock Git-Gutter
Global-Anzu Global-Evil-Visualstar Global-Font-Lock Global-Git-Commit
Global-Undo-Tree Helm-Autoresize Hl-Line Hs Ido-Everywhere
Ido-Ubiquitous Keyfreq Keyfreq-Autosave Linum Menu-Bar Mouse-Wheel
On-Screen-Global Override-Global Persp Prettify-Symbols Projectile
Projectile-Global Pyvenv Rainbow-Delimiters Recentf Savehist
Shell-Dirtrack Show-Smartparens Smartparens Tooltip Transient-Mark
Undo-Tree Visual-Line Which-Key
gabesoft commented 8 years ago

Would you mind trying it in the scratch buffer with the fundamental-mode. If you still get nothing, I'll look at it tonight with the minor modes that you have. Yes b should be bound to evil-backward-word-begin and w to evil-forward-word-begin.

justmytwospence commented 8 years ago

Same results in fundamental mode. I'll also try to bisect through this when I get a chance.

gabesoft commented 8 years ago

I don't see Evil in your list of minor modes. evil-mode must be enabled for evil-mc to work.

gabesoft commented 8 years ago

smartparens and evil-smartparens may interfere slightly just because it evil-mc does not account for their commands. Try disabling both just to see if it will make a difference.

justmytwospence commented 8 years ago

Hmm, its not smartparens. You are right its very strange that evil is not in my minor most list. I have a feeling this might be because I use evil-local-mode instead of evil-mode.

justmytwospence commented 8 years ago

Aha, thats it. evil-mc works when you activate evil with evil-mode, but not with evil-local-mode. Its the only evil plugin I've ever had this problem with.

gabesoft commented 8 years ago

Interesting. I think it's because in the evil-mc initialization I check whether the evil-mode is enabled. There's a method in the evil-mc.el file called evil-mc-initialize-keys where I check for evil-mode before setting up the key maps. I think I should find a better way of doing that.

justmytwospence commented 8 years ago

I've updated the package, but nothing has changed regarding behavior or messages.

gabesoft commented 8 years ago

Maybe there are other issues then. This fix removed all checks for evil-mode when doing the evil-mc mode initialization. Does it make any difference if you use (evil-mc-mode 1) vs (global-evil-mc-mode 1) ?

gabesoft commented 8 years ago

After making this changes I've noticed that it takes a few seconds from the moment I enable evil-mc-mode until the key bindings take effect.

justmytwospence commented 8 years ago

gloal-evil-mc-mode doesn't seem to fix it. I currently have this set up:

(add-hook 'evil-local-mode-hook #'evil-mc-mode)

Which successfully enables evil-mc-mode, albeit with the behavior laid out above.

gabesoft commented 8 years ago

Ok, I'll try to reproduce your setup

zovt commented 8 years ago

I'm also having the same problem

gabesoft commented 8 years ago

I think this is fixed in the master branch, but melpa doesn't seem to get updated for some reason. It would be great if one of you guys could try it out.

gabesoft commented 8 years ago

Actually, this is not fixed yet. I can still reproduce it

gabesoft commented 8 years ago

Ok, this is fixed now on Melpa. I just verified it in a sandbox.

justmytwospence commented 8 years ago

This does indeed seem to be fixed :)

zovt commented 8 years ago

Fixed for me as well! Thanks :)