Re: how to enclose text

From: <briancsch....at.gmail.com>
Date: Fri, 28 May 2010 11:11:10 -0700 (PDT)

Make that:

function encloseIn()
        buffer:begin_undo_action()
        local start = buffer.selection_start
        local end = buffer.selection_end
        buffer:set_selection(end, end)
        buffer:add_selection(start, start)
        buffer:end_undo_action()
end

The eariler version had too much copy-paste from one of my other
modules.

On May 28, 10:59 am, "briancsch....at.gmail.com" <briancsch....at.gmail.com>
wrote:
> On May 28, 2:35 am, morchel <morc....at.hotmail.com> wrote:
>
> > Hi,
>
> > How is enclosing text supposed to work? The shortcuts
> > defined in key_commands seem to not show any effect.
>
> > Regards,
> > Martin
>
> You can also do something like this, which allows you to enclose the
> selection in more than one character at a time by using multiple
> cursors:
>
> function encloseIn()
>         buffer:begin_undo_action()
>         local text = buffer:get_sel_text()
>         local start = buffer.selection_start
>         buffer:set_selection(start + #text, start + #text)
>         buffer:add_selection(start, start)
>         buffer:end_undo_action()
Received on Fri 28 May 2010 - 14:11:10 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:46:31 EST