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

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

[Octave-bug-tracker] [bug #49323] Readline library does not support vi-m


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #49323] Readline library does not support vi-mode correctly
Date: Thu, 13 Oct 2016 02:37:34 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #10, bug #49323 (project octave):

I see the problem any time there is an input event hook function installed. 
FLTK does that.

So, can you try starting Octave and setting the toolkit to gnuplot and see if
the funny behavior goes away?

And then do this (still with gnuplot for graphics) to see if the problem
returns:


function f () end
add_input_event_hook (@f);


I see this problem just by adding the empty event hook function.

If you look at the function rl_read_key in input.c in the readline sources,
you can see that there are two separate code paths for the case of having an
event hook function or not having one.  I guess this screws up vi mode
somehow.  It doesn't seem to cause trouble for the emacs mode.

Here is that code from readline's input.c from the Debian package:


      /* If the user has an event function, then call it periodically. */
      if (rl_event_hook)
        {
          while (rl_event_hook)
            {
              if (rl_get_char (&c) != 0)
                break;
                
              if ((r = rl_gather_tyi ()) < 0)   /* XXX - EIO */
                {
                  rl_done = 1;
                  return ('\n');
                }
              else if (r > 0)                   /* read something */
                continue;

              RL_CHECK_SIGNALS ();
              if (rl_done)              /* XXX - experimental */
                return ('\n');
              (*rl_event_hook) ();
            }
        }
      else
        {
          if (rl_get_char (&c) == 0)
            c = (*rl_getc_function) (rl_instream);
/* fprintf(stderr, "rl_read_key: calling RL_CHECK_SIGNALS: _rl_caught_signal =
%d", _rl_caught_signal); */
          RL_CHECK_SIGNALS ();
        }


By default, rl_getc_function is rl_getc, which is considerably different from
rl_gather_tyi.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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