Re: [code] Key binding to run a hardcoded filter

From: Mitchell <m.att.foicica.com>
Date: Thu, 21 Jun 2018 08:32:33 -0400 (EDT)

Hi Emil,

On Thu, 21 Jun 2018, Emil Axelsson wrote:

> Hi!
>
> How can I make a key binding to run a specific filter on the selected text?
> Like the existing binding ^-\ (in curses) but without having to type the
> shell command.

Putting something like this into your *~/.textadept/init.lua* should work:

   keys['c\\'] = function() textadept.editing.filter_through(command) end

(See https://foicica.com/textadept/api.html#textadept.editing.filter_through)

> Also a feature request: If the shell command exits with failure, the text in
> the buffer shouldn't be changed. At the moment, a failure will delete all
> text.

Thanks for the suggestion. I will consider this.

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 21 Jun 2018 - 08:32:33 EDT

This archive was generated by hypermail 2.2.0 : Fri 22 Jun 2018 - 06:29:14 EDT