{"action":"created","issue":{"url":"https://api.github.com/repos/neovim/neovim/issues/5713","repository_url":"https://api.github.com/repos/neovim/neovim","labels_url":"https://api.github.com/repos/neovim/neovim/issues/5713/labels{/name}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/5713/comments","events_url":"https://api.github.com/repos/neovim/neovim/issues/5713/events","html_url":"https://github.com/neovim/neovim/issues/5713","id":193308271,"number":5713,"title":"setpos() ignores \"bufnum\" argument if {expr} is a lowercase mark","user":{"login":"hardenedapple","id":4070620,"avatar_url":"https://avatars.githubusercontent.com/u/4070620?v=3","gravatar_id":"","url":"https://api.github.com/users/hardenedapple","html_url":"https://github.com/hardenedapple","followers_url":"https://api.github.com/users/hardenedapple/followers","following_url":"https://api.github.com/users/hardenedapple/following{/other_user}","gists_url":"https://api.github.com/users/hardenedapple/gists{/gist_id}","starred_url":"https://api.github.com/users/hardenedapple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardenedapple/subscriptions","organizations_url":"https://api.github.com/users/hardenedapple/orgs","repos_url":"https://api.github.com/users/hardenedapple/repos","events_url":"https://api.github.com/users/hardenedapple/events{/privacy}","received_events_url":"https://api.github.com/users/hardenedapple/received_events","type":"User","site_admin":false},"labels":[{"id":154310492,"url":"https://api.github.com/repos/neovim/neovim/labels/bug-vim","name":"bug-vim","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/neovim/neovim/milestones/6","html_url":"https://github.com/neovim/neovim/milestones/todo","labels_url":"https://api.github.com/repos/neovim/neovim/milestones/6/labels","id":655037,"number":6,"title":"todo","description":"These items are *definitely not* planned for the *current* target, but *may* be given priority for a future target. Y'know, like todo.txt ;)","creator":{"login":"justinmk","id":1359421,"avatar_url":"https://avatars.githubusercontent.com/u/1359421?v=3","gravatar_id":"","url":"https://api.github.com/users/justinmk","html_url":"https://github.com/justinmk","followers_url":"https://api.github.com/users/justinmk/followers","following_url":"https://api.github.com/users/justinmk/following{/other_user}","gists_url":"https://api.github.com/users/justinmk/gists{/gist_id}","starred_url":"https://api.github.com/users/justinmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinmk/subscriptions","organizations_url":"https://api.github.com/users/justinmk/orgs","repos_url":"https://api.github.com/users/justinmk/repos","events_url":"https://api.github.com/users/justinmk/events{/privacy}","received_events_url":"https://api.github.com/users/justinmk/received_events","type":"User","site_admin":false},"open_issues":165,"closed_issues":63,"state":"open","created_at":"2014-05-10T20:43:04Z","updated_at":"2016-12-05T11:42:18Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-12-03T19:21:41Z","updated_at":"2016-12-06T12:17:15Z","closed_at":null,"body":"`:help setpos()` mentions an argument `\"bufnum\"` that determines the buffer a mark should be put in.\r\nThis argument is respected for uppercase marks, but not for lowercase marks.\r\nThis is reasonable (though I personally would like `setpos()` to be able to set marks in other buffers), but the help doesn't mention this anywhere.\r\n\r\nIt's also strange that attempting to change buffers with `setpos('.', [bufnr('#'), 1, 1, 0])` alerts the user that having a different buffer is an error, while attempting to set a mark with `setpos(\"'d\", [bufnr('#'), 1, 1, 0])` doesn't tell the user that the `\"bufnum\"` argument is an error.\r\n\r\n### Demonstration of the behaviour.\r\nWith the files\r\n`test.txt`\r\n```\r\nFirst line of test.txt\r\nSome filler words\r\n```\r\n\r\n`test2.txt`\r\n```\r\nFirst line of test2.txt\r\nThese are some words\r\n```\r\n\r\n`nvim -u NONE test.txt test2.txt`\r\n```\r\nbufdo 1mark d\r\ncall setpos(\"'d\", [1, 2, 0, 0])\r\n```\r\nobserve that the mark `'d` in the current buffer (`test2.txt`) is on the second line, while mark `'d` in the first buffer (`test.txt`) is still on the first line.\r\n\r\n\r\n\r\n### Suggestion\r\n\r\nI think that either `:help setpos()` should mention this (see the diff below), or it should allow setting the mark in a different buffer.\r\n\r\n```diff\r\ndiff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt\r\nindex 9c6cbd5..0870f08 100644\r\n--- a/runtime/doc/eval.txt\r\n+++ b/runtime/doc/eval.txt\r\n@@ -6098,7 +6098,8 @@ setpos({expr}, {list})\r\n \t\tcurrent buffer.  Setting the cursor is only possible for\r\n \t\tthe current buffer.  To set a mark in another buffer you can\r\n \t\tuse the |bufnr()| function to turn a file name into a buffer\r\n-\t\tnumber.\r\n+\t\tnumber. If {expr} is a lowercase mark the current buffer is\r\n+\t\talways used.\r\n \t\tDoes not change the jumplist.\r\n \r\n \t\t\"lnum\" and \"col\" are the position in the buffer.  The first\r\n```"},"comment":{"url":"https://api.github.com/repos/neovim/neovim/issues/comments/265136186","html_url":"https://github.com/neovim/neovim/issues/5713#issuecomment-265136186","issue_url":"https://api.github.com/repos/neovim/neovim/issues/5713","id":265136186,"user":{"login":"chrisbra","id":244927,"avatar_url":"https://avatars.githubusercontent.com/u/244927?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisbra","html_url":"https://github.com/chrisbra","followers_url":"https://api.github.com/users/chrisbra/followers","following_url":"https://api.github.com/users/chrisbra/following{/other_user}","gists_url":"https://api.github.com/users/chrisbra/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisbra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisbra/subscriptions","organizations_url":"https://api.github.com/users/chrisbra/orgs","repos_url":"https://api.github.com/users/chrisbra/repos","events_url":"https://api.github.com/users/chrisbra/events{/privacy}","received_events_url":"https://api.github.com/users/chrisbra/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T12:17:15Z","updated_at":"2016-12-06T12:17:15Z","body":"Am 2016-12-06 12:09, schrieb Justin M. Keyes:\n>> whether having tests for every vimL function is thought of as\n>> overkill.\n> \n> Not at all. The more the merrier.\n> \n> @chrisbra [1] This seems like a change Vim would want as well.\n\nYeah, I saw it. CC @brammool\n"}}
{"actor":{"display_login":"chrisbra"}}