nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH] Pipe selected text to external tool


From: Brand Huntsman
Subject: Re: [Nano-devel] [PATCH] Pipe selected text to external tool
Date: Fri, 16 Feb 2018 22:52:20 -0700

On Fri, 16 Feb 2018 21:55:12 -0700
Brand Huntsman <address@hidden> wrote:

> The cutbuffer has an empty line at the end if cursor is the start of
> the next line. send_data() needs to detect this and not send that
> final line. And if the cutbuffer doesn't contain that empty line,
> then don't send a linefeed on the last line.

An additional problem is that some programs will send the last line back to 
nano with a linefeed.

`sed s:match:foo:g` does not
`grep small` does

So grep will work fine if cursor is on the next line, but a blank line is added 
if cursor is at the end of the last line. If that final blank line is removed 
from cutbuffer, then return true from send_data(). If return value is false, 
then remove last character returned from command if it is a linefeed.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]