{"action":"created","issue":{"url":"https://api.github.com/repos/kopischke/vim-stay/issues/5","labels_url":"https://api.github.com/repos/kopischke/vim-stay/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/kopischke/vim-stay/issues/5/comments","events_url":"https://api.github.com/repos/kopischke/vim-stay/issues/5/events","html_url":"https://github.com/kopischke/vim-stay/issues/5","id":56506888,"number":5,"title":"Integrate with FastFold","user":{"login":"kopischke","id":80906,"avatar_url":"https://avatars.githubusercontent.com/u/80906?v=3","gravatar_id":"","url":"https://api.github.com/users/kopischke","html_url":"https://github.com/kopischke","followers_url":"https://api.github.com/users/kopischke/followers","following_url":"https://api.github.com/users/kopischke/following{/other_user}","gists_url":"https://api.github.com/users/kopischke/gists{/gist_id}","starred_url":"https://api.github.com/users/kopischke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kopischke/subscriptions","organizations_url":"https://api.github.com/users/kopischke/orgs","repos_url":"https://api.github.com/users/kopischke/repos","events_url":"https://api.github.com/users/kopischke/events{/privacy}","received_events_url":"https://api.github.com/users/kopischke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kopischke/vim-stay/labels/awaiting%20response","name":"awaiting response","color":"eb6420"},{"url":"https://api.github.com/repos/kopischke/vim-stay/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/kopischke/vim-stay/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"kopischke","id":80906,"avatar_url":"https://avatars.githubusercontent.com/u/80906?v=3","gravatar_id":"","url":"https://api.github.com/users/kopischke","html_url":"https://github.com/kopischke","followers_url":"https://api.github.com/users/kopischke/followers","following_url":"https://api.github.com/users/kopischke/following{/other_user}","gists_url":"https://api.github.com/users/kopischke/gists{/gist_id}","starred_url":"https://api.github.com/users/kopischke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kopischke/subscriptions","organizations_url":"https://api.github.com/users/kopischke/orgs","repos_url":"https://api.github.com/users/kopischke/repos","events_url":"https://api.github.com/users/kopischke/events{/privacy}","received_events_url":"https://api.github.com/users/kopischke/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/kopischke/vim-stay/milestones/3","html_url":"https://github.com/kopischke/vim-stay/milestones/Release%201.2.0","labels_url":"https://api.github.com/repos/kopischke/vim-stay/milestones/3/labels","id":971457,"number":3,"title":"Release 1.2.0","description":"","creator":{"login":"kopischke","id":80906,"avatar_url":"https://avatars.githubusercontent.com/u/80906?v=3","gravatar_id":"","url":"https://api.github.com/users/kopischke","html_url":"https://github.com/kopischke","followers_url":"https://api.github.com/users/kopischke/followers","following_url":"https://api.github.com/users/kopischke/following{/other_user}","gists_url":"https://api.github.com/users/kopischke/gists{/gist_id}","starred_url":"https://api.github.com/users/kopischke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kopischke/subscriptions","organizations_url":"https://api.github.com/users/kopischke/orgs","repos_url":"https://api.github.com/users/kopischke/repos","events_url":"https://api.github.com/users/kopischke/events{/privacy}","received_events_url":"https://api.github.com/users/kopischke/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2015-02-09T10:09:29Z","updated_at":"2015-02-26T23:20:28Z","due_on":null,"closed_at":null},"comments":23,"created_at":"2015-02-04T10:07:26Z","updated_at":"2015-02-27T07:20:59Z","closed_at":null,"body":"[FastFold](https://github.com/Konfekt/FastFold) by @Konfekt leverages the same events as *vim-stay*:\r\n\r\n> Regarding compatability with FastFold, vim-stay must be loaded after FastFold so that mkview in vim-stay's BufWinLeave and BufWinEnter autocmds saves the syntax or expression foldmethod and not the manual foldmethod FastFold artificially imposes.\r\n\r\n> The BufLeave autocmd is curious as it seems accounted for by the BufWinLeave autocmd ?! If vim-stay only used that autocmd, than the timing would always be wrong, because the BufLeave autocmd is invoked too early. However, as things stand, the erroneous (that is, incompatible to FastFold) view file created by the BufLeave autocmd is overriden by the correct one from the BufWinLeave autocmd.\r\n\r\nThe problem is that when quitting a window, `BufWinLeave` sometimes fires after the window has been destroyed (the window number returned by `getbufwinnr(bufnr)` is -1 – see `:h BufWinLeave`, which warns of this, albeit a bit cryptically), which makes view creation impossible (`:mkview` needs a valid window). `BufLeave` OTOH always fires in a valid window, so both events are needed to catch “buffer leaving a view” situations. This also means *vim-stay* will at times save the spurious manual folds set by *FastFold*. "},"comment":{"url":"https://api.github.com/repos/kopischke/vim-stay/issues/comments/76349703","html_url":"https://github.com/kopischke/vim-stay/issues/5#issuecomment-76349703","issue_url":"https://api.github.com/repos/kopischke/vim-stay/issues/5","id":76349703,"user":{"login":"Parakleta","id":11205202,"avatar_url":"https://avatars.githubusercontent.com/u/11205202?v=3","gravatar_id":"","url":"https://api.github.com/users/Parakleta","html_url":"https://github.com/Parakleta","followers_url":"https://api.github.com/users/Parakleta/followers","following_url":"https://api.github.com/users/Parakleta/following{/other_user}","gists_url":"https://api.github.com/users/Parakleta/gists{/gist_id}","starred_url":"https://api.github.com/users/Parakleta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parakleta/subscriptions","organizations_url":"https://api.github.com/users/Parakleta/orgs","repos_url":"https://api.github.com/users/Parakleta/repos","events_url":"https://api.github.com/users/Parakleta/events{/privacy}","received_events_url":"https://api.github.com/users/Parakleta/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T07:20:59Z","updated_at":"2015-02-27T07:20:59Z","body":"Yes of course, `FastFoldUpdate` does exactly what is needed here.  I'm about to sign off for the weekend, I'll have another fiddle and do some more testing on Monday."}}