{"action":"created","issue":{"url":"https://api.github.com/repos/jroimartin/gocui/issues/81","repository_url":"https://api.github.com/repos/jroimartin/gocui","labels_url":"https://api.github.com/repos/jroimartin/gocui/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/jroimartin/gocui/issues/81/comments","events_url":"https://api.github.com/repos/jroimartin/gocui/issues/81/events","html_url":"https://github.com/jroimartin/gocui/issues/81","id":188966347,"number":81,"title":"Buffer isn't fully cleared when clear() is called and cursor isn't reset.","user":{"login":"libeclipse","id":8942495,"avatar_url":"https://avatars.githubusercontent.com/u/8942495?v=3","gravatar_id":"","url":"https://api.github.com/users/libeclipse","html_url":"https://github.com/libeclipse","followers_url":"https://api.github.com/users/libeclipse/followers","following_url":"https://api.github.com/users/libeclipse/following{/other_user}","gists_url":"https://api.github.com/users/libeclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/libeclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libeclipse/subscriptions","organizations_url":"https://api.github.com/users/libeclipse/orgs","repos_url":"https://api.github.com/users/libeclipse/repos","events_url":"https://api.github.com/users/libeclipse/events{/privacy}","received_events_url":"https://api.github.com/users/libeclipse/received_events","type":"User","site_admin":false},"labels":[{"id":73270672,"url":"https://api.github.com/repos/jroimartin/gocui/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"jroimartin","id":1223476,"avatar_url":"https://avatars.githubusercontent.com/u/1223476?v=3","gravatar_id":"","url":"https://api.github.com/users/jroimartin","html_url":"https://github.com/jroimartin","followers_url":"https://api.github.com/users/jroimartin/followers","following_url":"https://api.github.com/users/jroimartin/following{/other_user}","gists_url":"https://api.github.com/users/jroimartin/gists{/gist_id}","starred_url":"https://api.github.com/users/jroimartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroimartin/subscriptions","organizations_url":"https://api.github.com/users/jroimartin/orgs","repos_url":"https://api.github.com/users/jroimartin/repos","events_url":"https://api.github.com/users/jroimartin/events{/privacy}","received_events_url":"https://api.github.com/users/jroimartin/received_events","type":"User","site_admin":false},"assignees":[{"login":"jroimartin","id":1223476,"avatar_url":"https://avatars.githubusercontent.com/u/1223476?v=3","gravatar_id":"","url":"https://api.github.com/users/jroimartin","html_url":"https://github.com/jroimartin","followers_url":"https://api.github.com/users/jroimartin/followers","following_url":"https://api.github.com/users/jroimartin/following{/other_user}","gists_url":"https://api.github.com/users/jroimartin/gists{/gist_id}","starred_url":"https://api.github.com/users/jroimartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroimartin/subscriptions","organizations_url":"https://api.github.com/users/jroimartin/orgs","repos_url":"https://api.github.com/users/jroimartin/repos","events_url":"https://api.github.com/users/jroimartin/events{/privacy}","received_events_url":"https://api.github.com/users/jroimartin/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-11-13T11:55:25Z","updated_at":"2016-11-13T14:39:40Z","closed_at":null,"body":"This should really be two different issues but they're closely related so I'll group them together here.\r\n\r\nSay there's an input box. There's a key binding for `KeyEnter`, and when it is triggered, we grab the buffer with `v.Buffer()`, handle it, then do the following to clear and reset:\r\n\r\n```\r\nv.SetCursor(0, 0)\r\nv.Clear()\r\n```\r\n\r\nHowever, the cursor position seems to only reset to the top of what's in view and the whitespace remains.\r\n\r\nSo for example if I use the arrow keys to move the cursor down a few lines and then type something and press enter, when we handle and reset the buffer, all subsequent inputs have whitespace at the beginning and the arrow keys have to be used to move the cursor back to the origin."},"comment":{"url":"https://api.github.com/repos/jroimartin/gocui/issues/comments/260190090","html_url":"https://github.com/jroimartin/gocui/issues/81#issuecomment-260190090","issue_url":"https://api.github.com/repos/jroimartin/gocui/issues/81","id":260190090,"user":{"login":"jroimartin","id":1223476,"avatar_url":"https://avatars.githubusercontent.com/u/1223476?v=3","gravatar_id":"","url":"https://api.github.com/users/jroimartin","html_url":"https://github.com/jroimartin","followers_url":"https://api.github.com/users/jroimartin/followers","following_url":"https://api.github.com/users/jroimartin/following{/other_user}","gists_url":"https://api.github.com/users/jroimartin/gists{/gist_id}","starred_url":"https://api.github.com/users/jroimartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroimartin/subscriptions","organizations_url":"https://api.github.com/users/jroimartin/orgs","repos_url":"https://api.github.com/users/jroimartin/repos","events_url":"https://api.github.com/users/jroimartin/events{/privacy}","received_events_url":"https://api.github.com/users/jroimartin/received_events","type":"User","site_admin":false},"created_at":"2016-11-13T14:39:40Z","updated_at":"2016-11-13T14:39:40Z","body":"Exactly, you are right.\r\n\r\nYou can think of a View as a \"window\" over a buffer, so `SetCursor()` sets the position on the cursor within this window and `SetOrigin()` sets the position of the window with respect to the buffer."}}
{"actor":{"display_login":"jroimartin"}}