{"action":"created","comment":{"url":"https://api.github.com/repos/neovim/neovim/pulls/comments/200610926","pull_request_review_id":134961010,"id":200610926,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDYxMDkyNg==","diff_hunk":"@@ -745,10 +758,34 @@ void nvim_buf_set_name(Buffer buffer, String name, Error *err)\n   }\n }\n \n-/// Checks if a buffer is valid\n+/// Checks if a buffer is valid and loaded. When a buffer is\n+/// unloaded its file contents are freed from memory and vim\n+/// cannot operate on the buffer lines until it is reloaded\n+/// (usually by opening the buffer again in a new window). API\n+/// methods such as |nvim_buf_line_count()| and\n+/// |nvim_buf_get_lines()| will be affected.\n+///\n+/// Buffers may have been unloaded by the |:bunload| command or\n+/// the buffer's|'bufhidden'| option.\n+///\n+/// @param buffer Buffer handle\n+/// @return true if the buffer is valid and loaded, false otherwise.\n+Boolean nvim_buf_is_loaded(Buffer buffer)\n+  FUNC_API_SINCE(5)\n+{\n+  Error stub = ERROR_INIT;","path":"src/nvim/api/buffer.c","position":65,"original_position":65,"commit_id":"0ef74fca3280ce26bb7418588b37076c7f6d3e36","original_commit_id":"0ef74fca3280ce26bb7418588b37076c7f6d3e36","user":{"login":"bfredl","id":1363104,"node_id":"MDQ6VXNlcjEzNjMxMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1363104?v=4","gravatar_id":"","url":"https://api.github.com/users/bfredl","html_url":"https://github.com/bfredl","followers_url":"https://api.github.com/users/bfredl/followers","following_url":"https://api.github.com/users/bfredl/following{/other_user}","gists_url":"https://api.github.com/users/bfredl/gists{/gist_id}","starred_url":"https://api.github.com/users/bfredl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfredl/subscriptions","organizations_url":"https://api.github.com/users/bfredl/orgs","repos_url":"https://api.github.com/users/bfredl/repos","events_url":"https://api.github.com/users/bfredl/events{/privacy}","received_events_url":"https://api.github.com/users/bfredl/received_events","type":"User","site_admin":false},"body":"(for posterity: just realized `nvim_buf_line_count` is already this function.)","created_at":"2018-07-06T10:15:45Z","updated_at":"2018-07-06T10:15:45Z","html_url":"https://github.com/neovim/neovim/pull/8660#discussion_r200610926","pull_request_url":"https://api.github.com/repos/neovim/neovim/pulls/8660","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments/200610926"},"html":{"href":"https://github.com/neovim/neovim/pull/8660#discussion_r200610926"},"pull_request":{"href":"https://api.github.com/repos/neovim/neovim/pulls/8660"}},"in_reply_to_id":200039474},"pull_request":{"url":"https://api.github.com/repos/neovim/neovim/pulls/8660","id":198240333,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4MjQwMzMz","html_url":"https://github.com/neovim/neovim/pull/8660","diff_url":"https://github.com/neovim/neovim/pull/8660.diff","patch_url":"https://github.com/neovim/neovim/pull/8660.patch","issue_url":"https://api.github.com/repos/neovim/neovim/issues/8660","number":8660,"state":"open","locked":false,"title":"nvim_buf_*() and unloaded buffers","user":{"login":"phodge","id":3629785,"node_id":"MDQ6VXNlcjM2Mjk3ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/3629785?v=4","gravatar_id":"","url":"https://api.github.com/users/phodge","html_url":"https://github.com/phodge","followers_url":"https://api.github.com/users/phodge/followers","following_url":"https://api.github.com/users/phodge/following{/other_user}","gists_url":"https://api.github.com/users/phodge/gists{/gist_id}","starred_url":"https://api.github.com/users/phodge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phodge/subscriptions","organizations_url":"https://api.github.com/users/phodge/orgs","repos_url":"https://api.github.com/users/phodge/repos","events_url":"https://api.github.com/users/phodge/events{/privacy}","received_events_url":"https://api.github.com/users/phodge/received_events","type":"User","site_admin":false},"body":"Proposed solution for #7688 and #5534. Changes in this PR:\r\n\r\n* `nvim_buf_get_lines()` will now always return an empty list for an unloaded buffer, instead of a list containing a single empty string.\r\n* `nvim_buf_line_count()` will now always return `0` for an unloaded buffer, instead of `1`.\r\n* `nvim_buf_is_loaded()` has been added to check if a buffer is loaded\r\n* help text updates for the above\r\n* extra unit tests for the above","created_at":"2018-06-29T07:48:28Z","updated_at":"2018-07-06T10:15:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e19265bb2787430b7b31ccf9418c10144da4bf56","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/neovim/neovim/pulls/8660/commits","review_comments_url":"https://api.github.com/repos/neovim/neovim/pulls/8660/comments","review_comment_url":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/8660/comments","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/0ef74fca3280ce26bb7418588b37076c7f6d3e36","head":{"label":"phodge:7688-nvim-buf-lines-should-return-empty-list-for-unloaded-buffer","ref":"7688-nvim-buf-lines-should-return-empty-list-for-unloaded-buffer","sha":"0ef74fca3280ce26bb7418588b37076c7f6d3e36","user":{"login":"phodge","id":3629785,"node_id":"MDQ6VXNlcjM2Mjk3ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/3629785?v=4","gravatar_id":"","url":"https://api.github.com/users/phodge","html_url":"https://github.com/phodge","followers_url":"https://api.github.com/users/phodge/followers","following_url":"https://api.github.com/users/phodge/following{/other_user}","gists_url":"https://api.github.com/users/phodge/gists{/gist_id}","starred_url":"https://api.github.com/users/phodge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phodge/subscriptions","organizations_url":"https://api.github.com/users/phodge/orgs","repos_url":"https://api.github.com/users/phodge/repos","events_url":"https://api.github.com/users/phodge/events{/privacy}","received_events_url":"https://api.github.com/users/phodge/received_events","type":"User","site_admin":false},"repo":{"id":62870120,"node_id":"MDEwOlJlcG9zaXRvcnk2Mjg3MDEyMA==","name":"neovim","full_name":"phodge/neovim","owner":{"login":"phodge","id":3629785,"node_id":"MDQ6VXNlcjM2Mjk3ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/3629785?v=4","gravatar_id":"","url":"https://api.github.com/users/phodge","html_url":"https://github.com/phodge","followers_url":"https://api.github.com/users/phodge/followers","following_url":"https://api.github.com/users/phodge/following{/other_user}","gists_url":"https://api.github.com/users/phodge/gists{/gist_id}","starred_url":"https://api.github.com/users/phodge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phodge/subscriptions","organizations_url":"https://api.github.com/users/phodge/orgs","repos_url":"https://api.github.com/users/phodge/repos","events_url":"https://api.github.com/users/phodge/events{/privacy}","received_events_url":"https://api.github.com/users/phodge/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phodge/neovim","description":"Vim-fork focused on extensibility and agility.","fork":true,"url":"https://api.github.com/repos/phodge/neovim","forks_url":"https://api.github.com/repos/phodge/neovim/forks","keys_url":"https://api.github.com/repos/phodge/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phodge/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phodge/neovim/teams","hooks_url":"https://api.github.com/repos/phodge/neovim/hooks","issue_events_url":"https://api.github.com/repos/phodge/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/phodge/neovim/events","assignees_url":"https://api.github.com/repos/phodge/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/phodge/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/phodge/neovim/tags","blobs_url":"https://api.github.com/repos/phodge/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phodge/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phodge/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/phodge/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phodge/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/phodge/neovim/languages","stargazers_url":"https://api.github.com/repos/phodge/neovim/stargazers","contributors_url":"https://api.github.com/repos/phodge/neovim/contributors","subscribers_url":"https://api.github.com/repos/phodge/neovim/subscribers","subscription_url":"https://api.github.com/repos/phodge/neovim/subscription","commits_url":"https://api.github.com/repos/phodge/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/phodge/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/phodge/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/phodge/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/phodge/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/phodge/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phodge/neovim/merges","archive_url":"https://api.github.com/repos/phodge/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phodge/neovim/downloads","issues_url":"https://api.github.com/repos/phodge/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/phodge/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/phodge/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/phodge/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phodge/neovim/labels{/name}","releases_url":"https://api.github.com/repos/phodge/neovim/releases{/id}","deployments_url":"https://api.github.com/repos/phodge/neovim/deployments","created_at":"2016-07-08T08:00:11Z","updated_at":"2018-06-24T20:51:43Z","pushed_at":"2018-07-02T05:07:00Z","git_url":"git://github.com/phodge/neovim.git","ssh_url":"git@github.com:phodge/neovim.git","clone_url":"https://github.com/phodge/neovim.git","svn_url":"https://github.com/phodge/neovim","homepage":"https://salt.bountysource.com/teams/neovim","size":70399,"stargazers_count":0,"watchers_count":0,"language":"Vim script","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"neovim:master","ref":"master","sha":"12481781a0215c2ba0ab250d9cfdb9a082ab495a","user":{"login":"neovim","id":6471485,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzE0ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/6471485?v=4","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"repo":{"id":16408992,"node_id":"MDEwOlJlcG9zaXRvcnkxNjQwODk5Mg==","name":"neovim","full_name":"neovim/neovim","owner":{"login":"neovim","id":6471485,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzE0ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/6471485?v=4","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neovim/neovim","description":"Vim-fork focused on extensibility and usability","fork":false,"url":"https://api.github.com/repos/neovim/neovim","forks_url":"https://api.github.com/repos/neovim/neovim/forks","keys_url":"https://api.github.com/repos/neovim/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neovim/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neovim/neovim/teams","hooks_url":"https://api.github.com/repos/neovim/neovim/hooks","issue_events_url":"https://api.github.com/repos/neovim/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/neovim/neovim/events","assignees_url":"https://api.github.com/repos/neovim/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/neovim/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/neovim/neovim/tags","blobs_url":"https://api.github.com/repos/neovim/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neovim/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neovim/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/neovim/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/neovim/neovim/languages","stargazers_url":"https://api.github.com/repos/neovim/neovim/stargazers","contributors_url":"https://api.github.com/repos/neovim/neovim/contributors","subscribers_url":"https://api.github.com/repos/neovim/neovim/subscribers","subscription_url":"https://api.github.com/repos/neovim/neovim/subscription","commits_url":"https://api.github.com/repos/neovim/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/neovim/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/neovim/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/neovim/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/neovim/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/neovim/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neovim/neovim/merges","archive_url":"https://api.github.com/repos/neovim/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neovim/neovim/downloads","issues_url":"https://api.github.com/repos/neovim/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/neovim/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/neovim/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/neovim/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neovim/neovim/labels{/name}","releases_url":"https://api.github.com/repos/neovim/neovim/releases{/id}","deployments_url":"https://api.github.com/repos/neovim/neovim/deployments","created_at":"2014-01-31T13:39:22Z","updated_at":"2018-07-06T09:16:46Z","pushed_at":"2018-07-06T09:43:25Z","git_url":"git://github.com/neovim/neovim.git","ssh_url":"git@github.com:neovim/neovim.git","clone_url":"https://github.com/neovim/neovim.git","svn_url":"https://github.com/neovim/neovim","homepage":"https://salt.bountysource.com/teams/neovim","size":70580,"stargazers_count":27670,"watchers_count":27670,"language":"Vim script","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1987,"mirror_url":null,"archived":false,"open_issues_count":901,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1987,"open_issues":901,"watchers":27670,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/8660"},"html":{"href":"https://github.com/neovim/neovim/pull/8660"},"issue":{"href":"https://api.github.com/repos/neovim/neovim/issues/8660"},"comments":{"href":"https://api.github.com/repos/neovim/neovim/issues/8660/comments"},"review_comments":{"href":"https://api.github.com/repos/neovim/neovim/pulls/8660/comments"},"review_comment":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neovim/neovim/pulls/8660/commits"},"statuses":{"href":"https://api.github.com/repos/neovim/neovim/statuses/0ef74fca3280ce26bb7418588b37076c7f6d3e36"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bfredl"}}