 |
Zeus IDE Use this forum to ask for help, submit a bug report or make a suggestion.
|
| View previous topic :: View next topic |
| Author |
Message |
dmaon
Joined: 29 Nov 2006 Posts: 14
|
Posted: Wed Dec 20, 2006 2:21 pm Post subject: Problem when assigning shift+Tab to a macro |
|
|
Hi Jussi,
I wanted to change the behaviour of the shift+tab so that if several lines are marked, the lines will move one tab backwards, even if the cursor is in the middle of the line ( and not before the first non blank character).
The macro below should do it and works perfectly as long as I assign it to any other key except shift+tab. If I assign it to shift+tab and then go to the middle of a line, press ctrl+L to mark it, go down 2-3 lines and press shift+tab the macro does not work and the mark disappears. If afterwards I go 2 lines up and press ctrl+L the previous line is marked instead of the current one.
The macro is:
| Code: |
function key_macro()
screen_update_disable()
local selected = is_marked()
if ( selected ~= 0 ) then
local mode = get_marked_mode()
if ( mode~=0 ) then
MoveLineHome()
TabBack()
else
TabBack()
end
else
TabBack()
end
screen_update_enable()
screen_update()
end
key_macro() -- run the macro
|
|
|
| Back to top |
|
 |
jussij Site Admin
Joined: 13 Aug 2004 Posts: 1966
|
Posted: Wed Dec 20, 2006 11:07 pm Post subject: |
|
|
| Quote: | | The macro below should do it and works perfectly as long as I assign it to any other key except shift+tab. |
What is happening is the macro functionality is being messed up by the Zeus CUA marking. For example using Shift+Tab to run the macro also triggers a Shift+MoveLineHome CUA marking action, removing any prior marked area.
Fortunately there is a fix
All you need do is replace the call to MoveLineHome with a call to set_cursor_pos(1) instead
Cheers Jussi |
|
| Back to top |
|
 |
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|