From a6c0212158681611b9a065edd8974ead85d132c2 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sat, 26 May 2018 14:30:50 -0500 Subject: [PATCH] bindings: add the "flippipe" bindable function So the toggle for piping to an external command can be rebound. This fixes https://savannah.gnu.org/bugs/?53987. --- doc/nano.texi | 4 ++++ doc/nanorc.5 | 4 ++++ src/global.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/doc/nano.texi b/doc/nano.texi index 9e449c04..a36d76d1 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -1312,6 +1312,10 @@ Toggles between searching for text and targeting a line number. @item flipexecute Toggles between inserting a file and executing a command. +@item flippipe +When executing a command, toggles whether the current buffer (or marked +region) is piped to the command. + @item flipnewbuffer Toggles between inserting into the current buffer and into a new empty buffer. diff --git a/doc/nanorc.5 b/doc/nanorc.5 index 9d487642..f1e97c76 100644 --- a/doc/nanorc.5 +++ b/doc/nanorc.5 @@ -665,6 +665,10 @@ Toggles between searching for text and targeting a line number. .B flipexecute Toggles between inserting a file and executing a command. .TP +.B flippipe +When executing a command, toggles whether the current buffer (or marked +region) is piped to the command. +.TP .B flipnewbuffer Toggles between inserting into the current buffer and into a new empty buffer. diff --git a/src/global.c b/src/global.c index adf37b60..6e200d2a 100644 --- a/src/global.c +++ b/src/global.c @@ -1651,6 +1651,8 @@ sc *strtosc(const char *input) s->func = backup_file_void; else if (!strcasecmp(input, "flipexecute")) s->func = flip_execute; + else if (!strcasecmp(input, "flippipe")) + s->func = flip_pipe; #endif #ifdef ENABLE_MULTIBUFFER else if (!strcasecmp(input, "flipnewbuffer"))