{"action":"created","comment":{"url":"https://api.github.com/repos/nilnor/howl/pulls/comments/27155348","id":27155348,"diff_hunk":"@@ -182,48 +83,147 @@ command_completer = ->\n   matcher = Matcher items\n   (text) -> matcher(text), completion_options\n \n-direct_dispatch = (cmd_string) ->\n-  return false if not cmd_string or cmd_string.is_blank\n-  cmd, cmd_name, text = parse_cmd cmd_string\n-  cmd or= resolve_command cmd_string\n-  return false unless cmd\n-  input = load_input cmd.input, text\n-  return false if input\n-  cmd!\n-  true\n-\n-run = (cmd_string = nil) ->\n-  return if direct_dispatch cmd_string\n-\n-  cmd_completer = nil\n-  state = State!\n-\n-  cmd_input =\n-    title: 'Command'\n-    should_complete: (_, readline) -> state\\should_complete readline\n-    close_on_cancel: (_, readline) -> state\\close_on_cancel readline\n-    update: (_, text, readline) -> state\\update text, readline\n-    on_selection_changed: (_, item, readline) -> state\\on_selection_changed item, readline\n-    on_completed: (_, item, readline) -> state\\on_completed item, readline\n-    on_cancelled: (_, readline) -> state\\on_cancelled readline\n-    on_submit: (_, text, readline) -> state\\on_submit text, readline\n-    go_back: (_, readline) -> state\\go_back readline\n-    keymap: state.keymap\n-\n-    complete: (_, text, readline) ->\n-      if state.cmd\n-        return state\\complete(text, readline)\n+get_command_items = ->\n+  cmd_names = names!\n+  bindings = command_bindings!\n+\n+  table.sort cmd_names\n+  items = {}\n+  for name in *cmd_names\n+    def = commands[name]\n+    desc = def.description\n+    if def.alias_for\n+      desc = \"(Alias for #{def.alias_for})\"\n+      desc = \"[deprecated] #{desc}\" if def.deprecated\n+    binding = bindings[name] or ''\n+    append items, { name, binding, desc }\n+\n+  return items\n+\n+class CommandRunner\n+  run: (@finish, opts={}) =>\n+    @command_line = howl.app.window.command_line\n+    cmd = nil\n+    cmdname = ''","path":"lib/howl/command.moon","position":204,"original_position":204,"commit_id":"9df616b4cbbabc90635c84b4c20a69f68dc4641d","original_commit_id":"9df616b4cbbabc90635c84b4c20a69f68dc4641d","user":{"login":"nilnor","id":263135,"avatar_url":"https://avatars.githubusercontent.com/u/263135?v=3","gravatar_id":"","url":"https://api.github.com/users/nilnor","html_url":"https://github.com/nilnor","followers_url":"https://api.github.com/users/nilnor/followers","following_url":"https://api.github.com/users/nilnor/following{/other_user}","gists_url":"https://api.github.com/users/nilnor/gists{/gist_id}","starred_url":"https://api.github.com/users/nilnor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilnor/subscriptions","organizations_url":"https://api.github.com/users/nilnor/orgs","repos_url":"https://api.github.com/users/nilnor/repos","events_url":"https://api.github.com/users/nilnor/events{/privacy}","received_events_url":"https://api.github.com/users/nilnor/received_events","type":"User","site_admin":false},"body":"Snake case here as well, `cmd_name`.","created_at":"2015-03-25T19:10:40Z","updated_at":"2015-03-25T19:10:40Z","html_url":"https://github.com/nilnor/howl/pull/44#discussion_r27155348","pull_request_url":"https://api.github.com/repos/nilnor/howl/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/nilnor/howl/pulls/comments/27155348"},"html":{"href":"https://github.com/nilnor/howl/pull/44#discussion_r27155348"},"pull_request":{"href":"https://api.github.com/repos/nilnor/howl/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/nilnor/howl/pulls/44","id":31365865,"html_url":"https://github.com/nilnor/howl/pull/44","diff_url":"https://github.com/nilnor/howl/pull/44.diff","patch_url":"https://github.com/nilnor/howl/pull/44.patch","issue_url":"https://api.github.com/repos/nilnor/howl/issues/44","number":44,"state":"open","locked":false,"title":"Interactions system.","user":{"login":"shalabhc","id":7066873,"avatar_url":"https://avatars.githubusercontent.com/u/7066873?v=3","gravatar_id":"","url":"https://api.github.com/users/shalabhc","html_url":"https://github.com/shalabhc","followers_url":"https://api.github.com/users/shalabhc/followers","following_url":"https://api.github.com/users/shalabhc/following{/other_user}","gists_url":"https://api.github.com/users/shalabhc/gists{/gist_id}","starred_url":"https://api.github.com/users/shalabhc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shalabhc/subscriptions","organizations_url":"https://api.github.com/users/shalabhc/orgs","repos_url":"https://api.github.com/users/shalabhc/repos","events_url":"https://api.github.com/users/shalabhc/events{/privacy}","received_events_url":"https://api.github.com/users/shalabhc/received_events","type":"User","site_admin":false},"body":"Replace the readline and inputs with a redesigned command_line and\r\ninteractions system.","created_at":"2015-03-17T18:49:55Z","updated_at":"2015-03-25T19:10:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"358407ff3f0eb2ca92584d43c2e4da8401d1913d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nilnor/howl/pulls/44/commits","review_comments_url":"https://api.github.com/repos/nilnor/howl/pulls/44/comments","review_comment_url":"https://api.github.com/repos/nilnor/howl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nilnor/howl/issues/44/comments","statuses_url":"https://api.github.com/repos/nilnor/howl/statuses/9df616b4cbbabc90635c84b4c20a69f68dc4641d","head":{"label":"shalabhc:interactions-rollup","ref":"interactions-rollup","sha":"9df616b4cbbabc90635c84b4c20a69f68dc4641d","user":{"login":"shalabhc","id":7066873,"avatar_url":"https://avatars.githubusercontent.com/u/7066873?v=3","gravatar_id":"","url":"https://api.github.com/users/shalabhc","html_url":"https://github.com/shalabhc","followers_url":"https://api.github.com/users/shalabhc/followers","following_url":"https://api.github.com/users/shalabhc/following{/other_user}","gists_url":"https://api.github.com/users/shalabhc/gists{/gist_id}","starred_url":"https://api.github.com/users/shalabhc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shalabhc/subscriptions","organizations_url":"https://api.github.com/users/shalabhc/orgs","repos_url":"https://api.github.com/users/shalabhc/repos","events_url":"https://api.github.com/users/shalabhc/events{/privacy}","received_events_url":"https://api.github.com/users/shalabhc/received_events","type":"User","site_admin":false},"repo":{"id":18130334,"name":"howl","full_name":"shalabhc/howl","owner":{"login":"shalabhc","id":7066873,"avatar_url":"https://avatars.githubusercontent.com/u/7066873?v=3","gravatar_id":"","url":"https://api.github.com/users/shalabhc","html_url":"https://github.com/shalabhc","followers_url":"https://api.github.com/users/shalabhc/followers","following_url":"https://api.github.com/users/shalabhc/following{/other_user}","gists_url":"https://api.github.com/users/shalabhc/gists{/gist_id}","starred_url":"https://api.github.com/users/shalabhc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shalabhc/subscriptions","organizations_url":"https://api.github.com/users/shalabhc/orgs","repos_url":"https://api.github.com/users/shalabhc/repos","events_url":"https://api.github.com/users/shalabhc/events{/privacy}","received_events_url":"https://api.github.com/users/shalabhc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shalabhc/howl","description":"The Howl Editor","fork":true,"url":"https://api.github.com/repos/shalabhc/howl","forks_url":"https://api.github.com/repos/shalabhc/howl/forks","keys_url":"https://api.github.com/repos/shalabhc/howl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shalabhc/howl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shalabhc/howl/teams","hooks_url":"https://api.github.com/repos/shalabhc/howl/hooks","issue_events_url":"https://api.github.com/repos/shalabhc/howl/issues/events{/number}","events_url":"https://api.github.com/repos/shalabhc/howl/events","assignees_url":"https://api.github.com/repos/shalabhc/howl/assignees{/user}","branches_url":"https://api.github.com/repos/shalabhc/howl/branches{/branch}","tags_url":"https://api.github.com/repos/shalabhc/howl/tags","blobs_url":"https://api.github.com/repos/shalabhc/howl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shalabhc/howl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shalabhc/howl/git/refs{/sha}","trees_url":"https://api.github.com/repos/shalabhc/howl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shalabhc/howl/statuses/{sha}","languages_url":"https://api.github.com/repos/shalabhc/howl/languages","stargazers_url":"https://api.github.com/repos/shalabhc/howl/stargazers","contributors_url":"https://api.github.com/repos/shalabhc/howl/contributors","subscribers_url":"https://api.github.com/repos/shalabhc/howl/subscribers","subscription_url":"https://api.github.com/repos/shalabhc/howl/subscription","commits_url":"https://api.github.com/repos/shalabhc/howl/commits{/sha}","git_commits_url":"https://api.github.com/repos/shalabhc/howl/git/commits{/sha}","comments_url":"https://api.github.com/repos/shalabhc/howl/comments{/number}","issue_comment_url":"https://api.github.com/repos/shalabhc/howl/issues/comments{/number}","contents_url":"https://api.github.com/repos/shalabhc/howl/contents/{+path}","compare_url":"https://api.github.com/repos/shalabhc/howl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shalabhc/howl/merges","archive_url":"https://api.github.com/repos/shalabhc/howl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shalabhc/howl/downloads","issues_url":"https://api.github.com/repos/shalabhc/howl/issues{/number}","pulls_url":"https://api.github.com/repos/shalabhc/howl/pulls{/number}","milestones_url":"https://api.github.com/repos/shalabhc/howl/milestones{/number}","notifications_url":"https://api.github.com/repos/shalabhc/howl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shalabhc/howl/labels{/name}","releases_url":"https://api.github.com/repos/shalabhc/howl/releases{/id}","created_at":"2014-03-26T07:42:29Z","updated_at":"2015-02-25T01:39:19Z","pushed_at":"2015-03-25T03:55:44Z","git_url":"git://github.com/shalabhc/howl.git","ssh_url":"git@github.com:shalabhc/howl.git","clone_url":"https://github.com/shalabhc/howl.git","svn_url":"https://github.com/shalabhc/howl","homepage":"http://howl.io","size":9014,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"nilnor:master","ref":"master","sha":"a22e26766bfa8a4229099e0286c0baa3947f8e8c","user":{"login":"nilnor","id":263135,"avatar_url":"https://avatars.githubusercontent.com/u/263135?v=3","gravatar_id":"","url":"https://api.github.com/users/nilnor","html_url":"https://github.com/nilnor","followers_url":"https://api.github.com/users/nilnor/followers","following_url":"https://api.github.com/users/nilnor/following{/other_user}","gists_url":"https://api.github.com/users/nilnor/gists{/gist_id}","starred_url":"https://api.github.com/users/nilnor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilnor/subscriptions","organizations_url":"https://api.github.com/users/nilnor/orgs","repos_url":"https://api.github.com/users/nilnor/repos","events_url":"https://api.github.com/users/nilnor/events{/privacy}","received_events_url":"https://api.github.com/users/nilnor/received_events","type":"User","site_admin":false},"repo":{"id":14235156,"name":"howl","full_name":"nilnor/howl","owner":{"login":"nilnor","id":263135,"avatar_url":"https://avatars.githubusercontent.com/u/263135?v=3","gravatar_id":"","url":"https://api.github.com/users/nilnor","html_url":"https://github.com/nilnor","followers_url":"https://api.github.com/users/nilnor/followers","following_url":"https://api.github.com/users/nilnor/following{/other_user}","gists_url":"https://api.github.com/users/nilnor/gists{/gist_id}","starred_url":"https://api.github.com/users/nilnor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilnor/subscriptions","organizations_url":"https://api.github.com/users/nilnor/orgs","repos_url":"https://api.github.com/users/nilnor/repos","events_url":"https://api.github.com/users/nilnor/events{/privacy}","received_events_url":"https://api.github.com/users/nilnor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nilnor/howl","description":"The Howl Editor","fork":false,"url":"https://api.github.com/repos/nilnor/howl","forks_url":"https://api.github.com/repos/nilnor/howl/forks","keys_url":"https://api.github.com/repos/nilnor/howl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nilnor/howl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nilnor/howl/teams","hooks_url":"https://api.github.com/repos/nilnor/howl/hooks","issue_events_url":"https://api.github.com/repos/nilnor/howl/issues/events{/number}","events_url":"https://api.github.com/repos/nilnor/howl/events","assignees_url":"https://api.github.com/repos/nilnor/howl/assignees{/user}","branches_url":"https://api.github.com/repos/nilnor/howl/branches{/branch}","tags_url":"https://api.github.com/repos/nilnor/howl/tags","blobs_url":"https://api.github.com/repos/nilnor/howl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nilnor/howl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nilnor/howl/git/refs{/sha}","trees_url":"https://api.github.com/repos/nilnor/howl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nilnor/howl/statuses/{sha}","languages_url":"https://api.github.com/repos/nilnor/howl/languages","stargazers_url":"https://api.github.com/repos/nilnor/howl/stargazers","contributors_url":"https://api.github.com/repos/nilnor/howl/contributors","subscribers_url":"https://api.github.com/repos/nilnor/howl/subscribers","subscription_url":"https://api.github.com/repos/nilnor/howl/subscription","commits_url":"https://api.github.com/repos/nilnor/howl/commits{/sha}","git_commits_url":"https://api.github.com/repos/nilnor/howl/git/commits{/sha}","comments_url":"https://api.github.com/repos/nilnor/howl/comments{/number}","issue_comment_url":"https://api.github.com/repos/nilnor/howl/issues/comments{/number}","contents_url":"https://api.github.com/repos/nilnor/howl/contents/{+path}","compare_url":"https://api.github.com/repos/nilnor/howl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nilnor/howl/merges","archive_url":"https://api.github.com/repos/nilnor/howl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nilnor/howl/downloads","issues_url":"https://api.github.com/repos/nilnor/howl/issues{/number}","pulls_url":"https://api.github.com/repos/nilnor/howl/pulls{/number}","milestones_url":"https://api.github.com/repos/nilnor/howl/milestones{/number}","notifications_url":"https://api.github.com/repos/nilnor/howl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nilnor/howl/labels{/name}","releases_url":"https://api.github.com/repos/nilnor/howl/releases{/id}","created_at":"2013-11-08T14:38:11Z","updated_at":"2015-03-24T20:12:35Z","pushed_at":"2015-03-25T04:00:09Z","git_url":"git://github.com/nilnor/howl.git","ssh_url":"git@github.com:nilnor/howl.git","clone_url":"https://github.com/nilnor/howl.git","svn_url":"https://github.com/nilnor/howl","homepage":"http://howl.io","size":10415,"stargazers_count":36,"watchers_count":36,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nilnor/howl/pulls/44"},"html":{"href":"https://github.com/nilnor/howl/pull/44"},"issue":{"href":"https://api.github.com/repos/nilnor/howl/issues/44"},"comments":{"href":"https://api.github.com/repos/nilnor/howl/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/nilnor/howl/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/nilnor/howl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nilnor/howl/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/nilnor/howl/statuses/9df616b4cbbabc90635c84b4c20a69f68dc4641d"}}}}