Re: [code] [textadept] Line wrapping on a per-buffer/file-type basis

From: Mitchell <m.att.foicica.com>
Date: Sat, 23 Nov 2013 10:18:32 -0500 (EST)

Hi Ethan,

Welcome!

On Sat, 23 Nov 2013, Ethan M. wrote:

> Hi,
>
> New to Textadept. After some reading and experimenting, I was wondering if
> it is possible to set line wrapping on a per-buffer or per-filetype basis.
> It doesn't seem to be the case. I'm curious because I would want text files
> to wrap by default, but not code files. Thanks.

Putting the following in your `~/.textadept/init.lua` should work:

   events.connect(events.LEXER_LOADED, function(lexer)
     buffer.wrap_mode = lexer == 'text' and buffer.WRAP_WORD
                                        or buffer.WRAP_NONE
   end

Cheers,
Mitchell

-- 
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 Sat 23 Nov 2013 - 10:18:32 EST

This archive was generated by hypermail 2.2.0 : Sun 24 Nov 2013 - 06:48:06 EST