Re: [code] [textadept] Entering special characters

From: Robert <rob.g.att.web.de>
Date: Sun, 12 May 2013 08:26:41 +0200

Hi Chris,

On Sun, May 12, 2013 at 1:24 AM, Chris Emerson <c-ta.att.mail.nosreme.org> wrote:
> One useful feature in vim is being able to enter any character literally by
> prefixing it with Ctrl-V. For example, this can be used to insert literal
> tab or newline characters either in buffers or say search strings. I
> particularly miss being able to search for tabs - am I missing a way of doing
> that?

Not sure if this is what you mean, but maybe something like this:
keys['cv'] = {
  ['\n'] = function() buffer.add_text('\\n') end,
  ['\t'] = function() buffer.add_text('\\t') end
}

In the find dialog you can search for tabs and newlines if you enable
'Lua pattern', though a shortcut like above wouldn't work in the find
field.
It might be possible to use the key modes (see for example in
textadept/keys.lua at the end) to alter 'gui.find.find_entry_text' by
adding literal newline or tab characters, I haven't tried though.
Btw, in your vi-mode you aren't using the key modes introduced in the
latest beta, are you?

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 Sun 12 May 2013 - 02:26:41 EDT

This archive was generated by hypermail 2.2.0 : Sun 12 May 2013 - 06:28:32 EDT