Hi Egon,
i have a problem setting up zeus in a way that it accepts my coding style [Smile]
If you use the Zeus templates, with a little configuration it should be possible to configure Zeus to handle almost any coding
For more information see the
Coding faster with templates tip.
But heres what drives me crazy:
When on this new line i will write the closing bracket i have not simply hit backspace one time (to jump back one tabstop) but to press backspace as many times because the area from the beginning of the line till the cursor position has been filled with whitespaces from zeus. I don't know if this is a feature or a bug.
This is a feature
But seriously, this is definitely a feature of Zeus. The term smart indent means Zeus does try to be smart about the indent

When you hit the enter key Zeus will fill the whitespace gap using the same whitespace as used in the line above. This feature is very important for some languages like Python where it is a
syntax error if you mix spaces and tabs.
Code: Select all
Is it possible to set this behavior up anywhere? (Maybe a option like "Indent as Tabs"...)
Zeus is fully scriptable with the choice of several macro scripting languages. With a macro script to replace the current backspace behaviour any functionality should be possible
For a quick introduction into macro scripting see the
Binding a Macro to the Keyboard tip. There are also several example macros in the
zMacros directory
I wrote the following
very quick,
lightly tested Zeus Lua macro that should do something similar to what you describe:
Code: Select all
function key_macro()
screen_update_disable()
-- Get a copy of the current line
local text = get_line_text()
-- look for an empty line of text
if string.len(text) == 0 then
-- this is debug only shown in status bar
message ("empty");
-- position the cursor
MoveLineDownAndFirst()
MoveLineUp()
else
-- this is debug only shown in status bar
message ("normal");
-- just do a normal backspace
Backspace()
end
screen_update_enable()
screen_update()
end
key_macro() -- run the macro
Basically this macro uses the fact that a smart indented line contains no text until a character is typed. So this macro test for an empty line and if one is found it does a special backspace usign the line below as a guide, otherwise it just does a normal backspace.
But not that any functionality could be code here. For example it might be better to have a macro like this instead:
Code: Select all
function key_macro()
screen_update_disable()
-- Get a copy of the current line
local text = get_line_text()
-- look for an empty line of text
if string.len(text) == 0 then
-- this is debug only shown in status bar
message ("empty");
-- remove the empty line
LineDelete()
MoveLineHome()
MoveWordNext()
else
-- this is debug only shown in status bar
message ("normal");
-- just do a normal backspace
Backspace()
end
screen_update_enable()
screen_update()
end
key_macro() -- run the macro
Another good feature would be if i write a bracket on Line 3 without pressing Backspace or anything else that the bracket is automatically positioned below the 'i' of Line 1
Zeus does not try to do this, because all languages are different, and one languages brace character is a another languages parenthesis. IMHO Zeus is already very configurable, to a point where is is getting difficult to use because it is too configurable
But once again I think this would be fairly easy to script using a Zeus macro. I will leave you this one to write as an exercise in Zeus scripting
And also another good feature (imho) would be if i press enter at the end of Line 1, that the cursor jumps automatically forward one tab (cursor positioned below the 'x' of Line 1)
There is a Zeus macro function called
is_eol() which returns true if the cursor is at the EOL so once again by using this function it should be fairly easy to write a simple macro to replace the default enter functionality.
I hope that the text above is understoodable, because my English is a very poor.
I would say you English is very good and very easy to understood.
If I had to reply in anything but English I would be lost
Cheers Jussi