Re: [code] [textadept] view questions

From: Chris Emerson <c-ta.att.mail.nosreme.org>
Date: Mon, 17 Jun 2013 10:09:09 +0100

Hi,

On Mon, Jun 17, 2013 at 10:28:31AM +0200, Benjamin Kober wrote:
> 1. How to close the currently focused view? If I use view.unsplit a view
> beneath the current view is closed and I don't know which one exactly.

I've implemented an approximation of that for my vi emulation; see the
(incorrectly named) function close_siblings_of() here:

https://github.com/jugglerchris/textadept-vi/blob/master/vi_mode_ex.lua#L39

Essentially you can look through the view tree (_G._VIEWS) until you find
your view's parent, then unsplit the other side. It's not perfect,
especially if the other side is further split.

Mitchell, would you support adding a "view.remove" API to remove the current
view? While on the subject, what about a way of swapping two views?

> 2. Why can a view only be splitted twice?

How do you mean? As far as i can tell, you can keep splitting as long as
there's space.

> 3. Is it possible to move to the view on the right|left|above|under the
> current focused view (and/or the current cursor position)?

I think this should be possible as well by looking through _G._VIEWS and
taking into account the "vertical" field.

Regards,

Chris

-- 
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 17 Jun 2013 - 05:09:09 EDT

This archive was generated by hypermail 2.2.0 : Mon 17 Jun 2013 - 06:51:51 EDT