{"action":"created","comment":{"url":"https://api.github.com/repos/neovim/neovim/pulls/comments/37423096","id":37423096,"diff_hunk":"@@ -0,0 +1,54 @@\n+-- Specs for :cd, :tcd, :lcd\n+\n+local helpers = require('test.functional.helpers')\n+local nvim, execute, eq, clear, eval, feed =\n+  helpers.nvim, helpers.execute, helpers.eq, helpers.clear, helpers.eval, helpers.feed\n+\n+describe(':cd :tcd', function()\n+  before_each(clear)\n+\n+  it('sets to local directory of the current tab', function()\n+    -- Store the initial working directory\n+    local globalDir = eval('getcwd()')\n+\n+    -- Create a new tab first and verify that is has the same working dir\n+    execute('tabnew')\n+    assert.is_same(eval('getcwd()'), globalDir)\n+\n+    -- Change tab-local working directory and verify it is different\n+    execute('tcd test')\n+    assert.is_same(eval('getcwd()'), globalDir .. '/test')\n+\n+    -- Create a new window in this tab to test `:lcd`\n+    execute('new')\n+    assert.is_same(eval('getcwd()'), globalDir .. '/test')\n+    execute('lcd benchmark')\n+    assert.is_same(eval('getcwd()'), globalDir .. '/test/benchmark')\n+    -- Verify the first window still has the tab local directory\n+    execute('exe \"normal \\\\<c-w>\\\\<c-w>\"')\n+    assert.is_same(eval('getcwd()'), globalDir .. '/test')\n+\n+    -- Change back to initial tab and verify working directory has stayed\n+    feed('gt')\n+    assert.is_same(eval('getcwd()'), globalDir)\n+\n+    -- Verify global changes don't affect local ones\n+    execute('cd build')\n+    assert.is_same(eval('getcwd()'), globalDir .. '/build')\n+    feed('gt')\n+    assert.is_same(eval('getcwd()'), globalDir .. '/test')\n+\n+    -- Unless the global change happened in a tab with local directory\n+    execute('cd ..')\n+    assert.is_same(eval('getcwd()'), globalDir)\n+    -- Which also affects the first tab\n+    feed('gt')\n+    assert.is_same(eval('getcwd()'), globalDir)\n+\n+    -- But not in a window with its own local directory\n+    feed('gt')\n+    execute('exe \"normal \\\\<c-w>\\\\<c-w>\"')\n+    assert.is_same(eval('getcwd()'), globalDir .. '/test/benchmark')\n+  end)","path":"test/functional/ex_cmds/cd_spec.lua","position":52,"original_position":52,"commit_id":"81aee270f2cabd535d56cb914f299e4997bfd385","original_commit_id":"81aee270f2cabd535d56cb914f299e4997bfd385","user":{"login":"ZyX-I","id":322097,"avatar_url":"https://avatars.githubusercontent.com/u/322097?v=3","gravatar_id":"","url":"https://api.github.com/users/ZyX-I","html_url":"https://github.com/ZyX-I","followers_url":"https://api.github.com/users/ZyX-I/followers","following_url":"https://api.github.com/users/ZyX-I/following{/other_user}","gists_url":"https://api.github.com/users/ZyX-I/gists{/gist_id}","starred_url":"https://api.github.com/users/ZyX-I/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZyX-I/subscriptions","organizations_url":"https://api.github.com/users/ZyX-I/orgs","repos_url":"https://api.github.com/users/ZyX-I/repos","events_url":"https://api.github.com/users/ZyX-I/events{/privacy}","received_events_url":"https://api.github.com/users/ZyX-I/received_events","type":"User","site_admin":false},"body":"Missing `hastabdir()` tests. I think it is logical to test it, and `haslocaldir()` for completeness in this function.","created_at":"2015-08-19T14:48:33Z","updated_at":"2015-08-19T14:48:33Z","html_url":"https://github.com/neovim/neovim/pull/3178#discussion_r37423096","pull_request_url":"https://api.github.com/repos/neovim/neovim/pulls/3178","_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments/37423096"},"html":{"href":"https://github.com/neovim/neovim/pull/3178#discussion_r37423096"},"pull_request":{"href":"https://api.github.com/repos/neovim/neovim/pulls/3178"}}},"pull_request":{"url":"https://api.github.com/repos/neovim/neovim/pulls/3178","id":42527628,"html_url":"https://github.com/neovim/neovim/pull/3178","diff_url":"https://github.com/neovim/neovim/pull/3178.diff","patch_url":"https://github.com/neovim/neovim/pull/3178.patch","issue_url":"https://api.github.com/repos/neovim/neovim/issues/3178","number":3178,"state":"open","locked":false,"title":"[WIP][RFC] Feature-request for `:tcd`","user":{"login":"HiPhish","id":4954650,"avatar_url":"https://avatars.githubusercontent.com/u/4954650?v=3","gravatar_id":"","url":"https://api.github.com/users/HiPhish","html_url":"https://github.com/HiPhish","followers_url":"https://api.github.com/users/HiPhish/followers","following_url":"https://api.github.com/users/HiPhish/following{/other_user}","gists_url":"https://api.github.com/users/HiPhish/gists{/gist_id}","starred_url":"https://api.github.com/users/HiPhish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HiPhish/subscriptions","organizations_url":"https://api.github.com/users/HiPhish/orgs","repos_url":"https://api.github.com/users/HiPhish/repos","events_url":"https://api.github.com/users/HiPhish/events{/privacy}","received_events_url":"https://api.github.com/users/HiPhish/received_events","type":"User","site_admin":false},"body":"Submitting this for code review of my changes while I write the documentation. I will rebase everything once I'm done.\r\n\r\nThe new `:tcd` command was requested by me in issue #3175. It adds tab-local working directories in addition to window-local ones.","created_at":"2015-08-15T23:29:33Z","updated_at":"2015-08-19T14:48:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fe229e755494c2d184060a05ec8065d32485b12","assignee":null,"milestone":{"url":"https://api.github.com/repos/neovim/neovim/milestones/6","html_url":"https://github.com/neovim/neovim/milestones/todo","labels_url":"https://api.github.com/repos/neovim/neovim/milestones/6/labels","id":655037,"number":6,"title":"todo","description":"\"todo\" items are *definitely not* planned for the *current* target, but *may* be given priority for a future target. Y'know, like todo.txt ;)","creator":{"login":"justinmk","id":1359421,"avatar_url":"https://avatars.githubusercontent.com/u/1359421?v=3","gravatar_id":"","url":"https://api.github.com/users/justinmk","html_url":"https://github.com/justinmk","followers_url":"https://api.github.com/users/justinmk/followers","following_url":"https://api.github.com/users/justinmk/following{/other_user}","gists_url":"https://api.github.com/users/justinmk/gists{/gist_id}","starred_url":"https://api.github.com/users/justinmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinmk/subscriptions","organizations_url":"https://api.github.com/users/justinmk/orgs","repos_url":"https://api.github.com/users/justinmk/repos","events_url":"https://api.github.com/users/justinmk/events{/privacy}","received_events_url":"https://api.github.com/users/justinmk/received_events","type":"User","site_admin":false},"open_issues":77,"closed_issues":13,"state":"open","created_at":"2014-05-10T20:43:04Z","updated_at":"2015-08-19T06:06:03Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/neovim/neovim/pulls/3178/commits","review_comments_url":"https://api.github.com/repos/neovim/neovim/pulls/3178/comments","review_comment_url":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/3178/comments","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/81aee270f2cabd535d56cb914f299e4997bfd385","head":{"label":"HiPhish:ex-tcd","ref":"ex-tcd","sha":"81aee270f2cabd535d56cb914f299e4997bfd385","user":{"login":"HiPhish","id":4954650,"avatar_url":"https://avatars.githubusercontent.com/u/4954650?v=3","gravatar_id":"","url":"https://api.github.com/users/HiPhish","html_url":"https://github.com/HiPhish","followers_url":"https://api.github.com/users/HiPhish/followers","following_url":"https://api.github.com/users/HiPhish/following{/other_user}","gists_url":"https://api.github.com/users/HiPhish/gists{/gist_id}","starred_url":"https://api.github.com/users/HiPhish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HiPhish/subscriptions","organizations_url":"https://api.github.com/users/HiPhish/orgs","repos_url":"https://api.github.com/users/HiPhish/repos","events_url":"https://api.github.com/users/HiPhish/events{/privacy}","received_events_url":"https://api.github.com/users/HiPhish/received_events","type":"User","site_admin":false},"repo":{"id":40736152,"name":"neovim","full_name":"HiPhish/neovim","owner":{"login":"HiPhish","id":4954650,"avatar_url":"https://avatars.githubusercontent.com/u/4954650?v=3","gravatar_id":"","url":"https://api.github.com/users/HiPhish","html_url":"https://github.com/HiPhish","followers_url":"https://api.github.com/users/HiPhish/followers","following_url":"https://api.github.com/users/HiPhish/following{/other_user}","gists_url":"https://api.github.com/users/HiPhish/gists{/gist_id}","starred_url":"https://api.github.com/users/HiPhish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HiPhish/subscriptions","organizations_url":"https://api.github.com/users/HiPhish/orgs","repos_url":"https://api.github.com/users/HiPhish/repos","events_url":"https://api.github.com/users/HiPhish/events{/privacy}","received_events_url":"https://api.github.com/users/HiPhish/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HiPhish/neovim","description":"Vim-fork focused on extensibility and agility. Consider helping sustain Neovim development! ","fork":true,"url":"https://api.github.com/repos/HiPhish/neovim","forks_url":"https://api.github.com/repos/HiPhish/neovim/forks","keys_url":"https://api.github.com/repos/HiPhish/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HiPhish/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HiPhish/neovim/teams","hooks_url":"https://api.github.com/repos/HiPhish/neovim/hooks","issue_events_url":"https://api.github.com/repos/HiPhish/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/HiPhish/neovim/events","assignees_url":"https://api.github.com/repos/HiPhish/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/HiPhish/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/HiPhish/neovim/tags","blobs_url":"https://api.github.com/repos/HiPhish/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HiPhish/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HiPhish/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/HiPhish/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HiPhish/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/HiPhish/neovim/languages","stargazers_url":"https://api.github.com/repos/HiPhish/neovim/stargazers","contributors_url":"https://api.github.com/repos/HiPhish/neovim/contributors","subscribers_url":"https://api.github.com/repos/HiPhish/neovim/subscribers","subscription_url":"https://api.github.com/repos/HiPhish/neovim/subscription","commits_url":"https://api.github.com/repos/HiPhish/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/HiPhish/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/HiPhish/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/HiPhish/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/HiPhish/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/HiPhish/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HiPhish/neovim/merges","archive_url":"https://api.github.com/repos/HiPhish/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HiPhish/neovim/downloads","issues_url":"https://api.github.com/repos/HiPhish/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/HiPhish/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/HiPhish/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/HiPhish/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HiPhish/neovim/labels{/name}","releases_url":"https://api.github.com/repos/HiPhish/neovim/releases{/id}","created_at":"2015-08-14T21:09:19Z","updated_at":"2015-08-14T21:09:24Z","pushed_at":"2015-08-19T13:05:30Z","git_url":"git://github.com/HiPhish/neovim.git","ssh_url":"git@github.com:HiPhish/neovim.git","clone_url":"https://github.com/HiPhish/neovim.git","svn_url":"https://github.com/HiPhish/neovim","homepage":"https://salt.bountysource.com/teams/neovim","size":33219,"stargazers_count":0,"watchers_count":0,"language":"VimL","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"neovim:master","ref":"master","sha":"90ef218610ec0b2bd3947b7be0611457c910564b","user":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","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,"name":"neovim","full_name":"neovim/neovim","owner":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","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 agility. Consider helping sustain Neovim development! ","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}","created_at":"2014-01-31T13:39:22Z","updated_at":"2015-08-19T14:25:28Z","pushed_at":"2015-08-19T13:05:30Z","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":78385,"stargazers_count":14616,"watchers_count":14616,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1012,"mirror_url":null,"open_issues_count":529,"forks":1012,"open_issues":529,"watchers":14616,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/3178"},"html":{"href":"https://github.com/neovim/neovim/pull/3178"},"issue":{"href":"https://api.github.com/repos/neovim/neovim/issues/3178"},"comments":{"href":"https://api.github.com/repos/neovim/neovim/issues/3178/comments"},"review_comments":{"href":"https://api.github.com/repos/neovim/neovim/pulls/3178/comments"},"review_comment":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neovim/neovim/pulls/3178/commits"},"statuses":{"href":"https://api.github.com/repos/neovim/neovim/statuses/81aee270f2cabd535d56cb914f299e4997bfd385"}}}}