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: Select all
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