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

From: Robert Gieseke <>
Date: Sat, 23 Nov 2013 08:31:51 +0100

Hi Ethan,

Am 11/23/13, 8:14 AM, schrieb Ethan M.:
> 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
> It doesn't seem to be the case. I'm curious because I would want text
> to wrap by default, but not code files. Thanks.

should be possible.

Something like this in your init.lua:

events.connect(events.BUFFER_AFTER_SWITCH, function()
   if buffer:get_lexer() == 'text' then
     buffer.wrap_mode = buffer.WRAP_WORD
     buffer.wrap_mode = buffer.WRAP_NONE

You might have to attach this to the FILE_OPENED event as well. Of
course you could also make this dependent on file types etc.

I have a similar use case for highlighting the margin of the active

Hope this helps,


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Sat 23 Nov 2013 - 02:31:51 EST

This archive was generated by hypermail 2.2.0 : Sat 23 Nov 2013 - 06:29:08 EST