{"action":"created","issue":{"url":"https://api.github.com/repos/martanne/vis/issues/306","repository_url":"https://api.github.com/repos/martanne/vis","labels_url":"https://api.github.com/repos/martanne/vis/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/martanne/vis/issues/306/comments","events_url":"https://api.github.com/repos/martanne/vis/issues/306/events","html_url":"https://github.com/martanne/vis/pull/306","id":153254860,"number":306,"title":"Add `vis:map_window()` command","user":{"login":"joshaw","id":3018066,"avatar_url":"https://avatars.githubusercontent.com/u/3018066?v=3","gravatar_id":"","url":"https://api.github.com/users/joshaw","html_url":"https://github.com/joshaw","followers_url":"https://api.github.com/users/joshaw/followers","following_url":"https://api.github.com/users/joshaw/following{/other_user}","gists_url":"https://api.github.com/users/joshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/joshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshaw/subscriptions","organizations_url":"https://api.github.com/users/joshaw/orgs","repos_url":"https://api.github.com/users/joshaw/repos","events_url":"https://api.github.com/users/joshaw/events{/privacy}","received_events_url":"https://api.github.com/users/joshaw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-05T15:18:56Z","updated_at":"2016-05-07T13:04:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/martanne/vis/pulls/306","html_url":"https://github.com/martanne/vis/pull/306","diff_url":"https://github.com/martanne/vis/pull/306.diff","patch_url":"https://github.com/martanne/vis/pull/306.patch"},"body":"For creating window local mappings to a lua function."},"comment":{"url":"https://api.github.com/repos/martanne/vis/issues/comments/217633863","html_url":"https://github.com/martanne/vis/pull/306#issuecomment-217633863","issue_url":"https://api.github.com/repos/martanne/vis/issues/306","id":217633863,"user":{"login":"martanne","id":5736493,"avatar_url":"https://avatars.githubusercontent.com/u/5736493?v=3","gravatar_id":"","url":"https://api.github.com/users/martanne","html_url":"https://github.com/martanne","followers_url":"https://api.github.com/users/martanne/followers","following_url":"https://api.github.com/users/martanne/following{/other_user}","gists_url":"https://api.github.com/users/martanne/gists{/gist_id}","starred_url":"https://api.github.com/users/martanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martanne/subscriptions","organizations_url":"https://api.github.com/users/martanne/orgs","repos_url":"https://api.github.com/users/martanne/repos","events_url":"https://api.github.com/users/martanne/events{/privacy}","received_events_url":"https://api.github.com/users/martanne/received_events","type":"User","site_admin":false},"created_at":"2016-05-07T13:04:10Z","updated_at":"2016-05-07T13:04:10Z","body":"With your proposal `vis:map_window(...)` would always change the mapping of the currently focused window. I'm not sure that this desirable, something like `win:map(...)` might be more appropriate?\r\n\r\nAlso your patch does not properly [unmap all prefixes](https://github.com/martanne/vis/blob/b04b66e0ab5646342241b2535768337d9d12a93a/vis-lua.c#L414) of the new mapping (see also the `cmd_map` implementation in `vis-cmds.c`, yes there should be an opportunity to share some common code...).\r\n\r\nSome slight style issues: the `lua_State` argument is generally passed as the first argument to the functions. Also `map_w` could be renamed to something slightly more descriptive."}}