Re: [textadept] Close buffer and unsplit view

From: mitchell <c....at.caladbolg.net>
Date: Wed, 22 Feb 2012 07:58:41 -0500 (Eastern Standard Time)

On Wed, 22 Feb 2012, HyperHacker wrote:

> On Wed, Feb 22, 2012 at 05:26, mitchell <c....at.caladbolg.net> wrote:
>> Hi,
>>
>>
>> On Wed, 22 Feb 2012, HyperHacker wrote:
>>
>>> I'm trying to make a hotkey to close the current buffer and then
>>> unsplit the view. This seems simple enough:
>>>
>>> keys['csw'] = function() view.buffer:close() view:unsplit() end
>>>
>>> But what that ends up doing is closing *all* buffers and not
>>> unsplitting the view at all! Why is this?
>>
>>
>> csw is the normal key command to close all buffers. Perhaps your function is
>> not being called at all. I ran your code using the command entry and it
>> worked as expected.
>>
>> mitchell
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "textadept" group.
>> To post to this group, send email to textadept.at.googlegroups.com.
>> To unsubscribe from this group, send email to
>> textadept+unsubscribe.at.googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/textadept?hl=en.
>>
>
> Aha, I see, it's defined as cW rather than csw.
> When I try it now, I get:
> ...rena/dev/pc/src/textadept/textadept_5.0/core/file_io.lua:267:
> calling 'check_global' on bad self
> But it does work in the command entry... strange... I don't see a
> "local view" in keys.lua, so they should be referring to the same
> variable?

Use _G.view instead of view. view is actually local.

mitchell
Received on Wed 22 Feb 2012 - 07:58:41 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:31:44 EST