1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/lib/pry
Kyrylo Silin 565d540c79 repl: correctly calculate overhang for empty lines
This improves on https://github.com/pry/pry/pull/1813.

I spotted a problem with the way it works: sometimes, if you enter an empty
line, the output would span across two lines:

```
[1] pry(main)>

[2] pry(main)>

[3] pry(main)>
```

This is because overhang is bigger than the current line. I also noticed a bug
with method definition, where defining a method leaves an unwanted empty line:

```
[3] pry(main)> def foo
             | end

=> :foo
```

To fix this I changed the way we calculate overhang. First and the most
important change is that I stopped calculating overhang for emacs mode. This is
because it's too risky to introduce this change because it's the default mode
and 99% of our users use this, so there's no need to change this
behaviour. Another reason is that emacs mode users typically don't use any mode
indicators (because emacs has no modes), so it strikes me as a more pragmatic
solution.

With Vi mode we calculate overhang and still support custom indicators.
2018-10-22 04:29:28 +08:00
..
code Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
commands rubocop: fix offences of the Lint/AssignmentInCondition cop 2018-10-21 05:52:22 +08:00
config Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
helpers rubocop: fix offences of the Lint/AssignmentInCondition cop 2018-10-21 05:52:22 +08:00
method rubocop: fix offences of the Lint/StringConversionInInterpolation 2018-10-16 04:49:13 +08:00
slop rubocop: fix offences of the Lint/AssignmentInCondition cop 2018-10-21 05:52:22 +08:00
testable rubocop: fix offences of the Style/HashSyntax cop 2018-10-13 03:09:29 +08:00
wrapped_module Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
basic_object.rb add as needed 2015-12-27 04:47:55 +00:00
cli.rb rubocop: fix offences of the Style/HashSyntax cop 2018-10-13 03:09:29 +08:00
code.rb Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
code_object.rb Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
color_printer.rb Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
command.rb rubocop: fix offences of the Lint/StringConversionInInterpolation 2018-10-16 04:49:13 +08:00
command_set.rb rubocop: fix offences of the Lint/AssignmentInCondition cop 2018-10-21 05:52:22 +08:00
commands.rb
config.rb rename Pry::Config::Lazy to Pry::Config::Memoization (ref #1503) 2017-06-23 06:18:19 +01:00
core_extensions.rb core_extensions: make '__binding__' work with redefined #respond_to? 2018-10-17 23:10:21 +08:00
editor.rb rubocop: fix offences of the Layout/EndAlignment cop 2018-10-13 01:14:21 +08:00
exceptions.rb Handle error about frozen object in Ruby 2.2 2014-10-14 23:07:48 +09:00
forwardable.rb fix warning about splat 2017-06-04 22:28:25 +01:00
helpers.rb
history.rb Gracefully handle (ignore) null bytes in history lines 2018-10-09 13:29:44 +01:00
hooks.rb rubocop: fix offences of the Lint/UnusedMethodArgument cop 2018-10-14 14:56:53 +08:00
indent.rb rubocop: fix offences of the Layout/ExtraSpacing cop 2018-10-13 00:54:00 +08:00
input_completer.rb Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
input_lock.rb rubocop: fix offences of the Lint/UnneededRequireStatement cop 2018-10-16 04:43:41 +08:00
inspector.rb
last_exception.rb fix warning about signature of respond_to? on 2.4 2017-05-27 18:41:00 +01:00
method.rb Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
object_path.rb rubocop: fix offences of the Lint/AmbiguousBlockAssociation cop 2018-10-16 04:38:17 +08:00
output.rb rubocop: fix offences of the Lint/AssignmentInCondition cop 2018-10-21 05:52:22 +08:00
pager.rb Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
platform.rb Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
plugins.rb Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
prompt.rb
pry_class.rb Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
pry_instance.rb pry_instance: deprecate '#output_array' & '#input_array' 2018-10-20 01:07:25 +08:00
repl.rb repl: correctly calculate overhang for empty lines 2018-10-22 04:29:28 +08:00
repl_file_loader.rb rubocop: fix offences of the Style/HashSyntax cop 2018-10-13 03:09:29 +08:00
ring.rb ring: rewrite the class to improve API 2018-10-21 05:31:45 +08:00
rubygem.rb rubocop: fix offences of the Style/HashSyntax cop 2018-10-13 03:09:29 +08:00
slop.rb rubocop: fix offences of the Lint/AssignmentInCondition cop 2018-10-21 05:52:22 +08:00
terminal.rb Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
testable.rb add Pry::Testable, and friends. (#1679) 2017-11-04 05:32:31 +01:00
version.rb bump version (#1702) 2017-11-14 15:04:53 +01:00
wrapped_module.rb rubocop: fix offences of the Lint/AssignmentInCondition cop 2018-10-21 05:52:22 +08:00