If I have for example this code: function foo() { var list = []; }
Note there is 4 spaces indention.
I work in 5 spaces soft tabs.
If I move the cursor to just before the "v" in "var", and left arrow, I move to the left one space. Somehow, I need to reformat this code to be 5 spaces. Then when I move the arrow to the left, it moves 5 spaces, or one apparent tab stop.
I have tried selecting the code, while I have my tabs set to 5, hard or soft, using reformat selection, in this case, in the JavaScript bundle area, or, convert spaces to tabs. Neither gets me where I need to be.
I end up re-tabbing all the code, which is a tedious process.
I I just add one space, or select the 4 spaces and replace with a tab, I get the functionality I want: function foo() { var list = []; }
That example, the space before the "v" becomes a tab, either hard or soft. Thanks.
On 31/08/2009, at 12:16 PM, Scott Haneda wrote:
If I have for example this code: function foo() { var list = []; }
Note there is 4 spaces indention.
I work in 5 spaces soft tabs.
<snip>
I have tried selecting the code, while I have my tabs set to 5, hard or soft, using reformat selection, in this case, in the JavaScript bundle area, or, convert spaces to tabs. Neither gets me where I need to be.
When I change a file that has a different tab stop to what I usually work in, I usually reformat it by setting my tab width to match the file, convert spaces to tabs, change the tab width to be my preferred one then convert tabs to spaces.
Adam
On Aug 30, 2009, at 7:23 PM, Adam Bryzak adam+textmate@bryzak.net wrote:
On 31/08/2009, at 12:16 PM, Scott Haneda wrote:
If I have for example this code: function foo() { var list = []; }
Note there is 4 spaces indention.
I work in 5 spaces soft tabs.
<snip>
I have tried selecting the code, while I have my tabs set to 5, hard or soft, using reformat selection, in this case, in the JavaScript bundle area, or, convert spaces to tabs. Neither gets me where I need to be.
When I change a file that has a different tab stop to what I usually work in, I usually reformat it by setting my tab width to match the file, convert spaces to tabs, change the tab width to be my preferred one then convert tabs to spaces.
Any way to automate that on a selection? I don't suppose I can access the current tab stop setting value.
Any fancy regex's that could find and replace this? It's generally going to be 1-4 leading spaces, which should not be to hard to fish out.