From: Mark Hubbart Date: 2005-05-27T02:46:16+09:00 Subject: Re: Pasting code with tab indentation to irb On 5/26/05, benny wrote: > dear list, > > I want to be able to copy/paste code with tab indentation to irb, but I > don't know how to setup irb for this. > > I am aware of > > require 'irb/completion' > > in the .irbrc taking the tab completition away from the shell and > making its own tab completition. > > So maybe I may overwrite some method in irb/ irb/completition to prevent > irb tab completition and shell/bash tab completition. > > I tried to figure it out on my own but didn't succeed. > > Any hints? (Please no discussion about tab indentation vs. space indentation > here :) ) You could assign a new input method to IRB.CurrentContext.io: IRB.CurrentContext.io = IRB::StdioInputMethod.new Write a short-named method that toggles the input method between IRB::StdioInputMethod and IRB::ReadlineInputMethod, and you can quickly switch between the two modes. cheers, Mark