{"action":"closed","issue":{"url":"https://api.github.com/repos/rust-lang/rust-mode/issues/127","repository_url":"https://api.github.com/repos/rust-lang/rust-mode","labels_url":"https://api.github.com/repos/rust-lang/rust-mode/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust-mode/issues/127/comments","events_url":"https://api.github.com/repos/rust-lang/rust-mode/issues/127/events","html_url":"https://github.com/rust-lang/rust-mode/issues/127","id":138230087,"number":127,"title":"rustfmt causes indentation to get messed up","user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-03T16:40:41Z","updated_at":"2016-03-07T20:27:28Z","closed_at":"2016-03-07T20:27:28Z","body":"I haven't been able to narrow this down yet to a smaller buffer, but here is a consistent reproduction of a problem (for me at least). Start with [this input](https://gist.github.com/nikomatsakis/2ce0c51f1bcca16c1ec8) in some buffer. If you jump to the end and hit tab (M-x indent-for-tab-command) on the line `// need some logic for start state and eof`, then you should find that it stays put:\r\n\r\n```\r\n        ...\r\n        // need some logic for start state and eof\r\n    }\r\n}\r\n```\r\n\r\nBut if you then run `C-c C-f` (run rustfmt) and hit tab again, you will find that it jumps to the beginning of the line:\r\n\r\n```\r\n// need some logic for start state and eof\r\n    }\r\n}\r\n```\r\n\r\nIf you close the buffer and re-open, things work fine again.\r\n\r\nI encounter this quite regularly -- but my attempts to delete text out of the buffer often caused the issue to go away, so I'm leaving it as is.\r\n\r\ncc @MicahChalmer this seems related to a previous issue we had with losing sync, iirc?"}}