{"action":"opened","issue":{"url":"https://api.github.com/repos/se-edu/addressbook-level4/issues/205","repository_url":"https://api.github.com/repos/se-edu/addressbook-level4","labels_url":"https://api.github.com/repos/se-edu/addressbook-level4/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/se-edu/addressbook-level4/issues/205/comments","events_url":"https://api.github.com/repos/se-edu/addressbook-level4/issues/205/events","html_url":"https://github.com/se-edu/addressbook-level4/issues/205","id":194607255,"number":205,"title":"Suggestion: Reposition command box caret on incorrect command","user":{"login":"edmundmok","id":13850812,"avatar_url":"https://avatars.githubusercontent.com/u/13850812?v=3","gravatar_id":"","url":"https://api.github.com/users/edmundmok","html_url":"https://github.com/edmundmok","followers_url":"https://api.github.com/users/edmundmok/followers","following_url":"https://api.github.com/users/edmundmok/following{/other_user}","gists_url":"https://api.github.com/users/edmundmok/gists{/gist_id}","starred_url":"https://api.github.com/users/edmundmok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edmundmok/subscriptions","organizations_url":"https://api.github.com/users/edmundmok/orgs","repos_url":"https://api.github.com/users/edmundmok/repos","events_url":"https://api.github.com/users/edmundmok/events{/privacy}","received_events_url":"https://api.github.com/users/edmundmok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-09T14:19:33Z","updated_at":"2016-12-09T14:19:33Z","closed_at":null,"body":"Currently, typing an incorrect command will first clear the command box then restore the previous incorrect command. As such, the caret position will be at the extreme left on incorrect commands. I think it would be more natural to the user if the caret retains its last position.\r\n\r\nThis is easily changed by:\r\n```java\r\n   /**\r\n     * Restores the cursor position to be at the end of the previously entered command\r\n     */\r\n    private void restoreCursorPosition() {\r\n        commandTextField.positionCaret(previousCommandText.length());\r\n    }\r\n```\r\nOne possible downside is that multiple incorrect commands (e.g. multiple incorrect adds) in a row might seem unresponsive to the user since there is no other feedback now. \r\n\r\nBTW, I am not sure where to make suggestions as I am new to this, hope this is the right place to do so."}}
{"actor":{"display_login":"edmundmok"}}