Re: Discovering TextAdept

From: Robert <ro....at.web.de>
Date: Sat, 20 Mar 2010 09:38:46 -0700 (PDT)

On Mar 20, 4:15 pm, mitchell <mforal.n....at.gmail.com> wrote:
> > > > > Where is this scroll position calculated?
>
> > > > Calling buffer:set_sel at the 60th line in modules/textadept/
> > > > session.lua.
> > > > buffer:set_sel calls Scintillua's SCI_SETSEL directly, and the latter
> > > > does the autoscroll to the carret.
>
> > > Thanks! I found out, that buffer.x_offset can be used to set the
> > > position as well.
> > > Maybe buffer.x_offset could be saved in the session file and be reset
> > > when restoring the session.
>
> > I was trying to save the buffer.x_offset position in sessions.lua.
> > When trying (directly in Textadept)
> > for _, buffer in ipairs(textadept.buffers) do
> > textadept.print(buffer.x_offset) end
> > I get an error "the indexed Buffer is not the focused one". Is there
> > some workaround to get this value for all buffers?
>
> for i, buffer in ipairs(textadept.buffers) do
>   view:goto_buffer(i, true)
>   textadept.print(buffer.x_offset)
> end

Thanks, I found where the underscored variables in sessions.lua came
from (events.lua) - in the end understanding that was my problem. I
tried including the x_offset position in sessions.lua, but for some
reason without the side pane the scrolling does not happen. (Have you
changed something else?) I compared with an older version, even with
an hidden side pane the scrolling happens. Anyway, problem
solved... :-)

- Robert
Received on Sat 20 Mar 2010 - 12:38:46 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:40:13 EST