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

From: Robert Gieseke <rob.g.att.web.de>
Date: Wed, 08 Jan 2014 17:32:53 +0100

Hi,

when reloading files from a session file the caret is often scrolled out
of view (I think) because buffer:set_sel does some scrolling as well to
ensure the selection is viewable. Maybe using 'current_pos' and 'anchor'
directly could be an alternative, as they don't scroll into view if I
understand the Scintilla docs correctly?

-- session.lua, l.73
buffer:line_scroll(0, buffer:visible_from_doc_line(first_visible_line))
-- buffer:set_sel(anchor, current_pos)
buffer.current_pos = current_pos
buffer.anchor = anchor

The same seems to occasionally happen when switching buffers (from
core/ui.lua, l. 337, the buffer_after_switch event). I don't have a
reproducible constellation but quite often I have to press Ctrl-L
(buffer.vertical_centre_caret) to refocus.

Are they any disadvantages to using those instead of using 'set_sel'?

Cheers,
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 Wed 08 Jan 2014 - 11:32:53 EST

This archive was generated by hypermail 2.2.0 : Thu 09 Jan 2014 - 06:49:13 EST