Re: Duplicate line

From: <briancsch....at.gmail.com>
Date: Fri, 30 Apr 2010 15:41:03 -0700 (PDT)

Here's a snippet from my key_commands.lua:

local textadept = _G.textadept
local locale = _G.locale

local keys = _G.keys
local b, v = buffer, view
local t = textadept

-- Deletes the current line
function delete_line()
        local buffer = buffer
        buffer:begin_undo_action()
        buffer:home()
        buffer:del_line_right()
        if buffer:line_from_position(buffer.current_pos) == 0 then
                buffer:line_down()
                buffer:home()
                buffer:delete_back()
        else
                buffer:delete_back()
                buffer:line_down()
        end
        buffer:end_undo_action()
end

keys.cl = { delete_line }
keys.cd = { b.line_duplicate }

On Apr 30, 12:25 pm, Ryan Pusztai <rpusz....at.gmail.com> wrote:
> Hi,
>
> Is there a keyboard shortcut for "Duplicate Line"? If not how can I add
> this? I use it all the time in other editors and would really like to have
> it in TA. Thanks.
> --
> Regards,
> Ryan
>
> --
> You received this message because you are subscribed to the Google Groups "textadept" group.
> To post to this group, send email to textadept.at.googlegroups.com.
> To unsubscribe from this group, send email to textadept+unsubscribe.at.googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/textadept?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "textadept" group.
To post to this group, send email to textadept.at.googlegroups.com.
To unsubscribe from this group, send email to textadept+unsubscribe.at.googlegroups.com.
For more options, visit this group at http://groups.google.com/group/textadept?hl=en.
Received on Fri 30 Apr 2010 - 18:41:03 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:44:24 EST