Re: Discovering TextAdept

From: mitchell <mforal.n....at.gmail.com>
Date: Sat, 20 Mar 2010 08:15:40 -0700 (PDT)

Robert,

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

Mitchell

>
> Thanks,
> Robert
Received on Sat 20 Mar 2010 - 11:15:40 EDT

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