octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #39724] history commands have an extraneous wh


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #39724] history commands have an extraneous white space at the front
Date: Thu, 08 Aug 2013 02:25:47 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

URL:
  <http://savannah.gnu.org/bugs/?39724>

                 Summary: history commands have an extraneous white space at
the front
                 Project: GNU Octave
            Submitted by: sebald
            Submitted on: Thu 08 Aug 2013 02:25:46 AM GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

When a command is typed at the GUI command line window it appears nicely
aligned to the left of the history window.  However, upon exiting and
relaunching, those same commands now have an extra white space between the
left margin and the command.  It would be much nicer for that white space to
not be introduced.

I have confirmed that this white space is being introduced at the Octave core,
not the GUI, by testing the following alteration:


void
octave_qt_link::do_set_history (const string_vector& hist)
{
  QStringList qt_hist;

  for (octave_idx_type i = 0; i < hist.length (); i++)
{
fprintf(stderr, "%s", hist[i].c_str());
    qt_hist.append (QString::fromStdString (hist[i]));
}


I investigated a bit into the core and I see oct-hist.cc and cmd-hist.cc
handle this.  However, it may not be that this is where the issue lies, e.g.,
reading the history back in.

In fact, it looks as though the issue is when the command is placed in the
history buffer (and I'm renaming the title appropriately and changing this
from a GUI issue).  Try the following:


>> hl = history;
>> lh{end}
ans =  lh = history;
>> lh{end}(1)
ans =
>> lh{end}(2)
ans = l
>> lh{end}(3)
ans = h
>>


Perhaps that space is added to make the up-arrow recall naturally have a
single white space character between the right-arrow character and the
command, but my feeling is that the history shouldn't have the extra white
space in that way.  The user never typed in that white space.  Instead, that
white space should be added as part of the code that recalls the command.

I suspect that when the command is processed by Octave core it sends the
command to the GUI history window, but it also places it in it's own history
with the white space.  But this is odd because recalling a command from
history by typing the up-arrow and then hitting return does not put a white
space at the front of the latest GUI history list.  Is that white space being
removed when pulled from the history buffer before processing?  Strange.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39724>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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