Checking in a macro if a line or 1 column is selected
Checking in a macro if a line or 1 column is selected
In a macro if I use "get_marked_left()" and the whole line is selected I do not get 1 as an answer - but the column where the user was when he marked the line with "MarkLineToggle". Is there any way to check if the whole line is marked?
I don't seem to get the same resultIn a macro if I use "get_marked_left()" and the whole line is selected I do not get 1 as an answer

If I run this macro:
Code: Select all
function key_macro()
screen_update_disable()
MarkLineToggle()
top = get_marked_top()
bottom = get_marked_bottom()
left = get_marked_left()
right = get_marked_right()
message(" Top:" .. top .. " Bottom:" .. bottom .. " Left: " .. left .. " Right:" .. right);
screen_update_enable()
screen_update()
end
key_macro() -- run the macro
As the macro above shows the right marked point is equal to the line length. But you could also use the is_marked, get_marked_mode functions and use the top and bottom marked values to determine the number of lines marked.Is there any way to check if the whole line is marked?
Jussi
Thanks - the get_marked_mode() does the trick - but note that I could not find it anywhere in the help.
The problem with get_marked_right() exists.
What you need to do is to assign a key to "MarkLineToggle()" and in the editor put the cursor in the middle of a line and then press the key.
If you then run the macro (after deleting the line MarkLineToggle()) you
will get left=right= the column where you where when pressing the key.
The problem with get_marked_right() exists.
What you need to do is to assign a key to "MarkLineToggle()" and in the editor put the cursor in the middle of a line and then press the key.
If you then run the macro (after deleting the line MarkLineToggle()) you
will get left=right= the column where you where when pressing the key.
The problem with get_marked_right() exists.
Unfortunately I still can not see this bug with the current Zeus 3.95z version

What I did was:
(1) Create this marking.lua script file:
Code: Select all
function key_macro()
screen_update_disable()
top = get_marked_top()
bottom = get_marked_bottom()
left = get_marked_left()
right = get_marked_right()
message(" Top:" .. top .. " Bottom:" .. bottom .. " Left: " .. left .. " Right:" .. right);
screen_update_enable()
screen_update()
end
key_macro() -- run the macro
(3) Opened a scrap text file and use Alt+L to line mark some text (ie Brief keyboard mapping)
(4) Hit the delete key
(5) Hitting F8 (ie Brief execute macro) results in a 0, 0, 0, 0 display in the status bar, no matter where the cursor is located.
Jussi
The latest Zeus for Windows 3.96a patch fixes this problem 
Refer to this link for more details: http://www.zeusedit.com/forum/viewtopic.php?t=1035
Cheers Jussi

Refer to this link for more details: http://www.zeusedit.com/forum/viewtopic.php?t=1035
Cheers Jussi