{"action":"created","comment":{"url":"https://api.github.com/repos/slap-editor/slap/pulls/comments/32992283","id":32992283,"diff_hunk":"@@ -621,6 +627,16 @@ Editor.prototype._updateCursor = function () {\n     self.screen.program.hideCursor();\n   }\n };\n+Editor.prototype._clipCursorToContent = function (cursor) {\n+  var self = this;\n+  var linesCount = self.textBuf.getLastRow();\n+  var lineLength = self.textBuf.lineLengthForRow(cursor.y);","path":"lib/ui/Editor.js","position":36,"original_position":36,"commit_id":"f1d61164b9e7820624791b0705ec5fe6c3485dbb","original_commit_id":"f1d61164b9e7820624791b0705ec5fe6c3485dbb","user":{"login":"mjurczyk","id":9549760,"avatar_url":"https://avatars.githubusercontent.com/u/9549760?v=3","gravatar_id":"","url":"https://api.github.com/users/mjurczyk","html_url":"https://github.com/mjurczyk","followers_url":"https://api.github.com/users/mjurczyk/followers","following_url":"https://api.github.com/users/mjurczyk/following{/other_user}","gists_url":"https://api.github.com/users/mjurczyk/gists{/gist_id}","starred_url":"https://api.github.com/users/mjurczyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjurczyk/subscriptions","organizations_url":"https://api.github.com/users/mjurczyk/orgs","repos_url":"https://api.github.com/users/mjurczyk/repos","events_url":"https://api.github.com/users/mjurczyk/events{/privacy}","received_events_url":"https://api.github.com/users/mjurczyk/received_events","type":"User","site_admin":false},"body":"Yes it does, still coords [ -1 -1 ], out of bounds, etc are invalid imho.","created_at":"2015-06-22T22:38:48Z","updated_at":"2015-06-22T22:38:48Z","html_url":"https://github.com/slap-editor/slap/pull/167#discussion_r32992283","pull_request_url":"https://api.github.com/repos/slap-editor/slap/pulls/167","_links":{"self":{"href":"https://api.github.com/repos/slap-editor/slap/pulls/comments/32992283"},"html":{"href":"https://github.com/slap-editor/slap/pull/167#discussion_r32992283"},"pull_request":{"href":"https://api.github.com/repos/slap-editor/slap/pulls/167"}}},"pull_request":{"url":"https://api.github.com/repos/slap-editor/slap/pulls/167","id":37508103,"html_url":"https://github.com/slap-editor/slap/pull/167","diff_url":"https://github.com/slap-editor/slap/pull/167.diff","patch_url":"https://github.com/slap-editor/slap/pull/167.patch","issue_url":"https://api.github.com/repos/slap-editor/slap/issues/167","number":167,"state":"open","locked":false,"title":"Feature: CLI to line number","user":{"login":"mjurczyk","id":9549760,"avatar_url":"https://avatars.githubusercontent.com/u/9549760?v=3","gravatar_id":"","url":"https://api.github.com/users/mjurczyk","html_url":"https://github.com/mjurczyk","followers_url":"https://api.github.com/users/mjurczyk/followers","following_url":"https://api.github.com/users/mjurczyk/following{/other_user}","gists_url":"https://api.github.com/users/mjurczyk/gists{/gist_id}","starred_url":"https://api.github.com/users/mjurczyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjurczyk/subscriptions","organizations_url":"https://api.github.com/users/mjurczyk/orgs","repos_url":"https://api.github.com/users/mjurczyk/repos","events_url":"https://api.github.com/users/mjurczyk/events{/privacy}","received_events_url":"https://api.github.com/users/mjurczyk/received_events","type":"User","site_admin":false},"body":"## Init `slap` on a specific line in a file\r\n\r\nWhile working today with `slap` I have noticed that it might be exceptionally useful to be able to open file at an exact line/char with slap. Node and npm usually deliver error messages in a form:\r\n\r\n```\r\nstack: What a Terrible Failure: I told you undefined wasn't a function ...\r\n   at /Users/mjurczyk/Project/index.js:220:68\r\n   at processImmediate [as _immediateCallback] (timers.js:371:17)\r\n```\r\n\r\nAs a user I would love to be able to just copy the file path from the error message, paste it into terminal and slap the bug in the face.\r\n\r\n### Usage\r\nTo open a file on line 21 and character 2:\r\n`slap ./file.js:21:2`\r\n\r\nCharacter parameter is optional:\r\n`slap ./file.js:108`\r\n\r\n### Behaviour\r\n\r\n* Default cursor position is 1, 1 in top left corner\r\n* Clip cursor to the file content\r\n* Reset selection's tail\r\n* Skip for empty/new files","created_at":"2015-06-11T21:00:24Z","updated_at":"2015-06-22T22:38:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d412a449d436e73937caa90710d7bfd8c00bb2b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/slap-editor/slap/pulls/167/commits","review_comments_url":"https://api.github.com/repos/slap-editor/slap/pulls/167/comments","review_comment_url":"https://api.github.com/repos/slap-editor/slap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slap-editor/slap/issues/167/comments","statuses_url":"https://api.github.com/repos/slap-editor/slap/statuses/f1d61164b9e7820624791b0705ec5fe6c3485dbb","head":{"label":"mjurczyk:feature-cli-at-line","ref":"feature-cli-at-line","sha":"f1d61164b9e7820624791b0705ec5fe6c3485dbb","user":{"login":"mjurczyk","id":9549760,"avatar_url":"https://avatars.githubusercontent.com/u/9549760?v=3","gravatar_id":"","url":"https://api.github.com/users/mjurczyk","html_url":"https://github.com/mjurczyk","followers_url":"https://api.github.com/users/mjurczyk/followers","following_url":"https://api.github.com/users/mjurczyk/following{/other_user}","gists_url":"https://api.github.com/users/mjurczyk/gists{/gist_id}","starred_url":"https://api.github.com/users/mjurczyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjurczyk/subscriptions","organizations_url":"https://api.github.com/users/mjurczyk/orgs","repos_url":"https://api.github.com/users/mjurczyk/repos","events_url":"https://api.github.com/users/mjurczyk/events{/privacy}","received_events_url":"https://api.github.com/users/mjurczyk/received_events","type":"User","site_admin":false},"repo":{"id":37254858,"name":"slap","full_name":"mjurczyk/slap","owner":{"login":"mjurczyk","id":9549760,"avatar_url":"https://avatars.githubusercontent.com/u/9549760?v=3","gravatar_id":"","url":"https://api.github.com/users/mjurczyk","html_url":"https://github.com/mjurczyk","followers_url":"https://api.github.com/users/mjurczyk/followers","following_url":"https://api.github.com/users/mjurczyk/following{/other_user}","gists_url":"https://api.github.com/users/mjurczyk/gists{/gist_id}","starred_url":"https://api.github.com/users/mjurczyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjurczyk/subscriptions","organizations_url":"https://api.github.com/users/mjurczyk/orgs","repos_url":"https://api.github.com/users/mjurczyk/repos","events_url":"https://api.github.com/users/mjurczyk/events{/privacy}","received_events_url":"https://api.github.com/users/mjurczyk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mjurczyk/slap","description":"Sublime-like terminal-based text editor","fork":true,"url":"https://api.github.com/repos/mjurczyk/slap","forks_url":"https://api.github.com/repos/mjurczyk/slap/forks","keys_url":"https://api.github.com/repos/mjurczyk/slap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjurczyk/slap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjurczyk/slap/teams","hooks_url":"https://api.github.com/repos/mjurczyk/slap/hooks","issue_events_url":"https://api.github.com/repos/mjurczyk/slap/issues/events{/number}","events_url":"https://api.github.com/repos/mjurczyk/slap/events","assignees_url":"https://api.github.com/repos/mjurczyk/slap/assignees{/user}","branches_url":"https://api.github.com/repos/mjurczyk/slap/branches{/branch}","tags_url":"https://api.github.com/repos/mjurczyk/slap/tags","blobs_url":"https://api.github.com/repos/mjurczyk/slap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjurczyk/slap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjurczyk/slap/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjurczyk/slap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjurczyk/slap/statuses/{sha}","languages_url":"https://api.github.com/repos/mjurczyk/slap/languages","stargazers_url":"https://api.github.com/repos/mjurczyk/slap/stargazers","contributors_url":"https://api.github.com/repos/mjurczyk/slap/contributors","subscribers_url":"https://api.github.com/repos/mjurczyk/slap/subscribers","subscription_url":"https://api.github.com/repos/mjurczyk/slap/subscription","commits_url":"https://api.github.com/repos/mjurczyk/slap/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjurczyk/slap/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjurczyk/slap/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjurczyk/slap/issues/comments{/number}","contents_url":"https://api.github.com/repos/mjurczyk/slap/contents/{+path}","compare_url":"https://api.github.com/repos/mjurczyk/slap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjurczyk/slap/merges","archive_url":"https://api.github.com/repos/mjurczyk/slap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjurczyk/slap/downloads","issues_url":"https://api.github.com/repos/mjurczyk/slap/issues{/number}","pulls_url":"https://api.github.com/repos/mjurczyk/slap/pulls{/number}","milestones_url":"https://api.github.com/repos/mjurczyk/slap/milestones{/number}","notifications_url":"https://api.github.com/repos/mjurczyk/slap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjurczyk/slap/labels{/name}","releases_url":"https://api.github.com/repos/mjurczyk/slap/releases{/id}","created_at":"2015-06-11T10:33:09Z","updated_at":"2015-06-11T10:33:09Z","pushed_at":"2015-06-22T19:27:05Z","git_url":"git://github.com/mjurczyk/slap.git","ssh_url":"git@github.com:mjurczyk/slap.git","clone_url":"https://github.com/mjurczyk/slap.git","svn_url":"https://github.com/mjurczyk/slap","homepage":"","size":689,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"slap-editor:master","ref":"master","sha":"2f65ebdb7a72ca2ab45d07ba31ee754ce513a483","user":{"login":"slap-editor","id":7591891,"avatar_url":"https://avatars.githubusercontent.com/u/7591891?v=3","gravatar_id":"","url":"https://api.github.com/users/slap-editor","html_url":"https://github.com/slap-editor","followers_url":"https://api.github.com/users/slap-editor/followers","following_url":"https://api.github.com/users/slap-editor/following{/other_user}","gists_url":"https://api.github.com/users/slap-editor/gists{/gist_id}","starred_url":"https://api.github.com/users/slap-editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slap-editor/subscriptions","organizations_url":"https://api.github.com/users/slap-editor/orgs","repos_url":"https://api.github.com/users/slap-editor/repos","events_url":"https://api.github.com/users/slap-editor/events{/privacy}","received_events_url":"https://api.github.com/users/slap-editor/received_events","type":"Organization","site_admin":false},"repo":{"id":18981255,"name":"slap","full_name":"slap-editor/slap","owner":{"login":"slap-editor","id":7591891,"avatar_url":"https://avatars.githubusercontent.com/u/7591891?v=3","gravatar_id":"","url":"https://api.github.com/users/slap-editor","html_url":"https://github.com/slap-editor","followers_url":"https://api.github.com/users/slap-editor/followers","following_url":"https://api.github.com/users/slap-editor/following{/other_user}","gists_url":"https://api.github.com/users/slap-editor/gists{/gist_id}","starred_url":"https://api.github.com/users/slap-editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slap-editor/subscriptions","organizations_url":"https://api.github.com/users/slap-editor/orgs","repos_url":"https://api.github.com/users/slap-editor/repos","events_url":"https://api.github.com/users/slap-editor/events{/privacy}","received_events_url":"https://api.github.com/users/slap-editor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slap-editor/slap","description":"Sublime-like terminal-based text editor","fork":false,"url":"https://api.github.com/repos/slap-editor/slap","forks_url":"https://api.github.com/repos/slap-editor/slap/forks","keys_url":"https://api.github.com/repos/slap-editor/slap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slap-editor/slap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slap-editor/slap/teams","hooks_url":"https://api.github.com/repos/slap-editor/slap/hooks","issue_events_url":"https://api.github.com/repos/slap-editor/slap/issues/events{/number}","events_url":"https://api.github.com/repos/slap-editor/slap/events","assignees_url":"https://api.github.com/repos/slap-editor/slap/assignees{/user}","branches_url":"https://api.github.com/repos/slap-editor/slap/branches{/branch}","tags_url":"https://api.github.com/repos/slap-editor/slap/tags","blobs_url":"https://api.github.com/repos/slap-editor/slap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slap-editor/slap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slap-editor/slap/git/refs{/sha}","trees_url":"https://api.github.com/repos/slap-editor/slap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slap-editor/slap/statuses/{sha}","languages_url":"https://api.github.com/repos/slap-editor/slap/languages","stargazers_url":"https://api.github.com/repos/slap-editor/slap/stargazers","contributors_url":"https://api.github.com/repos/slap-editor/slap/contributors","subscribers_url":"https://api.github.com/repos/slap-editor/slap/subscribers","subscription_url":"https://api.github.com/repos/slap-editor/slap/subscription","commits_url":"https://api.github.com/repos/slap-editor/slap/commits{/sha}","git_commits_url":"https://api.github.com/repos/slap-editor/slap/git/commits{/sha}","comments_url":"https://api.github.com/repos/slap-editor/slap/comments{/number}","issue_comment_url":"https://api.github.com/repos/slap-editor/slap/issues/comments{/number}","contents_url":"https://api.github.com/repos/slap-editor/slap/contents/{+path}","compare_url":"https://api.github.com/repos/slap-editor/slap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slap-editor/slap/merges","archive_url":"https://api.github.com/repos/slap-editor/slap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slap-editor/slap/downloads","issues_url":"https://api.github.com/repos/slap-editor/slap/issues{/number}","pulls_url":"https://api.github.com/repos/slap-editor/slap/pulls{/number}","milestones_url":"https://api.github.com/repos/slap-editor/slap/milestones{/number}","notifications_url":"https://api.github.com/repos/slap-editor/slap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slap-editor/slap/labels{/name}","releases_url":"https://api.github.com/repos/slap-editor/slap/releases{/id}","created_at":"2014-04-21T03:39:14Z","updated_at":"2015-06-22T14:30:03Z","pushed_at":"2015-06-22T19:27:06Z","git_url":"git://github.com/slap-editor/slap.git","ssh_url":"git@github.com:slap-editor/slap.git","clone_url":"https://github.com/slap-editor/slap.git","svn_url":"https://github.com/slap-editor/slap","homepage":"","size":2386,"stargazers_count":2439,"watchers_count":2439,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":95,"mirror_url":null,"open_issues_count":70,"forks":95,"open_issues":70,"watchers":2439,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slap-editor/slap/pulls/167"},"html":{"href":"https://github.com/slap-editor/slap/pull/167"},"issue":{"href":"https://api.github.com/repos/slap-editor/slap/issues/167"},"comments":{"href":"https://api.github.com/repos/slap-editor/slap/issues/167/comments"},"review_comments":{"href":"https://api.github.com/repos/slap-editor/slap/pulls/167/comments"},"review_comment":{"href":"https://api.github.com/repos/slap-editor/slap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slap-editor/slap/pulls/167/commits"},"statuses":{"href":"https://api.github.com/repos/slap-editor/slap/statuses/f1d61164b9e7820624791b0705ec5fe6c3485dbb"}}}}