{"action":"created","comment":{"url":"https://api.github.com/repos/basho/clique/pulls/comments/23810072","id":23810072,"diff_hunk":"@@ -91,7 +91,9 @@ resize_row(MaxLength, Widths) ->\n     Sum = lists:sum(Widths),\n     case Sum > MaxLength of\n \ttrue ->\n-\t    resize_items(Sum, MaxLength, Widths);\n+\t    NewWidths = resize_items(Sum, MaxLength, Widths),\n+\t    % go around again, just in case some columns were unshrinkable\n+\t    resize_row(MaxLength, NewWidths);","path":"src/clique_table.erl","position":7,"original_position":7,"commit_id":"c7ad5f494c1ebbf9bcc05ba928700abef2a262c2","original_commit_id":"c7ad5f494c1ebbf9bcc05ba928700abef2a262c2","user":{"login":"Vagabond","id":86412,"avatar_url":"https://avatars.githubusercontent.com/u/86412?v=3","gravatar_id":"","url":"https://api.github.com/users/Vagabond","html_url":"https://github.com/Vagabond","followers_url":"https://api.github.com/users/Vagabond/followers","following_url":"https://api.github.com/users/Vagabond/following{/other_user}","gists_url":"https://api.github.com/users/Vagabond/gists{/gist_id}","starred_url":"https://api.github.com/users/Vagabond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vagabond/subscriptions","organizations_url":"https://api.github.com/users/Vagabond/orgs","repos_url":"https://api.github.com/users/Vagabond/repos","events_url":"https://api.github.com/users/Vagabond/events{/privacy}","received_events_url":"https://api.github.com/users/Vagabond/received_events","type":"User","site_admin":false},"body":"Yeah, should probably break if Widths == NewWidths. The column resizing in general seems a little weird.","created_at":"2015-01-29T22:45:09Z","updated_at":"2015-01-29T22:45:09Z","html_url":"https://github.com/basho/clique/pull/49#discussion_r23810072","pull_request_url":"https://api.github.com/repos/basho/clique/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/basho/clique/pulls/comments/23810072"},"html":{"href":"https://github.com/basho/clique/pull/49#discussion_r23810072"},"pull_request":{"href":"https://api.github.com/repos/basho/clique/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/basho/clique/pulls/49","id":28132835,"html_url":"https://github.com/basho/clique/pull/49","diff_url":"https://github.com/basho/clique/pull/49.diff","patch_url":"https://github.com/basho/clique/pull/49.patch","issue_url":"https://api.github.com/repos/basho/clique/issues/49","number":49,"state":"open","locked":false,"title":"Don't allow columns to be resized to negative widths","user":{"login":"Vagabond","id":86412,"avatar_url":"https://avatars.githubusercontent.com/u/86412?v=3","gravatar_id":"","url":"https://api.github.com/users/Vagabond","html_url":"https://github.com/Vagabond","followers_url":"https://api.github.com/users/Vagabond/followers","following_url":"https://api.github.com/users/Vagabond/following{/other_user}","gists_url":"https://api.github.com/users/Vagabond/gists{/gist_id}","starred_url":"https://api.github.com/users/Vagabond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vagabond/subscriptions","organizations_url":"https://api.github.com/users/Vagabond/orgs","repos_url":"https://api.github.com/users/Vagabond/repos","events_url":"https://api.github.com/users/Vagabond/events{/privacy}","received_events_url":"https://api.github.com/users/Vagabond/received_events","type":"User","site_admin":false},"body":"On master, with a 100 column terminal:\r\n\r\n```erlang\r\n8> Header = [<<\"Test\">>, <<\"Result\">>, <<\"Reason\">>, <<\"Test Duration\">>].\r\n[<<\"Test\">>,<<\"Result\">>,<<\"Reason\">>,<<\"Test Duration\">>]\r\n9> Rows = [[\"end_to_end\",\"pass\",\"N/A\",11543062],\r\n9>                   [\"simple\",\"pass\",\"N/A\",6228040],\r\n9>                   [\"roam\",fail,\r\n9>                    [\"proplists : get_value ( channel , MStatus2 )\",32,61,32,\r\n9>                     \"12\",32,105,115,32,110,111,116,32,101,113,117,97,108,32,\r\n9>                     116,111,32,101,120,112,101,99,116,101,100,32,118,97,108,\r\n9>                     117,101,32,\"13\",32,97,116,32,108,105,110,101,32,\"45\"],\r\n9>                    34919569]]\r\n9> .\r\n[[\"end_to_end\",\"pass\",\"N/A\",11543062],\r\n [\"simple\",\"pass\",\"N/A\",6228040],\r\n [\"roam\",fail,\r\n  [\"proplists : get_value ( channel , MStatus2 )\",32,61,32,\r\n   \"12\",32,105,115,32,110,111,116,32,101,113,117,97,108,32,116,\r\n   111,32,101|...],\r\n  34919569]]\r\n10> clique_table:autosize_create_table(Header, Rows).\r\n** exception error: no function clause matching lists:seq(1,-2) (lists.erl, line 228)\r\n     in function  clique_table:char_seq/2 (src/clique_table.erl, line 196)\r\n     in call from clique_table:'-vertical_border/1-lc$^0/1-0-'/1 (src/clique_table.erl, line 191)\r\n     in call from clique_table:'-vertical_border/1-lc$^0/1-0-'/1 (src/clique_table.erl, line 192)\r\n     in call from clique_table:vertical_border/1 (src/clique_table.erl, line 191)\r\n     in call from clique_table:create_table/4 (src/clique_table.erl, line 71)\r\n```\r\n\r\nThis branch prevents column widths ever going negative, although the results may not be ideal.\r\n","created_at":"2015-01-27T18:34:39Z","updated_at":"2015-01-29T22:45:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0995bac44e890c3a8a8a563a408fc921bf21653f","assignee":{"login":"macintux","id":2141278,"avatar_url":"https://avatars.githubusercontent.com/u/2141278?v=3","gravatar_id":"","url":"https://api.github.com/users/macintux","html_url":"https://github.com/macintux","followers_url":"https://api.github.com/users/macintux/followers","following_url":"https://api.github.com/users/macintux/following{/other_user}","gists_url":"https://api.github.com/users/macintux/gists{/gist_id}","starred_url":"https://api.github.com/users/macintux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macintux/subscriptions","organizations_url":"https://api.github.com/users/macintux/orgs","repos_url":"https://api.github.com/users/macintux/repos","events_url":"https://api.github.com/users/macintux/events{/privacy}","received_events_url":"https://api.github.com/users/macintux/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/basho/clique/pulls/49/commits","review_comments_url":"https://api.github.com/repos/basho/clique/pulls/49/comments","review_comment_url":"https://api.github.com/repos/basho/clique/pulls/comments/{number}","comments_url":"https://api.github.com/repos/basho/clique/issues/49/comments","statuses_url":"https://api.github.com/repos/basho/clique/statuses/c7ad5f494c1ebbf9bcc05ba928700abef2a262c2","head":{"label":"Vagabond:adt-negative-widths","ref":"adt-negative-widths","sha":"c7ad5f494c1ebbf9bcc05ba928700abef2a262c2","user":{"login":"Vagabond","id":86412,"avatar_url":"https://avatars.githubusercontent.com/u/86412?v=3","gravatar_id":"","url":"https://api.github.com/users/Vagabond","html_url":"https://github.com/Vagabond","followers_url":"https://api.github.com/users/Vagabond/followers","following_url":"https://api.github.com/users/Vagabond/following{/other_user}","gists_url":"https://api.github.com/users/Vagabond/gists{/gist_id}","starred_url":"https://api.github.com/users/Vagabond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vagabond/subscriptions","organizations_url":"https://api.github.com/users/Vagabond/orgs","repos_url":"https://api.github.com/users/Vagabond/repos","events_url":"https://api.github.com/users/Vagabond/events{/privacy}","received_events_url":"https://api.github.com/users/Vagabond/received_events","type":"User","site_admin":false},"repo":{"id":29928359,"name":"clique","full_name":"Vagabond/clique","owner":{"login":"Vagabond","id":86412,"avatar_url":"https://avatars.githubusercontent.com/u/86412?v=3","gravatar_id":"","url":"https://api.github.com/users/Vagabond","html_url":"https://github.com/Vagabond","followers_url":"https://api.github.com/users/Vagabond/followers","following_url":"https://api.github.com/users/Vagabond/following{/other_user}","gists_url":"https://api.github.com/users/Vagabond/gists{/gist_id}","starred_url":"https://api.github.com/users/Vagabond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vagabond/subscriptions","organizations_url":"https://api.github.com/users/Vagabond/orgs","repos_url":"https://api.github.com/users/Vagabond/repos","events_url":"https://api.github.com/users/Vagabond/events{/privacy}","received_events_url":"https://api.github.com/users/Vagabond/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Vagabond/clique","description":"CLI Framework for Erlang","fork":true,"url":"https://api.github.com/repos/Vagabond/clique","forks_url":"https://api.github.com/repos/Vagabond/clique/forks","keys_url":"https://api.github.com/repos/Vagabond/clique/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Vagabond/clique/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Vagabond/clique/teams","hooks_url":"https://api.github.com/repos/Vagabond/clique/hooks","issue_events_url":"https://api.github.com/repos/Vagabond/clique/issues/events{/number}","events_url":"https://api.github.com/repos/Vagabond/clique/events","assignees_url":"https://api.github.com/repos/Vagabond/clique/assignees{/user}","branches_url":"https://api.github.com/repos/Vagabond/clique/branches{/branch}","tags_url":"https://api.github.com/repos/Vagabond/clique/tags","blobs_url":"https://api.github.com/repos/Vagabond/clique/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Vagabond/clique/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Vagabond/clique/git/refs{/sha}","trees_url":"https://api.github.com/repos/Vagabond/clique/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Vagabond/clique/statuses/{sha}","languages_url":"https://api.github.com/repos/Vagabond/clique/languages","stargazers_url":"https://api.github.com/repos/Vagabond/clique/stargazers","contributors_url":"https://api.github.com/repos/Vagabond/clique/contributors","subscribers_url":"https://api.github.com/repos/Vagabond/clique/subscribers","subscription_url":"https://api.github.com/repos/Vagabond/clique/subscription","commits_url":"https://api.github.com/repos/Vagabond/clique/commits{/sha}","git_commits_url":"https://api.github.com/repos/Vagabond/clique/git/commits{/sha}","comments_url":"https://api.github.com/repos/Vagabond/clique/comments{/number}","issue_comment_url":"https://api.github.com/repos/Vagabond/clique/issues/comments/{number}","contents_url":"https://api.github.com/repos/Vagabond/clique/contents/{+path}","compare_url":"https://api.github.com/repos/Vagabond/clique/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Vagabond/clique/merges","archive_url":"https://api.github.com/repos/Vagabond/clique/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Vagabond/clique/downloads","issues_url":"https://api.github.com/repos/Vagabond/clique/issues{/number}","pulls_url":"https://api.github.com/repos/Vagabond/clique/pulls{/number}","milestones_url":"https://api.github.com/repos/Vagabond/clique/milestones{/number}","notifications_url":"https://api.github.com/repos/Vagabond/clique/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Vagabond/clique/labels{/name}","releases_url":"https://api.github.com/repos/Vagabond/clique/releases{/id}","created_at":"2015-01-27T18:30:23Z","updated_at":"2015-01-27T18:30:23Z","pushed_at":"2015-01-27T18:32:39Z","git_url":"git://github.com/Vagabond/clique.git","ssh_url":"git@github.com:Vagabond/clique.git","clone_url":"https://github.com/Vagabond/clique.git","svn_url":"https://github.com/Vagabond/clique","homepage":"","size":1389,"stargazers_count":0,"watchers_count":0,"language":"Erlang","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":"develop"}},"base":{"label":"basho:develop","ref":"develop","sha":"45f19cf8b31adf8274a771a4defaae362d43df6c","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":26620387,"name":"clique","full_name":"basho/clique","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/clique","description":"CLI Framework for Erlang","fork":false,"url":"https://api.github.com/repos/basho/clique","forks_url":"https://api.github.com/repos/basho/clique/forks","keys_url":"https://api.github.com/repos/basho/clique/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/clique/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/clique/teams","hooks_url":"https://api.github.com/repos/basho/clique/hooks","issue_events_url":"https://api.github.com/repos/basho/clique/issues/events{/number}","events_url":"https://api.github.com/repos/basho/clique/events","assignees_url":"https://api.github.com/repos/basho/clique/assignees{/user}","branches_url":"https://api.github.com/repos/basho/clique/branches{/branch}","tags_url":"https://api.github.com/repos/basho/clique/tags","blobs_url":"https://api.github.com/repos/basho/clique/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/clique/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/clique/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/clique/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/clique/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/clique/languages","stargazers_url":"https://api.github.com/repos/basho/clique/stargazers","contributors_url":"https://api.github.com/repos/basho/clique/contributors","subscribers_url":"https://api.github.com/repos/basho/clique/subscribers","subscription_url":"https://api.github.com/repos/basho/clique/subscription","commits_url":"https://api.github.com/repos/basho/clique/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/clique/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/clique/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/clique/issues/comments/{number}","contents_url":"https://api.github.com/repos/basho/clique/contents/{+path}","compare_url":"https://api.github.com/repos/basho/clique/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/clique/merges","archive_url":"https://api.github.com/repos/basho/clique/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/clique/downloads","issues_url":"https://api.github.com/repos/basho/clique/issues{/number}","pulls_url":"https://api.github.com/repos/basho/clique/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/clique/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/clique/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/clique/labels{/name}","releases_url":"https://api.github.com/repos/basho/clique/releases{/id}","created_at":"2014-11-14T03:21:49Z","updated_at":"2015-01-28T20:33:31Z","pushed_at":"2015-01-27T22:31:57Z","git_url":"git://github.com/basho/clique.git","ssh_url":"git@github.com:basho/clique.git","clone_url":"https://github.com/basho/clique.git","svn_url":"https://github.com/basho/clique","homepage":"","size":1389,"stargazers_count":49,"watchers_count":49,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":49,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/basho/clique/pulls/49"},"html":{"href":"https://github.com/basho/clique/pull/49"},"issue":{"href":"https://api.github.com/repos/basho/clique/issues/49"},"comments":{"href":"https://api.github.com/repos/basho/clique/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/basho/clique/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/basho/clique/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/basho/clique/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/basho/clique/statuses/c7ad5f494c1ebbf9bcc05ba928700abef2a262c2"}}}}