Store, turn off and restore SmartIndent from macro

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
martinlooker
Posts: 20
Joined: Tue Oct 11, 2005 12:55 pm

Store, turn off and restore SmartIndent from macro

Post by martinlooker »

Is there a way to store, turn off and restore the SmartIndent mode from a macro.

I'm attempting to insert a comment in the style, note the leading space prior to the */:

Code: Select all

/*
 *
 */
When I have smart indent turned on the line following the */ get indented one space, so I'd like to control the SmartIndenting from the macro to avoid this or is there an alternative ?

I'm using MoveLineHome before each insert to avoid getting an extra space on the */ line frmo the * line's indent but I can't control that for the line following the whole comment block.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Just use the write function to output the text:

Code: Select all

function key_macro()
    screen_update_disable()
    FileNew()
    write("     Something to indent against...\n")
    -- output with smart indent
    write("/*\n**\n*/\n")
    -- output with no smart indent
    write("\n/*\n**\n*/\n", 0)
    screen_update_enable()
    screen_update()
end

key_macro() -- run the macro
For more details put the cursor on the write function and use the Help, Quick Help menu.

Cheers Jussi
martinlooker
Posts: 20
Joined: Tue Oct 11, 2005 12:55 pm

Post by martinlooker »

Ahh, thanks again I was using print copied from another macro.

That no smart indent flag isn't in the help file for the write function by the way.
Post Reply