Re: [code] [textadept] Scroll position in session loading and buffer switching

From: Robert Gieseke <rob.g.att.web.de>
Date: Thu, 09 Jan 2014 20:38:24 +0100

Hi Mitchell,

Am 1/9/14, 6:39 PM, schrieb Mitchell:
> When you say the caret is scrolled out of view, what do you mean? Is it
> above or below the visible lines? Or is it off to the side on a long line?
>
> In the cases where the selection is on part of a long line not visible
> in the view, `buffer:set_sel()` ensures visibility. Setting `anchor` and
> `current_pos` would definately leave the caret out of view in these
> cases -- we do not want that to happen.
>
> I'm not convinced that `buffer:set_sel()` is to blame for your
> observations. I have done some brief tests on my machine but have yet to
> reproduce what you describe. What happens when you add
> `buffer:scroll_range(anchor, caret)` after line scrolling and selection
> setting?
>

I have word_wrap enabled so I hadn't thought of long lines, where it
obviously makes sense to scroll to. Maybe it's the buffer_after_switch
event, I have one vertical split, so after restoring all views it's
switching back again to the first view?
Every time I think I have a reproducible example it's not

Thanks for looking into it, I'll try to come up with one.
Robert

-- 
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 Thu 09 Jan 2014 - 14:38:24 EST

This archive was generated by hypermail 2.2.0 : Fri 10 Jan 2014 - 06:28:03 EST