NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Tabify/untabify


Joined: 08 Mar 2006
Posts: 63
Reply with quote
I can't find the tabify/untabify commands. I'm sure it is my fault because it isn't possible that those commands can be missing from a programming editor. But if they really are missing, please add commands to change all tab s to spaces and vice versa depending on the IDE tab settings.
View user's profileFind all posts by svenaxSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
it is "Optimal Fill"
and is applied automatically when you leave the line.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 08 Mar 2006
Posts: 63
Reply with quote
No, it's not. It would be the inverse of that option. I always format my files with spaces, not tabs. But sometimes I cut-and-paste code from files that are using tabs. In this case I want the tabs to be converted to spaces to keep with my formatting conventions.
View user's profileFind all posts by svenaxSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
right. It re-indents current line with spaces or tabs depending on "Use Tab Character" checkbox state.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 08 Mar 2006
Posts: 63
Reply with quote
Umm, no it doesn't. With Use tab character unchecked and Optimal fill checked, try typing a few tabs. They will indeed be inserted as tab characters. No change when I leave the line or when I save the file.

Edit: Perhaps you meant that only spaces are used when Optimal fill is off? True, but that still leaves the problem with text that is cut-and-pasted from a file that does use tabs.
View user's profileFind all posts by svenaxSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Probably we were talking about different things.
I thought you need to convert spaces to tabs.
You'll see it's possible if try the following:
-check View->Show hidden characters
-open Tools->Settings->Editor Settings
-check Use Tab characters
-check Optimal Fill

Now, enter a line of text, move cursor to the leftmost position, insert say 8 spaces, move cursort to a different line. You'll see that all the spaces are converted to tabs.

But seems you need to convert tabs to spaces Smile
Yet, even you paste text with tabs when use tab characters is unchecked, it will not conver tabs to spaces.
I think it's fixable and we'll do so in build 4622.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 08 Mar 2006
Posts: 63
Reply with quote
That sounds great! I still would like to have Tabify / Untabify as separate commands though, since that makes it easy to change files from one convention to another when sharing them with other people. That is probably the easiest way to reindent files to use a different spaces-to-tabs ratio too, i.e.
  1. Set Spaces in tab to original indent
  2. Tabify file
  3. Set Spaces in tab to new setting
  4. Untabify file

But if you can take care of the pasted-text problem by making Optimal fill convert tabs to spaces if Use tab character is not checked that will solve most of these problems.
View user's profileFind all posts by svenaxSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
a little note Smile Optimal fill does not change Tabs to spaces, it only may change spaces to Tabs. What is supposed to clear tabs is Paste command when Use Tabs is off.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Tabify/untabify
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic