{"action":"created","issue":{"url":"https://api.github.com/repos/marijnh/tern/issues/556","labels_url":"https://api.github.com/repos/marijnh/tern/issues/556/labels{/name}","comments_url":"https://api.github.com/repos/marijnh/tern/issues/556/comments","events_url":"https://api.github.com/repos/marijnh/tern/issues/556/events","html_url":"https://github.com/marijnh/tern/issues/556","id":85127943,"number":556,"title":"`tern-before-change` hook causes jumping when used with `evil-mode` (Emacs)","user":{"login":"emallson","id":4909458,"avatar_url":"https://avatars.githubusercontent.com/u/4909458?v=3","gravatar_id":"","url":"https://api.github.com/users/emallson","html_url":"https://github.com/emallson","followers_url":"https://api.github.com/users/emallson/followers","following_url":"https://api.github.com/users/emallson/following{/other_user}","gists_url":"https://api.github.com/users/emallson/gists{/gist_id}","starred_url":"https://api.github.com/users/emallson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emallson/subscriptions","organizations_url":"https://api.github.com/users/emallson/orgs","repos_url":"https://api.github.com/users/emallson/repos","events_url":"https://api.github.com/users/emallson/events{/privacy}","received_events_url":"https://api.github.com/users/emallson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-04T14:42:32Z","updated_at":"2015-07-22T17:36:25Z","closed_at":null,"body":"**The Bug:** When I delete a segment of code with `dfx` (delete forward to the first x), the buffer scrolls to several very different positions in a very short period of time. Removing `tern-before-change` from the `before-change-functions` list causes this to stop.\r\n\r\n**Reproducing:**\r\n\r\n1. Install Emacs, Tern, Tern-Mode and Evil-Mode.\r\n2. Begin editing a JS file. Write out a function, then go to the declaration line (`function foo(bar) { ... `) and run `df{`. The screen will jump upwards and then back down very rapidly (if the buffer cannot be scrolled then it does not occur).\r\n\r\nChanging the \"200 millisec\" to  \"600 millisec\" in `tern-before-change` fixes it, but I am not sure what effect that would have on the actual behavior yet.\r\n\r\nAlso: it seems that `tern-before-change` is actually trying to wait until *after* the change to send the buffer, so why not use `after-change-functions`? I will experiment with this after work. Wanted to get it reported so I wouldn't forget."},"comment":{"url":"https://api.github.com/repos/marijnh/tern/issues/comments/123802613","html_url":"https://github.com/marijnh/tern/issues/556#issuecomment-123802613","issue_url":"https://api.github.com/repos/marijnh/tern/issues/556","id":123802613,"user":{"login":"emallson","id":4909458,"avatar_url":"https://avatars.githubusercontent.com/u/4909458?v=3","gravatar_id":"","url":"https://api.github.com/users/emallson","html_url":"https://github.com/emallson","followers_url":"https://api.github.com/users/emallson/followers","following_url":"https://api.github.com/users/emallson/following{/other_user}","gists_url":"https://api.github.com/users/emallson/gists{/gist_id}","starred_url":"https://api.github.com/users/emallson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emallson/subscriptions","organizations_url":"https://api.github.com/users/emallson/orgs","repos_url":"https://api.github.com/users/emallson/repos","events_url":"https://api.github.com/users/emallson/events{/privacy}","received_events_url":"https://api.github.com/users/emallson/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T17:36:25Z","updated_at":"2015-07-22T17:36:25Z","body":"A quick update on this: sorry that it took me so long. I was working with ES6/7 code for a while and couldn't really test my change on that. I've been back on ES5 code and the change I made has worked great. I'll submit a PR this evening once I'm off work."}}