Page 1 of 1

Function to Convert Tabs Into Spaces

Posted: Thu Sep 08, 2022 7:42 pm
by NaterSkater
Hi All,

I'm having the age old problem of past users code being formatted all wrong and I need to re-structure it.
Is there a function in the Zeus IDE that will convert all the tabs to spaces in the current document being edited?
Thanks for any help.

-Nate

Re: Function to Convert Tabs Into Spaces

Posted: Fri Sep 09, 2022 3:02 am
by jussij
You can do this using a Zeus macro and the macro in question is the following:

Code: Select all

zScript\detab.lua
For example, if you load a file into Zeus and then use the Macros, Execute Script menu and type in detab this will run that macro and it will remove tabs from the current file without destroying the text layout.

NOTE: When run the macro will ask a question in the Zeus status bar. Answer that question by hit the Y or N key.

You can also bind the macro to a keyboard key to make it easier to run.

IMPORTANT: Naturally you should also make sure your files are under source control (or least in a backup location) before running this macro, just in case ;)

Cheers Jussi

Re: Function to Convert Tabs Into Spaces

Posted: Fri Sep 09, 2022 1:05 pm
by NaterSkater
Hi Jussij,

Brilliant! Thanks a bunch. I have been dealing with that issue forever.

-Nate