Zeus IDE Forum Index Zeus IDE
Use this forum to ask for help, submit a bug report or make a suggestion.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem when assigning shift+Tab to a macro

 
Post new topic   Reply to topic    Zeus IDE Forum Index -> Reporting a Bug
View previous topic :: View next topic  
Author Message
dmaon



Joined: 29 Nov 2006
Posts: 14

PostPosted: Wed Dec 20, 2006 2:21 pm    Post subject: Problem when assigning shift+Tab to a macro Reply with quote

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
View user's profile Send private message
jussij
Site Admin


Joined: 13 Aug 2004
Posts: 2206

PostPosted: Wed Dec 20, 2006 11:07 pm    Post subject: Reply with quote

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 Smile

All you need do is replace the call to MoveLineHome with a call to set_cursor_pos(1) instead Wink

Cheers Jussi
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Zeus IDE Forum Index -> Reporting a Bug All times are GMT
Page 1 of 1

 
Jump to:  
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