nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] adding a word-completion feature to nano


From: Benno Schulenberg
Subject: Re: [Nano-devel] adding a word-completion feature to nano
Date: Thu, 27 Oct 2016 09:27:38 +0200

On Wed, Oct 26, 2016, at 20:18, Sumedh Pendurkar wrote:
> On Wednesday 26 October 2016 03:16 PM, Benno Schulenberg wrote:
> > But... wouldn't it be enough to instead simply do?:
> >
> >      if (openfile->current_undo != NULL) {
> >          discard_until(openfile->current_undo->next, openfile);
> >          openfile->current_undo = openfile->undotop;
> >      }
> 
> This is the is basically the same thing which pop_undo() does. Replaced 
> it with this as it is shorter.

Okay.  But then there is no need for a separate function.  In
attached patch I've moved it inline, and reduced it to one call.

By the way, when applying my patch, don't forget to do a
git pull first, to get your master branch up to date.  Then
check out a new branch and apply my patch there.  (For my
previous patch, you applied some changes by hand, and did
not copy them exactly.  My patch should apply cleanly; if
it doesn't, your tree is not close enough to master.)

Running, with your patch applied, 'src/nano +7 NEWS' and
typing "port" followed by several times ^], shows the word
"portable" twice.  Two more ^]s cause a segfault.

In my attached version of the patch I've fixed the segfault
(freeing the word list in the correct order), but I haven't
looked into why some words sometimes appear twice.

Oh, I've removed all the checking for malloc() returning
NULL: there is a helper function for that: nmalloc().

Benno

-- 
http://www.fastmail.com - Access your email from home and the web

Attachment: 0001-new-feature-complete-a-fragment-to-a-longer-word-fou.patch
Description: Text Data


reply via email to

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