Make word selection behave in Ruby