Commit Graph

21 Commits

Author SHA1 Message Date
Conrad Irwin 246b88cf16 Bond completion includes commands 2012-08-20 23:57:51 -07:00
☈king 4fca664ebc Filename completion. 2012-08-20 04:33:15 -06:00
☈king 6617856b06 Add Bond completion (when available) cirwin++ 2012-08-18 22:49:20 +00:00
Jason Laster f51fca89dc Revert "Revert "Merge pull request #678 from jasonLaster/tabcomplete""
This reverts commit 1234c90085.

Conflicts:

	lib/pry/completion.rb
	lib/pry/default_commands/cd.rb
	lib/pry/default_commands/input_and_output.rb
	test/test_completion.rb

Conflicts:

	test/test_completion.rb
2012-08-12 00:38:44 -04:00
Conrad Irwin 1234c90085 Revert "Merge pull request #678 from jasonLaster/tabcomplete"
This reverts commit 6386706645, reversing
changes made to d830ebbacc.

Conflicts:
	lib/pry/helpers/base_helpers.rb
2012-08-09 19:33:51 -07:00
Jason Laster 3841563fb2 add support tab-completing arbitrarily long paths 2012-08-06 15:39:57 -04:00
Jason Laster ef482bb551 add support for tabbing into previous scope 2012-08-05 23:53:53 -04:00
Conrad Irwin 7074302105 Reinstate removed partial rescues 2012-07-05 20:34:53 -07:00
Conrad Irwin b5cb8b142f Be more careful exception handling in Readline [Fixes #632, #605]
Firstly wrap the entire completion_proc in a begin/rescue/end so that
even if something we're not expecting goes wrong, we don't fail.

Secondly, only throw the user out of pry if reading from readline fails
five times in a row. This avoids a transient error (like a time-out, or
a failed tab completion) from kicking you out of pry; but also avoids
the infinite looping problem that can happen if the error is not transient.
2012-07-05 20:06:39 -07:00
Ryan Fitzgerald e14ee9a6f4 Fix various mangled documentation 2012-06-26 22:30:00 -07:00
Yorick Peterse 3fa74ea862 Manually merged branch "issue/601".
The commits in this branch would conflict with the current ones in the master
branch. I've modified the code of pry/completion.rb so that instead of escaping
*all* input it will only escape it when this hasn't already been done so.

This fixes #601.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
2012-06-19 15:47:52 +02:00
Yorick Peterse d3f1abbe37 Completion fix for Jruby.
Jruby doesn't always provide the method `#instance_methods()` on objects. By
checking to see if this method exists before using it the completion system
won't totally barf itself when used on Jruby.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
2012-06-19 13:19:32 +02:00
Yorick Peterse a36322a6bc Completion for instance and class variables.
Pry is now able to complete variable names for instance and class variables, as
well as being able to complete methods and the like on these variables.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
2012-06-19 12:32:03 +02:00
Yorick Peterse ea016d8e4c Escape user input before completing it.
User input should be escaped using Regexp.escape() before trying to figure out
what data to use for the Readline completion system. Not escaping this input
would cause Pry to fail for input such as `[10, 20].map(&:class)`.

This problem was caused due to lib/completion.rb converting the input (in this
case it would be ":class)") to a Regexp object. Because this, when converted to
a Regexp object, is invalid it would cause Pry to throw a RegexpError error and
bail out.

See #601 for more information.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
2012-06-19 11:44:34 +02:00
Conrad Irwin 04f8d4f48b Don't rescue overzealously. Fixes #220 2011-08-26 22:38:05 -07:00
Conrad Irwin fe911c6740 Don't crash if I have a badly behaved module.
The completion code was assuming that all modules would have names that
were strings, this is not always the case.
2011-08-16 21:53:20 -07:00
Lee Jarvis 60f164d8c4 cleaned up some indentation.. vim is good at this indenting stuff! 2011-05-19 19:24:07 +01:00
Lee Jarvis 3ff75dd20a whitespace cleanup in one hit 2011-04-18 22:31:39 +01:00
John Mair c8b05f54e0 another doc update, documented completion.rb and reworded some sections in README 2011-01-21 15:46:56 +13:00
John Mair ebdcfdf145 saving before refactor to implement action block instead of action proc for commands. All tests passing in 1.8 and 1.9. 2011-01-12 18:08:56 +11:00
John Mair 4ea554fcfd added completion (taken from irb). Remember to remove hardcoding expecation of command_info from Pry#re() method, need to turn command addition into DSL 2011-01-11 00:54:17 +11:00