[Top][All Lists]

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

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

From: Sumedh Pendurkar
Subject: Re: [Nano-devel] adding a word-completion feature to nano
Date: Thu, 10 Nov 2016 00:55:33 +0530
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0


On 11/09/16 19:37, Benno Schulenberg wrote:
then discard_until(openfile->current_undo, openfile);
But what does that do?  Discarding until current_undo does
nothing, right?

When we do_undo we would move current_undo back by one. But not actually pop one element off the undo stack i.e. undotop will remain the same. And therefore redo might go wrong as the deletion is still in memory. It causes error when you complete 1 cycle(i.e. no further matches) and press 'M-E' . which would redo the previous suggestion which is undesirable.

solved that issue..suppressed that message in do_undo function.
temporarily disabled wrapping words before do_output and then do the
wrap. so that only one item gets added in undo stack.
Upon first testing, I got some strange behavior, but cannot
reproduce that any more.  It seems to work well -- but I don't
understand why.  :)  How is it possible that a single undo undoes
both the line wrap and the attempted completion?  I can't break it,
so it must be correct, but it feels like magic.

I had figured that out when I had sent the patch. But now, it seems like magic to me too. Have to figure that out why that happens. Also there is no code that adds undo after text_wrap is done in do_output when it is set. So this seems weird. I needed some time to look at it. (Sorry I cannot look much into the code for a couple of weeks due to examinations)

I've pushed a tweaked version of your patch to the branch.
Please verify that you are okay with it.

Its good. I think we need to add the discard_until..

Thanks & Regards,
Sumedh Pendurkar

reply via email to

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