Re: [code] [textadept] buffer.move_extends_selection is read-only?

From: Mitchell <>
Date: Wed, 13 May 2020 15:12:05 -0400 (EDT)

Hi Nate,

On Wed, 13 May 2020, Nate Dobbins wrote:

> Hello,
> I'm pretty new to Textadept so there's a pretty good chance I'm just
> doing something wrong or misunderstanding the API.
> When trying to set buffer.move_extends_selection to true, I'm getting
> the error "bad argument #3 to '__newindex' (read-only property)". If
> this API is indeed intended to be read-only, is there a different
> function akin to goto_line_extend or goto_pos_extend?

You can set `buffer.selection_mode = buffer.SEL_STREAM` and then the arrow keys, page up/down, etc. will extend the selection.

> Bonus newbie question: when using, and then
> exiting the prompt, keys.mode is getting set to nil rather that what
> it was before starting the command entry. Is there an event I can
> connect to for exiting command entry to reset my keys.mode?

No, there is no event you can listen to. This sounds like a bug that should be fixed. I'll look into it when I have some time. In the meantime, you may have some success modifying *modules/textadept/command_entry.lua* to set `keys.mode` appropriately. If you get it working, feel free to submit a patch to me.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Wed 13 May 2020 - 15:12:05 EDT

This archive was generated by hypermail 2.2.0 : Thu 14 May 2020 - 06:50:53 EDT