Skip to content

Commit

Permalink
repl: clear line after indenting when Vi mode is enabled
Browse files Browse the repository at this point in the history
Fixes #1859 (Pry still leaves duplicated characters on long enough input)
  • Loading branch information
kyrylo committed Mar 21, 2020
1 parent bb10f95 commit 4031f25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
([#2098](https://github.com/pry/pry/pull/2098))
* Fixed bug when `Object#owner` is defined, which results into somewhat broken
method introspection ([#2113](https://github.com/pry/pry/pull/2113))
* Fixed bug when indentation leaves parts of input after pressing enter when
Readline is enabled with mode indicators for vi mode. This was supposed to be
fixed in v0.12.2 but it regressed
([#2113](https://github.com/pry/pry/pull/2113))

### [v0.12.2][v0.12.2] (November 12, 2018)

Expand Down
2 changes: 1 addition & 1 deletion lib/pry/repl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def calculate_overhang(current_prompt, original_val, indented_val)
# rb-readline doesn't support this method:
# https://github.com/ConnorAtherton/rb-readline/issues/152
if Readline.vi_editing_mode?
overhang += current_prompt.length - indented_val.length
overhang = output.width - current_prompt.size - indented_val.size
end
rescue NotImplementedError
# VI editing mode is unsupported on JRuby.
Expand Down

0 comments on commit 4031f25

Please sign in to comment.