Re: [code] [textadept] Don't show line numbers

From: Procházka Lukáš Ing. <>
Date: Sun, 02 Jun 2019 21:38:55 +0200

Hello Mitchell,

On Sun, 02 Jun 2019 01:28:40 +0200, Mitchell <> wrote:

> Try this:
> events.connect(events.VIEW_NEW, function()
> buffer.margin_width_n[0] = 0
> end)

it seem it is not enough.

I created 'init.lua' with just the code above, and a session with 3 open files within 3 views.

For simplicity, all views to have line numbers hidden; but lines are hidden only in the rightmost view (?) and both others have lines on (?).

(I'm attaching files to test and a print-screen right after TA has started, with the last session restored.)

> `events.INITIALIZED` only occurs when Textadept initially starts up, when a single view is available. Textadept's session functionality then creates more views from a saved session, but that is after your event handler is run. You want your setting to apply to all subsequent views right?


> I'd like to point out that normally a setting like `buffer.margin_width_n[0] = 0` in your *~/.textadept/init.lua* would be sufficient,

OK; hiding lines by setting `buffer.margin_width_n[0] = 0` is something I found to be "the trick" to hide lines.

Initially, I thought that something 'buffer.margins = <something, e.g. 4?>' or 'buffer.margin_type_n = <something with 'buffer.MARGIN_BACK'>' would have been more appropriate, but I found no additional info and I didn't want to start playing with the code with unsure result.

> but for line margins in particular, Textadept automatically sets their width based on a file's line number.

Yes, I found a piece of code which deduces width of margin depending on the length of the line number of the buffer.

Back to hiding line numbers - any idea?

Best regards,


> Cheers,
> Mitchell

Ing. Lukáš Procházka |
Pontex s. r. o.      | | | IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4
Mob.: +420 702 033 396

You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Sun 02 Jun 2019 - 15:38:55 EDT

This archive was generated by hypermail 2.2.0 : Mon 03 Jun 2019 - 06:36:32 EDT