Re: [code] [textadept] '\n' in curses

From: Mitchell <m.att.foicica.com>
Date: Thu, 9 May 2013 19:19:59 -0400 (EDT)

Hi Robert,

On Tue, 7 May 2013, Robert wrote:

> Hi,
>
> the following key mode
> keys.test = {
> ['\n'] = function() gui.statusbar_text = 'ENTER' end,
> ['esc'] = function() keys.MODE = nil end
> }
>
> keys['cp'] = function() gui.statusbar_text = 'Test'; keys.MODE = 'test' end
>
> works in the GUI version but not in the curses version. Using curses a
> new line is added.
> It does not matter if I add [13] = '\n' to KEYSYMS (this is the value
> of the 'code' variable in the curses version). I noticed that this
> replacement was removed from 'core/keys.lua' a while ago, so I thought
> it could be a solution.
>
> In Textredux I had the same problem (and ended up hardcoding 13 to
> '\n') and hoped to be able to replace the 'keys'-hack in Textredux
> with Textadept's new key modes.
>
> Any ideas? Is 'Return' handled by curses before it reaches Textadept
> keys module?

Sorry for the delay in responding. I think you'll have to `return false`
from your '\n' key. `_M.textadept.command_entry.finish_mode()` does this
especially for curses behind the scenes.

Cheers,
Mitchell

-- 
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 May 2013 - 19:19:59 EDT

This archive was generated by hypermail 2.2.0 : Fri 10 May 2013 - 06:29:01 EDT