Re: interested in scite emulation

From: Scott Weisman <sweis....at.gmail.com>
Date: Wed, 8 Dec 2010 01:17:54 -0800 (PST)

Hi Mitchell,

This almost works:

> keys.cf = {
>    function()
>      local buffer = buffer
>      local s = buffer:word_start_position(buffer.current_pos)
>      local e = buffer:word_end_position(buffer.current_pos)
>      gui.find.find_entry_text = buffer:text_range(s, e)
>      gui.find.focus()
>    end

I modified it to this (to pick up any currently selected text first,
based on a previous post I saw):

keys.cf = { function ()
    local buffer = buffer
    local text = buffer:get_sel_text()

    if #text == 0 then
        text =
buffer:text_range(buffer:word_start_position(buffer.current_pos),
buffer:word_end_position(buffer.current_pos))
        -- xxx trim whitespace from text
    end

    gui.find.find_entry_text = text
    gui.find.focus()
end }

But it still picks up whitespace. How do you trim whitespace (where
the "xxx" is)? Then it will be perfect.
Received on Wed 08 Dec 2010 - 04:17:54 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:55:29 EST