{"action":"created","issue":{"url":"https://api.github.com/repos/arduino/Arduino/issues/3502","labels_url":"https://api.github.com/repos/arduino/Arduino/issues/3502/labels{/name}","comments_url":"https://api.github.com/repos/arduino/Arduino/issues/3502/comments","events_url":"https://api.github.com/repos/arduino/Arduino/issues/3502/events","html_url":"https://github.com/arduino/Arduino/issues/3502","id":94346038,"number":3502,"title":"CMD+[ and CMD+] backwards and incorrect on Mac","user":{"login":"Jed-SWSDT","id":5796632,"avatar_url":"https://avatars.githubusercontent.com/u/5796632?v=3","gravatar_id":"","url":"https://api.github.com/users/Jed-SWSDT","html_url":"https://github.com/Jed-SWSDT","followers_url":"https://api.github.com/users/Jed-SWSDT/followers","following_url":"https://api.github.com/users/Jed-SWSDT/following{/other_user}","gists_url":"https://api.github.com/users/Jed-SWSDT/gists{/gist_id}","starred_url":"https://api.github.com/users/Jed-SWSDT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jed-SWSDT/subscriptions","organizations_url":"https://api.github.com/users/Jed-SWSDT/orgs","repos_url":"https://api.github.com/users/Jed-SWSDT/repos","events_url":"https://api.github.com/users/Jed-SWSDT/events{/privacy}","received_events_url":"https://api.github.com/users/Jed-SWSDT/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/arduino/Arduino/labels/Component:%20IDE%20user%20interface","name":"Component: IDE user interface","color":"009800"},{"url":"https://api.github.com/repos/arduino/Arduino/labels/OS:%20OSX","name":"OS: OSX","color":"808080"}],"state":"open","locked":false,"assignee":{"login":"ffissore","id":510465,"avatar_url":"https://avatars.githubusercontent.com/u/510465?v=3","gravatar_id":"","url":"https://api.github.com/users/ffissore","html_url":"https://github.com/ffissore","followers_url":"https://api.github.com/users/ffissore/followers","following_url":"https://api.github.com/users/ffissore/following{/other_user}","gists_url":"https://api.github.com/users/ffissore/gists{/gist_id}","starred_url":"https://api.github.com/users/ffissore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffissore/subscriptions","organizations_url":"https://api.github.com/users/ffissore/orgs","repos_url":"https://api.github.com/users/ffissore/repos","events_url":"https://api.github.com/users/ffissore/events{/privacy}","received_events_url":"https://api.github.com/users/ffissore/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-07-10T16:53:04Z","updated_at":"2015-11-23T20:19:56Z","closed_at":null,"body":"At least with version 1.6.5, the functionality of CMD+[ and CMD+] is still not correct. It used to move the entire line regardless of where the cursor was in it. Now that only works for decreasing. For increasing it adds a tab where the cursor is. It was an easy way to change the line indent without having to move the cursor to the beginning (requiring another key combo or mouse move).\r\n\r\nAlso, they now move the line in the opposite direction from standard. \r\n\r\nNote, this key-combo is used throughout the Mac environment, including Mac Mail (increase/decrease indent level) and shouldn't be confused with tab tab+shift which usually has a different behavior/use. "},"comment":{"url":"https://api.github.com/repos/arduino/Arduino/issues/comments/159052415","html_url":"https://github.com/arduino/Arduino/issues/3502#issuecomment-159052415","issue_url":"https://api.github.com/repos/arduino/Arduino/issues/3502","id":159052415,"user":{"login":"damellis","id":405058,"avatar_url":"https://avatars.githubusercontent.com/u/405058?v=3","gravatar_id":"","url":"https://api.github.com/users/damellis","html_url":"https://github.com/damellis","followers_url":"https://api.github.com/users/damellis/followers","following_url":"https://api.github.com/users/damellis/following{/other_user}","gists_url":"https://api.github.com/users/damellis/gists{/gist_id}","starred_url":"https://api.github.com/users/damellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damellis/subscriptions","organizations_url":"https://api.github.com/users/damellis/orgs","repos_url":"https://api.github.com/users/damellis/repos","events_url":"https://api.github.com/users/damellis/events{/privacy}","received_events_url":"https://api.github.com/users/damellis/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T20:19:56Z","updated_at":"2015-11-23T20:19:56Z","body":"I looked a bit more into this... The first problem is that the open / close actions are simply swapped here: https://github.com/arduino/Arduino/blob/master/app/src/processing/app/syntax/SketchTextAreaDefaultInputMap.java#L48\r\n\r\nThe KeyEvent.VK_OPEN_BRACKET is a left bracket and should be RSyntaxTextAreaEditorKit.rstaDecreaseIndentAction. For KeyEvent.VK_CLOSE_BRACKET (right bracket), things are more complicated because it looks like RSyntaxTextArea doesn't include an indent action. As a result Editor.handleIndentOutdent() (https://github.com/arduino/Arduino/blob/master/app/src/processing/app/Editor.java#L1867) has to create a text selection before calling the RSyntaxTextArea insertTabAction. If there's no selection, the insertTabAction will actually insert a tab key instead of increasing the indentation of the current line as we'd like it to. So I guess we either need to create a new RSyntaxTextArea action (RSyntaxTextAreaEditorKit.rstaIncreaseIndentAction) or insert a similar hack to create a selection before calling insertTabAction (and remove the selection afterwards)."}}