{"action":"created","issue":{"url":"https://api.github.com/repos/gabesoft/evil-mc/issues/41","repository_url":"https://api.github.com/repos/gabesoft/evil-mc","labels_url":"https://api.github.com/repos/gabesoft/evil-mc/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/gabesoft/evil-mc/issues/41/comments","events_url":"https://api.github.com/repos/gabesoft/evil-mc/issues/41/events","html_url":"https://github.com/gabesoft/evil-mc/issues/41","id":194817149,"number":41,"title":"Evil-Escape compatibility ","user":{"login":"PrgrmAtCeleritas","id":10623982,"avatar_url":"https://avatars.githubusercontent.com/u/10623982?v=3","gravatar_id":"","url":"https://api.github.com/users/PrgrmAtCeleritas","html_url":"https://github.com/PrgrmAtCeleritas","followers_url":"https://api.github.com/users/PrgrmAtCeleritas/followers","following_url":"https://api.github.com/users/PrgrmAtCeleritas/following{/other_user}","gists_url":"https://api.github.com/users/PrgrmAtCeleritas/gists{/gist_id}","starred_url":"https://api.github.com/users/PrgrmAtCeleritas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrgrmAtCeleritas/subscriptions","organizations_url":"https://api.github.com/users/PrgrmAtCeleritas/orgs","repos_url":"https://api.github.com/users/PrgrmAtCeleritas/repos","events_url":"https://api.github.com/users/PrgrmAtCeleritas/events{/privacy}","received_events_url":"https://api.github.com/users/PrgrmAtCeleritas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-11T06:59:39Z","updated_at":"2016-12-11T19:27:55Z","closed_at":null,"body":"I am trying to fix [#27](https://github.com/gabesoft/evil-mc/issues/27) by making some changes to evil-escape. I have got it mostly working with one minor issue that I hope I could get some help with. When you use evil-escape you have a two-key escape sequence. The problem in #27 was that the first key was being left. I got that cleaned up but when you try and undo it shows the insertion of the first-key as the  top of the stack (`f` by default). This causes problems because only the fake cursors have this item in their undo stack so now the real cursor and the fake cursors are out of sync. Is there a way to change the undo stack for the fake cursors so this doesn't show up in their undo stack? \r\n\r\nand just for reference here are the changes I made. I couldn't find anyway to acomplish this by changing evil-mc, I had to change evil-escape. I changed one function called `evil-escape-pre-command-hook`\r\n```\r\n(defun evil-escape-pre-command-hook ()\r\n  \"evil-escape pre-command hook.\"\r\n  (with-demoted-errors \"evil-escape: Error %S\"\r\n    (when (evil-escape-p)\r\n      (let* ((modified (buffer-modified-p))\r\n             (inserted (evil-escape--insert))\r\n             (fkey (elt evil-escape-key-sequence 0))\r\n             (skey (elt evil-escape-key-sequence 1))\r\n             (evt (read-event nil nil evil-escape-delay)))\r\n        (when inserted (evil-escape--delete))\r\n        (set-buffer-modified-p modified)\r\n        (cond\r\n         ((and (characterp evt)\r\n               (or (and (equal (this-command-keys) (evil-escape--first-key))\r\n                        (char-equal evt skey))\r\n                   (and evil-escape-unordered-key-sequence\r\n                        (equal (this-command-keys) (evil-escape--second-key))\r\n                        (char-equal evt fkey))))\r\n          (evil-repeat-stop)\r\n          (when (evil-escape-func)\r\n            (progn\r\n              (run-at-time \"0.05 sec\" nil\r\n                           (lambda ()\r\n                             (evil-mc-execute-for-all-fake-cursors\r\n                              (lambda (cursor)\r\n                                (let ((undo-inhibit-record-point t))\r\n                                  (delete-char -1)\r\n                                  (unless (or (bolp) (eolp))\r\n                                    (evil-backward-char)))))))\r\n              (setq this-command (evil-escape-func)))))\r\n         ((null evt))\r\n         (t (setq unread-command-events\r\n                  (append unread-command-events (list evt)))))))))\r\n```\r\nI am sure @syl20bnr could come up with a much better solution. But this seems to working for me. Any help would be appreciated. "},"comment":{"url":"https://api.github.com/repos/gabesoft/evil-mc/issues/comments/266301715","html_url":"https://github.com/gabesoft/evil-mc/issues/41#issuecomment-266301715","issue_url":"https://api.github.com/repos/gabesoft/evil-mc/issues/41","id":266301715,"user":{"login":"gabesoft","id":606000,"avatar_url":"https://avatars.githubusercontent.com/u/606000?v=3","gravatar_id":"","url":"https://api.github.com/users/gabesoft","html_url":"https://github.com/gabesoft","followers_url":"https://api.github.com/users/gabesoft/followers","following_url":"https://api.github.com/users/gabesoft/following{/other_user}","gists_url":"https://api.github.com/users/gabesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/gabesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabesoft/subscriptions","organizations_url":"https://api.github.com/users/gabesoft/orgs","repos_url":"https://api.github.com/users/gabesoft/repos","events_url":"https://api.github.com/users/gabesoft/events{/privacy}","received_events_url":"https://api.github.com/users/gabesoft/received_events","type":"User","site_admin":false},"created_at":"2016-12-11T19:27:55Z","updated_at":"2016-12-11T19:27:55Z","body":"You could define a function that changes the undo stack the way you need to. See `evil-mc-execute-default-undo` and `evil-mc-execute-default-redo` handlers in `evil-mc-command-execute.el` for some examples of how to handle the `undo-stack`. Then you could call that function using `evil-mc-execute-for-all-fake-cursors`"}}
{"actor":{"display_login":"gabesoft"}}