Re: [code][textadept] view:split() initialization problem

From: Mitchell <m.att.foicica.com>
Date: Mon, 21 May 2018 09:46:09 -0400 (EDT)

Hi Peter,

On Sat, 19 May 2018, Peter Rolf wrote:

> Hi Mitchell,
>
> I have a problem with new views in the latest version [Textadept 10.0
> beta, W32 nightly build 2018-05-18].
> When I call "view:split()", the new view isn't initialized properly (a
> copy of the active buffer).
>
> I used this test code
>
> keys["f7"] = function()
> local old, new = view:split()
> persistence.store("t:/new.lua", new)
> persistence.store("t:/old.lua", old)
> new:goto_buffer(new.buffer)
> old:goto_buffer(old.buffer)
> end
> ------
> [new.lua]
> -- Persistent Data
> local multiRefObjects = {
>
> } -- multiRefObjects
> local obj1 = {
> ["widget_pointer"] = nil --[[userdata]]
> ;
> ["split"] = nil --[[non-lua function not supported]];
> ["goto_buffer"] = nil --[[non-lua function not supported]];
> ["unsplit"] = nil --[[non-lua function not supported]];
> }
> return obj1
> -----
>
> The new view is empty and complete black (no styles set, not even line
> numbers are visible) and I have to activate the new view once to "bring
> it to life".

I am unable to reproduce this issue. I created a new file called "new.lua" with the contents you posted. I then created an identical key binding to yours, except I commented out the "persistence.store()" calls since I do not have that code. I started Textadept, opened "new.lua", pressed F7, and got the expected split views.

I suspect your "persistence.store()" calls are silently erroring, or there is another silent configuration issue in your init.lua. It's unfortunate that the error is not more obvious.

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 21 May 2018 - 09:46:09 EDT

This archive was generated by hypermail 2.2.0 : Tue 22 May 2018 - 06:43:52 EDT