GithubHelp home page GithubHelp logo

Comments (3)

rdp avatar rdp commented on July 18, 2024

Just ran into this today.

>> some_stuff/home/wilkboar/local_installs/lib/ruby/site_ruby/1.8/rbreadline.rb:7365:in `rl_yank_nth_arg_internal': undefined method `history_arg_extract' for RbReadline:Module (NoMethodError)
        from /home/wilkboar/local_installs/lib/ruby/site_ruby/1.8/rbreadline.rb:7425:in `rl_yank_last_arg'
        from /home/wilkboar/local_installs/lib/ruby/site_ruby/1.8/rbreadline.rb:4254:in `send'
        from /home/wilkboar/local_installs/lib/ruby/site_ruby/1.8/rbreadline.rb:4254:in `_rl_dispatch_subseq'
        from /home/wilkboar/local_installs/lib/ruby/site_ruby/1.8/rbreadline.rb:4263:in `_rl_dispatch_subseq'
        from /home/wilkboar/local_installs/lib/ruby/site_ruby/1.8/rbreadline.rb:4243:in `_rl_dispatch'
        from /home/wilkboar/local_installs/lib/ruby/site_ruby/1.8/rbreadline.rb:4660:in `readline_internal_charloop'
        from /home/wilkboar/local_installs/lib/ruby/site_ruby/1.8/rbreadline.rb:4734:in `readline_internal'
        from /home/wilkboar/local_installs/lib/ruby/site_ruby/1.8/rbreadline.rb:4756:in `readline'
         ... 18 levels...
        from /home/wilkboar/local_installs/lib/ruby/1.8/irb.rb:70:in `start'
        from /home/wilkboar/local_installs/lib/ruby/1.8/irb.rb:69:in `catch'
        from /home/wilkboar/local_installs/lib/ruby/1.8/irb.rb:69:in `start'
        from /home1/wilkboar/local_installs/bin/irb:13

from rb-readline.

Spakman avatar Spakman commented on July 18, 2024

I've been looking at GNU Readline for porting this. Unfortunately, it's not quite as straightforward as I would like (things like the tokenization of strings using multiple delimiters and returning multiple args make it trickier than you might think).

For Urchin I'm using a very dumbed-down version, which simply splits on spaces that haven't been backslash-escaped:

module RbReadline
  def self.history_arg_extract(first, last, string)
    if first != "$" || last != "$"
      fail "RbReadline.history_arg_extract called with currently unsupported args."
    end

    words = string.split
    while words.size > 1 && words[-2][-1].chr == "\\"
      words[-2] = "#{words[-2]} #{words.last}"
      words.pop
    end
    words.last
  end
end

I'm considering committing this to rb-readline as it is probably generally useful until we get a full implementation.

@rdp - would this suffice for your use case?

from rb-readline.

rdp avatar rdp commented on July 18, 2024

sure go for it

from rb-readline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.