Re: [textadept] Short function of the week

From: mitchell <c....at.caladbolg.net>
Date: Mon, 18 Jul 2011 08:48:06 -0400 (Eastern Daylight Time)

Brian,

Are you putting these on the wiki? :)

mitchell

On Sun, 17 Jul 2011, Brian Schott wrote:

> (Just pretend this was posted on Saturday)
>
> This function automatically wraps text as you type it at the edge_column value from your theme file, if it's been set. Useful for just keeping notes in plain text files.
>
> keys[' '] = function()
> if buffer:get_lexer() == "container" then
> local buffer = buffer
> if buffer.column[buffer.current_pos] < buffer.edge_column then return false end
> buffer:begin_undo_action()
> while buffer.column[buffer.current_pos] > buffer.edge_column do buffer:word_left() end
> buffer:new_line()
> buffer:line_end()
> buffer:add_text(" ")
> buffer:end_undo_action()
> else return false end
> end
>
>
> --
> 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.
>
>

mitchell
Received on Mon 18 Jul 2011 - 08:48:06 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:14:17 EST