{"action":"created","issue":{"url":"https://api.github.com/repos/Shougo/denite.nvim/issues/270","repository_url":"https://api.github.com/repos/Shougo/denite.nvim","labels_url":"https://api.github.com/repos/Shougo/denite.nvim/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/Shougo/denite.nvim/issues/270/comments","events_url":"https://api.github.com/repos/Shougo/denite.nvim/issues/270/events","html_url":"https://github.com/Shougo/denite.nvim/issues/270","id":226736971,"number":270,"title":"Define custom action","user":{"login":"petobens","id":2583971,"avatar_url":"https://avatars1.githubusercontent.com/u/2583971?v=3","gravatar_id":"","url":"https://api.github.com/users/petobens","html_url":"https://github.com/petobens","followers_url":"https://api.github.com/users/petobens/followers","following_url":"https://api.github.com/users/petobens/following{/other_user}","gists_url":"https://api.github.com/users/petobens/gists{/gist_id}","starred_url":"https://api.github.com/users/petobens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petobens/subscriptions","organizations_url":"https://api.github.com/users/petobens/orgs","repos_url":"https://api.github.com/users/petobens/repos","events_url":"https://api.github.com/users/petobens/events{/privacy}","received_events_url":"https://api.github.com/users/petobens/received_events","type":"User","site_admin":false},"labels":[{"id":326621689,"url":"https://api.github.com/repos/Shougo/denite.nvim/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2017-05-06T04:13:35Z","updated_at":"2017-07-03T03:14:38Z","closed_at":"2017-07-02T09:22:19Z","body":"With Unite I use:\r\n```vim\r\n\" Custom split action\r\nlet s:my_split = {'is_selectable': 1}\r\nfunction! s:my_split.func(candidate)\r\n    let split_action = 'vsplit'\r\n    if winwidth(winnr('#')) <= 2 * (&tw ? &tw : 80)\r\n        let split_action = 'split'\r\n    endif\r\n    call unite#take_action(split_action, a:candidate)\r\nendfunction\r\ncall unite#custom_action('openable', 'context_split', s:my_split)\r\nunlet s:my_split\r\n```\r\nand then define mappings that include `-default-action=context_split`.\r\nCan this be done with Denite? (I've read https://github.com/Shougo/denite.nvim/issues/156 but since that issue was closed I was wondering if this was/will be implemented)."},"comment":{"url":"https://api.github.com/repos/Shougo/denite.nvim/issues/comments/312540455","html_url":"https://github.com/Shougo/denite.nvim/issues/270#issuecomment-312540455","issue_url":"https://api.github.com/repos/Shougo/denite.nvim/issues/270","id":312540455,"user":{"login":"petobens","id":2583971,"avatar_url":"https://avatars1.githubusercontent.com/u/2583971?v=3","gravatar_id":"","url":"https://api.github.com/users/petobens","html_url":"https://github.com/petobens","followers_url":"https://api.github.com/users/petobens/followers","following_url":"https://api.github.com/users/petobens/following{/other_user}","gists_url":"https://api.github.com/users/petobens/gists{/gist_id}","starred_url":"https://api.github.com/users/petobens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petobens/subscriptions","organizations_url":"https://api.github.com/users/petobens/orgs","repos_url":"https://api.github.com/users/petobens/repos","events_url":"https://api.github.com/users/petobens/events{/privacy}","received_events_url":"https://api.github.com/users/petobens/received_events","type":"User","site_admin":false},"created_at":"2017-07-03T03:14:38Z","updated_at":"2017-07-03T03:14:38Z","body":"Mmm almost there but:\r\n```\r\n[denite] neovim.api.nvim.NvimError: b\"Vim(if):E716: Key not present in Dictionary: kind ==# 'buffer'\"\r\n```\r\nIsn't it better to implement a `take_action` function? (it would avoid using the conditional and the dictionary indexing)"}}
{"actor":{"display_login":"petobens"}}