|
From: | Sumedh Pendurkar |
Subject: | Re: [Nano-devel] adding a word-completion feature to nano |
Date: | Wed, 19 Oct 2016 22:24:00 +0530 |
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.
+ 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.
+ /*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.
+ blank_statusbar();
+ wnoutrefresh(bottomwin);
[Prev in Thread] | Current Thread | [Next in Thread] |