{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/2798","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/2798/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/2798/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/2798/events","html_url":"https://github.com/Microsoft/vscode/issues/2798","id":132234974,"number":2798,"title":"Navigate Soft Tabs As If They Are Hard Tabs","user":{"login":"jedmao","id":1058243,"avatar_url":"https://avatars.githubusercontent.com/u/1058243?v=3","gravatar_id":"","url":"https://api.github.com/users/jedmao","html_url":"https://github.com/jedmao","followers_url":"https://api.github.com/users/jedmao/followers","following_url":"https://api.github.com/users/jedmao/following{/other_user}","gists_url":"https://api.github.com/users/jedmao/gists{/gist_id}","starred_url":"https://api.github.com/users/jedmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedmao/subscriptions","organizations_url":"https://api.github.com/users/jedmao/orgs","repos_url":"https://api.github.com/users/jedmao/repos","events_url":"https://api.github.com/users/jedmao/events{/privacy}","received_events_url":"https://api.github.com/users/jedmao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"alexandrudima","id":5047891,"avatar_url":"https://avatars.githubusercontent.com/u/5047891?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandrudima","html_url":"https://github.com/alexandrudima","followers_url":"https://api.github.com/users/alexandrudima/followers","following_url":"https://api.github.com/users/alexandrudima/following{/other_user}","gists_url":"https://api.github.com/users/alexandrudima/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrudima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrudima/subscriptions","organizations_url":"https://api.github.com/users/alexandrudima/orgs","repos_url":"https://api.github.com/users/alexandrudima/repos","events_url":"https://api.github.com/users/alexandrudima/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrudima/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2016-02-08T19:26:06Z","updated_at":"2016-02-10T11:38:51Z","closed_at":null,"body":"If implemented properly, the user should not even realize they are working with spaces for indentation, which is one of the greatest pains of a person who prefers tabs for indentation working on a file that has spaces for indentation.\r\n\r\n## Spaces should be treated as if they were tabs under the following conditions\r\n  1. The text editor's `insertSpaces` setting is `true` (or leading spaces precede tab characters on a line).\r\n  1. The cursor is within the range of leading indentation.\r\n    1. We can't possibly guess where indentation ends and alignment begins, so this includes all leading whitespace (both spaces and tab characters, assuming each tab character is the width of `tabSize`).\r\n  1. The user attempts to do any of the following:\r\n    1. Arrow-key navigation.\r\n    1. Backspace.\r\n    1. Delete.\r\n    1. Mouse selections (more difficult to implement, I'm sure).\r\n\r\n## Examples of how spaces are treated as tabs\r\n  1. If the cursor is at the beginning of the line and the right arrow key is pressed, the cursor jumps `tabSize` spaces, instead of just one.\r\n  1. If `tabSize` is `4` and the cursor is on position `6` (between tabs) and the left arrow key is pressed, the cursor jumps `2` spaces instead of `4`, landing gracefully on a tab stop.\r\n  1. If `tabSize` is `4` and the cursor is on position `4`, but the first non-whitespace character is on position `6`, then the space on position `5` is assumed to be alignment; thus, a right arrow key press would land on position `5`.\r\n  1. The backspace and delete keys should eliminate up to `tabSize` spaces in one batch, so that a single undo operation restores all of the spaces that were deleted.\r\n  1. Ideally, mouse selections would also be restricted to tab stops, so you can't individually select the spaces between a single indent.\r\n\r\n## Exposing an editor setting\r\n  - Perhaps an editor setting called `navigateSoftTabsAsHard` should be exposed for those who wish to opt in or out of this feature. The default value is debatable."},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/comments/182326661","html_url":"https://github.com/Microsoft/vscode/issues/2798#issuecomment-182326661","issue_url":"https://api.github.com/repos/Microsoft/vscode/issues/2798","id":182326661,"user":{"login":"egamma","id":172399,"avatar_url":"https://avatars.githubusercontent.com/u/172399?v=3","gravatar_id":"","url":"https://api.github.com/users/egamma","html_url":"https://github.com/egamma","followers_url":"https://api.github.com/users/egamma/followers","following_url":"https://api.github.com/users/egamma/following{/other_user}","gists_url":"https://api.github.com/users/egamma/gists{/gist_id}","starred_url":"https://api.github.com/users/egamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egamma/subscriptions","organizations_url":"https://api.github.com/users/egamma/orgs","repos_url":"https://api.github.com/users/egamma/repos","events_url":"https://api.github.com/users/egamma/events{/privacy}","received_events_url":"https://api.github.com/users/egamma/received_events","type":"User","site_admin":false},"created_at":"2016-02-10T11:38:51Z","updated_at":"2016-02-10T11:38:51Z","body":"This extension might help somewhat\r\nhttps://marketplace.visualstudio.com/items?itemName=jrieken.backspace-plusplus"}}