{"action":"created","issue":{"url":"https://api.github.com/repos/w0rp/ale/issues/58","repository_url":"https://api.github.com/repos/w0rp/ale","labels_url":"https://api.github.com/repos/w0rp/ale/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/w0rp/ale/issues/58/comments","events_url":"https://api.github.com/repos/w0rp/ale/issues/58/events","html_url":"https://github.com/w0rp/ale/pull/58","id":181593230,"number":58,"title":"Add an initial getStatuslineStr function with customizable output","user":{"login":"KabbAmine","id":5658084,"avatar_url":"https://avatars.githubusercontent.com/u/5658084?v=3","gravatar_id":"","url":"https://api.github.com/users/KabbAmine","html_url":"https://github.com/KabbAmine","followers_url":"https://api.github.com/users/KabbAmine/followers","following_url":"https://api.github.com/users/KabbAmine/following{/other_user}","gists_url":"https://api.github.com/users/KabbAmine/gists{/gist_id}","starred_url":"https://api.github.com/users/KabbAmine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KabbAmine/subscriptions","organizations_url":"https://api.github.com/users/KabbAmine/orgs","repos_url":"https://api.github.com/users/KabbAmine/repos","events_url":"https://api.github.com/users/KabbAmine/events{/privacy}","received_events_url":"https://api.github.com/users/KabbAmine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-07T06:20:21Z","updated_at":"2016-10-07T10:22:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/w0rp/ale/pulls/58","html_url":"https://github.com/w0rp/ale/pull/58","diff_url":"https://github.com/w0rp/ale/pull/58.diff","patch_url":"https://github.com/w0rp/ale/pull/58.patch"},"body":"You can now get a formatted string to use with the statusline with `ale#sign#GetStatuslineStr()`\r\nThe default output looks like that:\r\n\r\n```vim\r\n2 error(s) 1 warning(s)\r\n```\r\n\r\n![e_a_w](https://cloud.githubusercontent.com/assets/5658084/19180416/9c018830-8c76-11e6-9a48-6fb3d63aac1a.png)\r\n\r\nNote that the string will not print errors or warnings if they're not present.\r\n\r\n```vim\r\n\" Only errors\r\n1 error(s)\r\n\" Or warnings\r\n3 warnings\r\n```\r\n\r\n![e](https://cloud.githubusercontent.com/assets/5658084/19180420/a4eefffe-8c76-11e6-8736-5cb8d4aebf78.png)\r\n![w](https://cloud.githubusercontent.com/assets/5658084/19180422/a70d81f2-8c76-11e6-8036-f2d5bc1cb5ea.png)\r\n\r\n\r\nAlso, return an empty string if no issues at all.\r\n\r\n-----------------------\r\n\r\nYou can specify the format to use using a list in `g:ale_statusline_format` where:\r\n\r\n- Both elements are strings\r\n- The 1st one is for errors and the 2nd for warnings\r\n\r\nThe default value is `['%d error(s)', '%d warning(s)']`\r\n\r\nFor example with:\r\n\r\n```vim\r\nlet g:ale_statusline_format = ['⨉ %d', '⬥ %d']\r\n```\r\n\r\n![ale](https://cloud.githubusercontent.com/assets/5658084/19180492/3d762644-8c77-11e6-86e9-dca71ac661c3.png)\r\n\r\n-----------------------\r\n\r\nIf you like my implementation, I'll update the documentation and force push. \r\nAlso, I'm not sure if the `sign.vim` file is the proper place for this function.\r\n\r\n*__N.B:__ The red color is not a part of the PR, its proper to my config*\r\n\r\n**UPDATE** Correct some typos"},"comment":{"url":"https://api.github.com/repos/w0rp/ale/issues/comments/252208757","html_url":"https://github.com/w0rp/ale/pull/58#issuecomment-252208757","issue_url":"https://api.github.com/repos/w0rp/ale/issues/58","id":252208757,"user":{"login":"KabbAmine","id":5658084,"avatar_url":"https://avatars.githubusercontent.com/u/5658084?v=3","gravatar_id":"","url":"https://api.github.com/users/KabbAmine","html_url":"https://github.com/KabbAmine","followers_url":"https://api.github.com/users/KabbAmine/followers","following_url":"https://api.github.com/users/KabbAmine/following{/other_user}","gists_url":"https://api.github.com/users/KabbAmine/gists{/gist_id}","starred_url":"https://api.github.com/users/KabbAmine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KabbAmine/subscriptions","organizations_url":"https://api.github.com/users/KabbAmine/orgs","repos_url":"https://api.github.com/users/KabbAmine/repos","events_url":"https://api.github.com/users/KabbAmine/events{/privacy}","received_events_url":"https://api.github.com/users/KabbAmine/received_events","type":"User","site_admin":false},"created_at":"2016-10-07T10:22:48Z","updated_at":"2016-10-07T10:22:48Z","body":"Changes made and force pushed.\r\n\r\n------------\r\n\r\n**BONUS**\r\n\r\nIn my config and for all the syntax checkers that I've used, I always configure the status line to show a special character for when there are no errors.\r\n\r\nCheck the following:\r\n\r\n![ale](https://cloud.githubusercontent.com/assets/5658084/19186805/125e348e-8c99-11e6-8e6e-8d6e432b1352.gif)\r\n\r\nIf you want, I can add an option for that in `g:ale_statusline_format`.\r\n\r\ne.g.\r\n```vim\r\nlet g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'ok']\r\n```\r\n\r\nFor example there is my own custom statusline function:\r\n```vim\r\nfunction! SLAle(mode) abort \" {{{1\r\n\tif !exists('*ALEGetStatusLine')\r\n\t\treturn ''\r\n\tendif\r\n\tif empty(ALEGetLinters(&ft))\r\n\t\treturn ''\r\n\tendif\r\n\tlet l:str = ALEGetStatusLine()\r\n\treturn a:mode ?\r\n\t\t\t\t\\\t(!empty(l:str) ? l:str : ''):\r\n\t\t\t\t\\\t(!empty(l:str) ? '' : '')\r\nendfunction\r\n```"}}
{"actor":{"display_login":"KabbAmine"}}