{"action":"created","comment":{"url":"https://api.github.com/repos/jwilm/alacritty/pulls/comments/228991531","pull_request_review_id":169384216,"id":228991531,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODk5MTUzMQ==","diff_hunk":"@@ -873,8 +873,8 @@ impl SizeInfo {\n         let line = Line(y.saturating_sub(self.padding_y as usize) / (self.cell_height as usize));\n \n         Point {\n-            line: min(line, self.lines() - 1),\n-            col: min(col, self.cols() - 1)\n+            line: min(line, self.lines()),\n+            col: min(col, self.cols())","path":"src/term/mod.rs","position":7,"original_position":7,"commit_id":"c1004147df85caca04c937875fefe884e72aaccc","original_commit_id":"c1004147df85caca04c937875fefe884e72aaccc","user":{"login":"chrisduerr","id":8886672,"node_id":"MDQ6VXNlcjg4ODY2NzI=","avatar_url":"https://avatars3.githubusercontent.com/u/8886672?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisduerr","html_url":"https://github.com/chrisduerr","followers_url":"https://api.github.com/users/chrisduerr/followers","following_url":"https://api.github.com/users/chrisduerr/following{/other_user}","gists_url":"https://api.github.com/users/chrisduerr/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisduerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisduerr/subscriptions","organizations_url":"https://api.github.com/users/chrisduerr/orgs","repos_url":"https://api.github.com/users/chrisduerr/repos","events_url":"https://api.github.com/users/chrisduerr/events{/privacy}","received_events_url":"https://api.github.com/users/chrisduerr/received_events","type":"User","site_admin":false},"body":"I'm pretty certain that this breaks things, it's just not a code path which is commonly run.\r\n\r\nSince `self.cols()` returns the number of columns, but the indexing starts at `0` and not `1`, this would introduce the classical issue you get with arrays when trying to index them with `array.length`.\r\n\r\nNote that `self.lines()` and `self.cols()` should never be `0` in the first place, since that would mean there's not a single cell which exists. I'd just recommend going for `self.lines().saturating_sub(1)` for both lines and columns. That should solve the underflow **and** keep the logic accurate.","created_at":"2018-10-29T16:04:46Z","updated_at":"2018-10-29T16:10:48Z","html_url":"https://github.com/jwilm/alacritty/pull/1715#discussion_r228991531","pull_request_url":"https://api.github.com/repos/jwilm/alacritty/pulls/1715","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/jwilm/alacritty/pulls/comments/228991531"},"html":{"href":"https://github.com/jwilm/alacritty/pull/1715#discussion_r228991531"},"pull_request":{"href":"https://api.github.com/repos/jwilm/alacritty/pulls/1715"}}},"pull_request":{"url":"https://api.github.com/repos/jwilm/alacritty/pulls/1715","id":226456857,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2NDU2ODU3","html_url":"https://github.com/jwilm/alacritty/pull/1715","diff_url":"https://github.com/jwilm/alacritty/pull/1715.diff","patch_url":"https://github.com/jwilm/alacritty/pull/1715.patch","issue_url":"https://api.github.com/repos/jwilm/alacritty/issues/1715","number":1715,"state":"open","locked":false,"title":"Fix for an underflow on some type conversions","user":{"login":"zacps","id":9827696,"node_id":"MDQ6VXNlcjk4Mjc2OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/9827696?v=4","gravatar_id":"","url":"https://api.github.com/users/zacps","html_url":"https://github.com/zacps","followers_url":"https://api.github.com/users/zacps/followers","following_url":"https://api.github.com/users/zacps/following{/other_user}","gists_url":"https://api.github.com/users/zacps/gists{/gist_id}","starred_url":"https://api.github.com/users/zacps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zacps/subscriptions","organizations_url":"https://api.github.com/users/zacps/orgs","repos_url":"https://api.github.com/users/zacps/repos","events_url":"https://api.github.com/users/zacps/events{/privacy}","received_events_url":"https://api.github.com/users/zacps/received_events","type":"User","site_admin":false},"body":"This changes the winpty resize logic to ensure we'll back out in the bindings if we get passed an invalid value rather than passing it on.\r\n\r\nIt also fixes the cause of the underflow in the logic for converting calculating the `lines`, `cols` from `SizeInfo`. I'm not sure if it was like that intentionally but I haven't observed any breakage from this change.\r\n\r\nFixes https://github.com/jwilm/alacritty/issues/1669","created_at":"2018-10-29T07:04:48Z","updated_at":"2018-10-29T16:10:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14795d47cf22694c363359b5e5f776083cbcd38d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jwilm/alacritty/pulls/1715/commits","review_comments_url":"https://api.github.com/repos/jwilm/alacritty/pulls/1715/comments","review_comment_url":"https://api.github.com/repos/jwilm/alacritty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jwilm/alacritty/issues/1715/comments","statuses_url":"https://api.github.com/repos/jwilm/alacritty/statuses/c1004147df85caca04c937875fefe884e72aaccc","head":{"label":"zacps:resize_underflow_fix","ref":"resize_underflow_fix","sha":"c1004147df85caca04c937875fefe884e72aaccc","user":{"login":"zacps","id":9827696,"node_id":"MDQ6VXNlcjk4Mjc2OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/9827696?v=4","gravatar_id":"","url":"https://api.github.com/users/zacps","html_url":"https://github.com/zacps","followers_url":"https://api.github.com/users/zacps/followers","following_url":"https://api.github.com/users/zacps/following{/other_user}","gists_url":"https://api.github.com/users/zacps/gists{/gist_id}","starred_url":"https://api.github.com/users/zacps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zacps/subscriptions","organizations_url":"https://api.github.com/users/zacps/orgs","repos_url":"https://api.github.com/users/zacps/repos","events_url":"https://api.github.com/users/zacps/events{/privacy}","received_events_url":"https://api.github.com/users/zacps/received_events","type":"User","site_admin":false},"repo":{"id":112880558,"node_id":"MDEwOlJlcG9zaXRvcnkxMTI4ODA1NTg=","name":"alacritty","full_name":"zacps/alacritty","private":false,"owner":{"login":"zacps","id":9827696,"node_id":"MDQ6VXNlcjk4Mjc2OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/9827696?v=4","gravatar_id":"","url":"https://api.github.com/users/zacps","html_url":"https://github.com/zacps","followers_url":"https://api.github.com/users/zacps/followers","following_url":"https://api.github.com/users/zacps/following{/other_user}","gists_url":"https://api.github.com/users/zacps/gists{/gist_id}","starred_url":"https://api.github.com/users/zacps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zacps/subscriptions","organizations_url":"https://api.github.com/users/zacps/orgs","repos_url":"https://api.github.com/users/zacps/repos","events_url":"https://api.github.com/users/zacps/events{/privacy}","received_events_url":"https://api.github.com/users/zacps/received_events","type":"User","site_admin":false},"html_url":"https://github.com/zacps/alacritty","description":"A cross-platform, GPU-accelerated terminal emulator","fork":true,"url":"https://api.github.com/repos/zacps/alacritty","forks_url":"https://api.github.com/repos/zacps/alacritty/forks","keys_url":"https://api.github.com/repos/zacps/alacritty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zacps/alacritty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zacps/alacritty/teams","hooks_url":"https://api.github.com/repos/zacps/alacritty/hooks","issue_events_url":"https://api.github.com/repos/zacps/alacritty/issues/events{/number}","events_url":"https://api.github.com/repos/zacps/alacritty/events","assignees_url":"https://api.github.com/repos/zacps/alacritty/assignees{/user}","branches_url":"https://api.github.com/repos/zacps/alacritty/branches{/branch}","tags_url":"https://api.github.com/repos/zacps/alacritty/tags","blobs_url":"https://api.github.com/repos/zacps/alacritty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zacps/alacritty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zacps/alacritty/git/refs{/sha}","trees_url":"https://api.github.com/repos/zacps/alacritty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zacps/alacritty/statuses/{sha}","languages_url":"https://api.github.com/repos/zacps/alacritty/languages","stargazers_url":"https://api.github.com/repos/zacps/alacritty/stargazers","contributors_url":"https://api.github.com/repos/zacps/alacritty/contributors","subscribers_url":"https://api.github.com/repos/zacps/alacritty/subscribers","subscription_url":"https://api.github.com/repos/zacps/alacritty/subscription","commits_url":"https://api.github.com/repos/zacps/alacritty/commits{/sha}","git_commits_url":"https://api.github.com/repos/zacps/alacritty/git/commits{/sha}","comments_url":"https://api.github.com/repos/zacps/alacritty/comments{/number}","issue_comment_url":"https://api.github.com/repos/zacps/alacritty/issues/comments{/number}","contents_url":"https://api.github.com/repos/zacps/alacritty/contents/{+path}","compare_url":"https://api.github.com/repos/zacps/alacritty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zacps/alacritty/merges","archive_url":"https://api.github.com/repos/zacps/alacritty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zacps/alacritty/downloads","issues_url":"https://api.github.com/repos/zacps/alacritty/issues{/number}","pulls_url":"https://api.github.com/repos/zacps/alacritty/pulls{/number}","milestones_url":"https://api.github.com/repos/zacps/alacritty/milestones{/number}","notifications_url":"https://api.github.com/repos/zacps/alacritty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zacps/alacritty/labels{/name}","releases_url":"https://api.github.com/repos/zacps/alacritty/releases{/id}","deployments_url":"https://api.github.com/repos/zacps/alacritty/deployments","created_at":"2017-12-02T22:07:03Z","updated_at":"2018-10-19T05:15:51Z","pushed_at":"2018-10-29T07:52:20Z","git_url":"git://github.com/zacps/alacritty.git","ssh_url":"git@github.com:zacps/alacritty.git","clone_url":"https://github.com/zacps/alacritty.git","svn_url":"https://github.com/zacps/alacritty","homepage":"","size":23105,"stargazers_count":11,"watchers_count":11,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":1,"watchers":11,"default_branch":"master"}},"base":{"label":"jwilm:master","ref":"master","sha":"df82b5ffbdcc1cb2909f4078b435be3b46281694","user":{"login":"jwilm","id":4285147,"node_id":"MDQ6VXNlcjQyODUxNDc=","avatar_url":"https://avatars2.githubusercontent.com/u/4285147?v=4","gravatar_id":"","url":"https://api.github.com/users/jwilm","html_url":"https://github.com/jwilm","followers_url":"https://api.github.com/users/jwilm/followers","following_url":"https://api.github.com/users/jwilm/following{/other_user}","gists_url":"https://api.github.com/users/jwilm/gists{/gist_id}","starred_url":"https://api.github.com/users/jwilm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwilm/subscriptions","organizations_url":"https://api.github.com/users/jwilm/orgs","repos_url":"https://api.github.com/users/jwilm/repos","events_url":"https://api.github.com/users/jwilm/events{/privacy}","received_events_url":"https://api.github.com/users/jwilm/received_events","type":"User","site_admin":false},"repo":{"id":51980455,"node_id":"MDEwOlJlcG9zaXRvcnk1MTk4MDQ1NQ==","name":"alacritty","full_name":"jwilm/alacritty","private":false,"owner":{"login":"jwilm","id":4285147,"node_id":"MDQ6VXNlcjQyODUxNDc=","avatar_url":"https://avatars2.githubusercontent.com/u/4285147?v=4","gravatar_id":"","url":"https://api.github.com/users/jwilm","html_url":"https://github.com/jwilm","followers_url":"https://api.github.com/users/jwilm/followers","following_url":"https://api.github.com/users/jwilm/following{/other_user}","gists_url":"https://api.github.com/users/jwilm/gists{/gist_id}","starred_url":"https://api.github.com/users/jwilm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwilm/subscriptions","organizations_url":"https://api.github.com/users/jwilm/orgs","repos_url":"https://api.github.com/users/jwilm/repos","events_url":"https://api.github.com/users/jwilm/events{/privacy}","received_events_url":"https://api.github.com/users/jwilm/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jwilm/alacritty","description":"A cross-platform, GPU-accelerated terminal emulator","fork":false,"url":"https://api.github.com/repos/jwilm/alacritty","forks_url":"https://api.github.com/repos/jwilm/alacritty/forks","keys_url":"https://api.github.com/repos/jwilm/alacritty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jwilm/alacritty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jwilm/alacritty/teams","hooks_url":"https://api.github.com/repos/jwilm/alacritty/hooks","issue_events_url":"https://api.github.com/repos/jwilm/alacritty/issues/events{/number}","events_url":"https://api.github.com/repos/jwilm/alacritty/events","assignees_url":"https://api.github.com/repos/jwilm/alacritty/assignees{/user}","branches_url":"https://api.github.com/repos/jwilm/alacritty/branches{/branch}","tags_url":"https://api.github.com/repos/jwilm/alacritty/tags","blobs_url":"https://api.github.com/repos/jwilm/alacritty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jwilm/alacritty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jwilm/alacritty/git/refs{/sha}","trees_url":"https://api.github.com/repos/jwilm/alacritty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jwilm/alacritty/statuses/{sha}","languages_url":"https://api.github.com/repos/jwilm/alacritty/languages","stargazers_url":"https://api.github.com/repos/jwilm/alacritty/stargazers","contributors_url":"https://api.github.com/repos/jwilm/alacritty/contributors","subscribers_url":"https://api.github.com/repos/jwilm/alacritty/subscribers","subscription_url":"https://api.github.com/repos/jwilm/alacritty/subscription","commits_url":"https://api.github.com/repos/jwilm/alacritty/commits{/sha}","git_commits_url":"https://api.github.com/repos/jwilm/alacritty/git/commits{/sha}","comments_url":"https://api.github.com/repos/jwilm/alacritty/comments{/number}","issue_comment_url":"https://api.github.com/repos/jwilm/alacritty/issues/comments{/number}","contents_url":"https://api.github.com/repos/jwilm/alacritty/contents/{+path}","compare_url":"https://api.github.com/repos/jwilm/alacritty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jwilm/alacritty/merges","archive_url":"https://api.github.com/repos/jwilm/alacritty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jwilm/alacritty/downloads","issues_url":"https://api.github.com/repos/jwilm/alacritty/issues{/number}","pulls_url":"https://api.github.com/repos/jwilm/alacritty/pulls{/number}","milestones_url":"https://api.github.com/repos/jwilm/alacritty/milestones{/number}","notifications_url":"https://api.github.com/repos/jwilm/alacritty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jwilm/alacritty/labels{/name}","releases_url":"https://api.github.com/repos/jwilm/alacritty/releases{/id}","deployments_url":"https://api.github.com/repos/jwilm/alacritty/deployments","created_at":"2016-02-18T05:02:30Z","updated_at":"2018-10-29T15:00:01Z","pushed_at":"2018-10-29T07:52:15Z","git_url":"git://github.com/jwilm/alacritty.git","ssh_url":"git@github.com:jwilm/alacritty.git","clone_url":"https://github.com/jwilm/alacritty.git","svn_url":"https://github.com/jwilm/alacritty","homepage":"","size":4077,"stargazers_count":12795,"watchers_count":12795,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":554,"mirror_url":null,"archived":false,"open_issues_count":359,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":554,"open_issues":359,"watchers":12795,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jwilm/alacritty/pulls/1715"},"html":{"href":"https://github.com/jwilm/alacritty/pull/1715"},"issue":{"href":"https://api.github.com/repos/jwilm/alacritty/issues/1715"},"comments":{"href":"https://api.github.com/repos/jwilm/alacritty/issues/1715/comments"},"review_comments":{"href":"https://api.github.com/repos/jwilm/alacritty/pulls/1715/comments"},"review_comment":{"href":"https://api.github.com/repos/jwilm/alacritty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jwilm/alacritty/pulls/1715/commits"},"statuses":{"href":"https://api.github.com/repos/jwilm/alacritty/statuses/c1004147df85caca04c937875fefe884e72aaccc"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"chrisduerr"}}