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: Sumedh Pendurkar
Subject: Re: [Nano-devel] adding a word-completion feature to nano
Date: Wed, 19 Oct 2016 22:24:00 +0530

Hi,


On 19 October 2016 at 19:40, Benno Schulenberg <address@hidden> wrote:
Hmm...  This doesn't work as I thought it would.  It now suggests
the same completion several times, but it shouldn't do that. 
So it should remember which words it already suggested...  Hrm...
annoying, another global var, a linked list of words to be freed.

example if the words in file starting with "f" are "file" "folder" and "file" and we ^] at "f", it should display "file", "folder", "f" and then
continue the cycle.(please correct if I interpreted it wrong)
 
+    filestruct *check_line = openfile->current;

Hm.  You use check_line both for extracting the current fragment
and for searching the file for possible completions...  Confusing.
Better use variables for a single purpose.

It is just used as iterator and means really nothing. So shall I replace it by "tmp" or something?

+    /*remove the previous suggestion*/
+    for (i = 0; i < prev_len; i++)
+       do_backspace();

No, you shouldn't do this with do_backspace(), but should
simply obliterate the inserted bytes by memory-moving the
tail part of the line over it. 
Also, at a later stage, proper markers for undo() should be
inserted, so the completion can be undone.
 
I am sorry. I didn't grasp what you said(I mean the solution you suggested)
 
+    blank_statusbar();
+    wnoutrefresh(bottomwin);

I have done this because once user cycles through the list at the end of it. The message is displayed. And if user hits ^] once again the message does not vanish. I think I can just add a condition when to do that rather than doing it every time.


Thanks & Regards,

Sumedh Pendurkar

 

reply via email to

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