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

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

Hello Mitchell,

On Sun, 02 Jun 2019 01:28:40 +0200, Mitchell <m.att.foicica.com> 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?

OK.

> 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,

Lukas

> Cheers,
> Mitchell

-- 
Ing. Lukáš Procházka | mailto:LPr.att.pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4
Mob.: +420 702 033 396


-- 
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.
TA-LinNum.jpg
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