[invalid] Replace leading spaces by tabs

Request Features and Feature Changes

[invalid] Replace leading spaces by tabs

Postby vds2212 » Fri Nov 28, 2008 8:25 am

Some (me :-) ) still feel more comfortable with tab in the editor than with space.

When:
1. copying code from internet
2. copying code from the IPython console
3. opening code that use space
I'm glad to have a function that convert the leading space into tabs.

It is also useful to be able to convert back the leading tabs in spaces (in particular for the case 3)

Vivian.

PS: This is a feature that I'm using in UltraEdit from time to time.
vds2212
User
 
Posts: 29
Joined: Mon Nov 17, 2008 2:44 pm

Re: Replace leading spaces by tabs

Postby cody » Fri Nov 28, 2008 3:27 pm

Hello,

This already exists.

Format=>White Space=>Tabs to Spaces
Format=>White Space=>Spaces to Tabs


Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Replace leading spaces by tabs

Postby vds2212 » Sat Nov 29, 2008 9:02 am

Hello,

You are right I just didn't find it I'm sorry for that :-|

The functionality you showed seems to replace every tab by 4 spaces and it fit perfectly the bill for all the tab conversions I have to do in Python.

For some other languages C++ for example we may want additional functionality:
The tab to space and space to tab of UltraEdit have additional features:

1. The layout of the text is preserved by the conversion:

The text:
Code: Select all
    a-  b
    aa- bb
    aaa-bbb


become:
Code: Select all
    a...b
    aa..bb
    aaa.b


Where - stands of tab and . stands for space

2. You have the possibility of converting only the leading space or the leading tab.

Again this not important for me as I plan to use Editra mainly for Python.
vds2212
User
 
Posts: 29
Joined: Mon Nov 17, 2008 2:44 pm

Re: Replace leading spaces by tabs

Postby cody » Sat Nov 29, 2008 3:01 pm

Hello,

The conversion is based off of what your tab preferences. If you have Tabs == 4 spaces then the conversion will use that, if Tab == 8 spaces then that will be used. I believe only leading tabs/spaces are modified and not ones imbedded in text like your example. Though I don't really remember since I can't remember the last time I used those functions...


cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron