Re: [code] ui.size & ui.maximized

From: Mitchell <m.att.foicica.com>
Date: Mon, 9 Dec 2013 13:43:58 -0500 (Eastern Standard Time)

Carlos,

On Mon, 9 Dec 2013, Carlos Pita wrote:

> Hi all,
>
> I found this behavior a bit inconsistent:
>
> 1) The session overrides any ui.size set in init.lua.

Your `init.lua` is run early in Textadept's initialization process,
allowing you the most control as soon as possible. A side effect, as you
noticed, is that session code runs after this. The solution is to wrap
your `ui.size` within an `events.INITIALIZED` handler:

   events.connect(events.INITIALIZED, function()
     ui.size = {600, 400}
   end)

> 2) The session doesn't override ui.maximized=true set in lua.
>
> The cause of this behavior seems to be in lines 89-91 of session.lua
> (textadept 7.1):
>
> local maximized, width, height = line:match('^size: (%l*) ?(%d+) (%d+)$')
> maximized = maximized == 'true'
> if maximized then ui.maximized = true else ui.size = {width, height} end
>
> Shouldn't ui.maximized be set to false in case maximized is not 'true'?

Yes, I think this should be fixed. Thanks for the report.

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 Mon 09 Dec 2013 - 13:43:58 EST

This archive was generated by hypermail 2.2.0 : Tue 10 Dec 2013 - 06:31:33 EST