Re: [code] [textadept] Search wrapped behaviour

From: Robert Gieseke <rob.g.att.web.de>
Date: Wed, 26 Mar 2014 15:28:49 +0100

Am 26/03/14 14:15, schrieb Mitchell:
> On Wed, 26 Mar 2014, Robert Gieseke wrote:
>> the find_wrapped event seems to be always emitted at the top of the
>> buffer and not before the first occurrence of the searched term, where
>> the search was initiated.
>> Is this the expected behaviour?
>> This discussion seems to disagree:
>> http://answers.yahoo.com/question/index?qid=20090609061156AA6L2Qs
>
> Yes, it is expected behavior. My understanding of "wrap around" is when
> you hit the bottom of the buffer and jump to the top to continue the
> search.

Thanks for the clarification. How about changing the doc string to
something like

-- @field _G.events.FIND_WRAPPED (string)
-- Emitted when a text search passes the beginning of a buffer, either
from
-- bottom to top (when searching for a next occurrence), or from top to
-- bottom (when searching for a previous occurrence).
-- This is useful for implementing a more visual or audible notice when a
-- search wraps in addition to the statusbar message.

I never really noticed this behaviour, only when I used something more
visible like

events.connect(events.FIND_WRAPPED, function()
   ui.dialogs.msgbox{title='Search wrapped', text='Search wrapped'}
end)

Cheers,
Robert

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 26 Mar 2014 - 10:28:49 EDT

This archive was generated by hypermail 2.2.0 : Thu 27 Mar 2014 - 06:54:28 EDT