From mboxrd@z Thu Jan 1 00:00:00 1970 From: ef_dva@yahoo.com (Dusan) Date: Tue, 18 Aug 2009 20:46:52 +0200 Subject: [sup-talk] ncurses hack In-Reply-To: <1250619721-sup-91@localdomain> References: <1250538875-sup-2195@javelin> <1250563136-sup-432@masanjin.net> <1250580593-sup-1346@archpc> <1250619721-sup-91@localdomain> Message-ID: <1250620908-sup-7463@archpc> Excerpts from Beno?t PIERRE's message of Tue Aug 18 20:24:45 +0200 2009: > Excerpts from Dusan's message of Tue Aug 18 09:42:48 +0200 2009: > > > > [...] > > > > Not being able to fix search/save and other edits is huge show-stopper. > > I do what I read somewhere: > > > > -start search, get garbage results > > -kill that buffer with 'x' > > -start another search but instead of typing search term again first > > repeat: press up, delete search garbage, press up, delete search > > garbage, repeat until there is nothing to delete > > -type another search term and search now works 100% > > > > This works for searches but edits like save still fail (or save X((%^1X file > > so if you can find it you can rename it). > > > > Looks like fixable bug to simulate what I did for searches? Repeat in > > code ten times 'up arrow', '50 x delete char'? Sorry if I am wrong. > > > > Using sup and not being able to properly search or save is too wrong. > > > > If there is any config/version I should report to get this fixed just > > let me know. Without waiting for new ruby of course -- I do have proper > > results when I repeat deleting ritual. > > Hi, can you try the following patch and tell me if it fix the problem? > > diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb > index b8dec59..ccc8533 100644 > --- a/lib/sup/textfield.rb > +++ b/lib/sup/textfield.rb > @@ -36,8 +36,9 @@ class TextField > @field = Ncurses::Form.new_field 1, @width - question.length, @y, > @x + question.length, 256, 0 > @form = Ncurses::Form.new_form [@field] > @value = default > + @value ||= '' > Ncurses::Form.post_form @form > - set_cursed_value default if default > + set_cursed_value @value > end > > def position_cursor I will, just give me day or two. I am using gem version, not svn or git. I did some stuff with them but never with ruby. Can you give me two lines help what to install and where? Latest svn? Sorry I am not _that_ helpful but ruby is new thing to me. I should be able to test this soon enough with some help. Thanks, Dusan