{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/1368","labels_url":"https://api.github.com/repos/micropython/micropython/issues/1368/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/1368/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/1368/events","html_url":"https://github.com/micropython/micropython/issues/1368","id":93488007,"number":1368,"title":"Smart autoindent/autocompletion","user":{"login":"pfalcon","id":500451,"avatar_url":"https://avatars.githubusercontent.com/u/500451?v=3","gravatar_id":"","url":"https://api.github.com/users/pfalcon","html_url":"https://github.com/pfalcon","followers_url":"https://api.github.com/users/pfalcon/followers","following_url":"https://api.github.com/users/pfalcon/following{/other_user}","gists_url":"https://api.github.com/users/pfalcon/gists{/gist_id}","starred_url":"https://api.github.com/users/pfalcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfalcon/subscriptions","organizations_url":"https://api.github.com/users/pfalcon/orgs","repos_url":"https://api.github.com/users/pfalcon/repos","events_url":"https://api.github.com/users/pfalcon/events{/privacy}","received_events_url":"https://api.github.com/users/pfalcon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-07-07T09:48:14Z","updated_at":"2015-07-07T11:58:46Z","closed_at":null,"body":"As a followup to #1200, #1360, I'd like to propose that following behavior was implemented for REPL (in a sense, if anything is implemented, then following behavior):\r\n\r\n1. If pressing Enter at the end of normal line which starts with number of 4-spaces, then next line automatically has that number of spaces inserted (auto-indent).\r\n2. If line ends with \":\" (starts compound statement), next line auto-indent with increased amount of indent.\r\n3. If line was just auto-indented, pressing backspace removes 4 spaces (can be repeated).\r\n\r\nWith the scheme above:\r\n\r\n4. Tab can always do completion. If user mistakenly presses backspace in auto-indented, one is just \"punished\" with pressing space 4 times.\r\n\r\nAnd:\r\n\r\n5. With all the advanceties above, we'd now need \"paste mode\" to disable all these features and allow pasting existing code into repl. It essentially should be like \"raw\" mode, but with echo.\r\n"},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/119181032","html_url":"https://github.com/micropython/micropython/issues/1368#issuecomment-119181032","issue_url":"https://api.github.com/repos/micropython/micropython/issues/1368","id":119181032,"user":{"login":"xix-xeaon","id":1330325,"avatar_url":"https://avatars.githubusercontent.com/u/1330325?v=3","gravatar_id":"","url":"https://api.github.com/users/xix-xeaon","html_url":"https://github.com/xix-xeaon","followers_url":"https://api.github.com/users/xix-xeaon/followers","following_url":"https://api.github.com/users/xix-xeaon/following{/other_user}","gists_url":"https://api.github.com/users/xix-xeaon/gists{/gist_id}","starred_url":"https://api.github.com/users/xix-xeaon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xix-xeaon/subscriptions","organizations_url":"https://api.github.com/users/xix-xeaon/orgs","repos_url":"https://api.github.com/users/xix-xeaon/repos","events_url":"https://api.github.com/users/xix-xeaon/events{/privacy}","received_events_url":"https://api.github.com/users/xix-xeaon/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T11:58:46Z","updated_at":"2015-07-07T11:58:46Z","body":"> There's no paste ability already, try e.g. paste following:\r\n\r\nThat doesn't work in regular python either, but I think it should be rather easy to fix. And if you care about PEP 8 there really should be blank lines in between ;)\r\n\r\n@pfalcon, I don't think a lot of people really work with a lot of blockcode (where you need indentation) in a one-line REPL. I'll write a lot one-liners in the REPL, but as soon as it becomes just a couple of lines in a block I'll work with the code in an editor and then I'll copy paste it into REPL and play (test) with it using one-liners.\r\n\r\nIf you wanna have a multiline REPL then it's a different thing, but I think we're outside of the scope of the implementation, for now anyway."}}