{"action":"created","issue":{"url":"https://api.github.com/repos/SirVer/ultisnips/issues/629","labels_url":"https://api.github.com/repos/SirVer/ultisnips/issues/629/labels{/name}","comments_url":"https://api.github.com/repos/SirVer/ultisnips/issues/629/comments","events_url":"https://api.github.com/repos/SirVer/ultisnips/issues/629/events","html_url":"https://github.com/SirVer/ultisnips/issues/629","id":124425950,"number":629,"title":"An error when I insert a snippet and then undo it","user":{"login":"yanqd0","id":8525143,"avatar_url":"https://avatars.githubusercontent.com/u/8525143?v=3","gravatar_id":"","url":"https://api.github.com/users/yanqd0","html_url":"https://github.com/yanqd0","followers_url":"https://api.github.com/users/yanqd0/followers","following_url":"https://api.github.com/users/yanqd0/following{/other_user}","gists_url":"https://api.github.com/users/yanqd0/gists{/gist_id}","starred_url":"https://api.github.com/users/yanqd0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanqd0/subscriptions","organizations_url":"https://api.github.com/users/yanqd0/orgs","repos_url":"https://api.github.com/users/yanqd0/repos","events_url":"https://api.github.com/users/yanqd0/events{/privacy}","received_events_url":"https://api.github.com/users/yanqd0/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SirVer/ultisnips/labels/pending_feedback","name":"pending_feedback","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-31T03:02:11Z","updated_at":"2016-01-21T03:00:18Z","closed_at":null,"body":"I write a snippet in `java.snippets`:\r\n\r\n```snippets\r\nsnippet iclass \"A inner class\" bm\r\nclass ${1:ClassName} {\r\n\r\n\tprotected ${1/(\\w+).*/$1/}() {\r\n\t\t${0:// TODO: Default constructor.}\r\n\t}\r\n\r\n}\r\n```\r\n\r\nWhen I insert `iclass<Tab>` and then undo it once again, there will be an error.\r\nThe repetition probability is nearly **50%** sometimes, or rarely.\r\n\r\n> Following is the full stack trace:\r\n> Traceback (most recent call last):\r\n>   File \"/Users/yanqd0/.vim/bundle/ultisnips/pythonx/UltiSnips/snippet_manager.py\", line 61, in wrapper\r\n>     return func(self, *args, **kwds)\r\n>   File \"/Users/yanqd0/.vim/bundle/ultisnips/pythonx/UltiSnips/snippet_manager.py\", line 368, in _cursor_moved\r\n>     self._csnippets[0].update_textobjects()\r\n>   File \"/Users/yanqd0/.vim/bundle/ultisnips/pythonx/UltiSnips/text_objects/_snippet_instance.py\", line 79, in update_textobjects\r\n>     if obj._update(done):\r\n>   File \"/Users/yanqd0/.vim/bundle/ultisnips/pythonx/UltiSnips/text_objects/_mirror.py\", line 26, in _update\r\n>     self.overwrite(self._get_text())\r\n>   File \"/Users/yanqd0/.vim/bundle/ultisnips/pythonx/UltiSnips/text_objects/_base.py\", line 128, in overwrite\r\n>     if self.current_text == gtext:\r\n>   File \"/Users/yanqd0/.vim/bundle/ultisnips/pythonx/UltiSnips/text_objects/_base.py\", line 101, in current_text\r\n>     return _vim.buf[self._start.line][self._start.col:self._end.col]\r\n>   File \"/Users/yanqd0/.vim/bundle/ultisnips/pythonx/UltiSnips/_vim.py\", line 25, in __getitem__\r\n>     rv = vim.current.buffer[idx]\r\n> IndexError: line number out of range\r\n"},"comment":{"url":"https://api.github.com/repos/SirVer/ultisnips/issues/comments/173436266","html_url":"https://github.com/SirVer/ultisnips/issues/629#issuecomment-173436266","issue_url":"https://api.github.com/repos/SirVer/ultisnips/issues/629","id":173436266,"user":{"login":"yanqd0","id":8525143,"avatar_url":"https://avatars.githubusercontent.com/u/8525143?v=3","gravatar_id":"","url":"https://api.github.com/users/yanqd0","html_url":"https://github.com/yanqd0","followers_url":"https://api.github.com/users/yanqd0/followers","following_url":"https://api.github.com/users/yanqd0/following{/other_user}","gists_url":"https://api.github.com/users/yanqd0/gists{/gist_id}","starred_url":"https://api.github.com/users/yanqd0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanqd0/subscriptions","organizations_url":"https://api.github.com/users/yanqd0/orgs","repos_url":"https://api.github.com/users/yanqd0/repos","events_url":"https://api.github.com/users/yanqd0/events{/privacy}","received_events_url":"https://api.github.com/users/yanqd0/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T03:00:18Z","updated_at":"2016-01-21T03:00:18Z","body":"Sorry for late.\r\n\r\n![ultisnips_bug](https://cloud.githubusercontent.com/assets/8525143/12470194/3e20b044-c02d-11e5-80c5-5fac8911da89.gif)\r\n\r\nAs shown by the GIF above, when I undo `iclass` for the **second** time, something weird happened. When the **forth** time, a crash happened."}}