Wish to be able to copy the entire line with one mouse click

Post any comments, suggestions, annoyances or ideas for future releases here. Please do not post bug reports or questions here.
Post Reply
Arthur
Posts: 22
Joined: Fri Jan 13, 2012 3:50 am

Wish to be able to copy the entire line with one mouse click

Post by Arthur »

Most IDEs I used to work with offer the ability to copy the entire line by placing the cursor at the left gutter, clicking there would highlight the entire line. May be I am missing something but I really miss this ability.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

May be I am missing something but I really miss this ability.
The best there is the Options, Editor Options, Tiggers, Mouse double click macro setting.

Basically if you put a macro into that edit field it gets called on a left button double click.

But it will only get called for a double click inside the edit region.

The macro below copies and highlights the current line if you double click the mouse past the end on the current line.

Code: Select all

function key_macro()
    -- check if the click is on the line
    if (is_cursor_online() == 1) then
        -- set the return code to zero indicating we want the default handler to fire
        set_return_code(0);
    else
        -- copy the line to clipboard
        LineCopy()

        -- highlight the line
        MarkLineSet()
        MarkLineReset()

        -- debugging
        message("Current line line copied to clipboard.")

        -- set the return code to one indicating we don't want the default handler to fire
        set_return_code(1);
    end
end

key_macro()

Unfortunately because of a small bug the set_return_code call should work but doesn't, meaning the default processing is still called no matter what return code is provided :(

This results in an error message being displayed on the status bar and a error beep :(

But this bug will be fixed in the next release ;)

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Code: Select all

Most IDEs I used to work with offer the ability to copy the entire line by placing the cursor at the left gutter
Out of the blue I remembered that quite some time ago another Zeus user had asked for a way to mark lines of code using the line folding marker.

So I had a look at the code and sure enough there is code in Zeus that does this :)

The only problem is this user had asked for a different mouse marking gesture.

In that case the user had suggestion Zeus should mark lines of code whenever you press down and hold the left mouse while moving the mouse over the folding region.

The advantage of this gesture is that it allows you to select more than one line of code, by jiust holding down the left button and moving the mouse over more and more lines of the folding region ;)

Cheers Jussi
Post Reply