Comments (3)
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.
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.
sure go for it
from rb-readline.
Related Issues (20)
- IRB and readline with non english keyboards on Windows HOT 1
- Alt+. crashes in `_extract_last_quote` when last line is empty
- Already initialized constant warnings under Ruby 2.3.1 HOT 4
- new release HOT 4
- VI in Rails Console HOT 2
- rb-readline (0.5.3) crashes on mac_os_x / 2.3.1p112 HOT 1
- "\r" being displayed after hitting enter in rb-readline on Arch HOT 2
- Invalid byte sequence in UTF-8 when running console HOT 5
- issue deploying rails 5 application to AWS using Elastic Beanstalk due to rb-readline HOT 5
- RbReadline.rl_insert_text can not insert Chinese characters
- Officially support JRuby HOT 2
- ArgumentError when case insensitive matching is active HOT 1
- Add support for Readline.vi_editing_mode? & Readline.emacs_editing_mode? HOT 1
- Tests are randomly failing
- Using rb-readline in Windows with cygwin/mintty/git for Windows doesn't work
- Rb-readline causes the rails console to use the keyboard "↑" after typing Chinese and cannot load Chinese
- Fails when $TERM=xterm HOT 4
- Broken support for special prefixes HOT 1
- `Readline::HISTORY.delete_at(index)` not working for indices of negative values
- Encoding::UndefinedConversionError for UTF-8 to ASCII8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rb-readline.