diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2020-03-21 18:22:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-21 18:22:27 +0800 |
commit | fc30295031f294d9c4d143502ac69cae4456899f (patch) | |
tree | 2134fdbca3f1473a13fbf7f656a19b7d2f2408db | |
parent | bb10f95019c57cafc18b30e215b1c546b30578d0 (diff) | |
parent | b634abccb765a2f428032bf5f45d2fbc8122ead4 (diff) | |
download | pry-fc30295031f294d9c4d143502ac69cae4456899f.tar.gz |
Merge pull request #2114 from pry/1859-vi-overhang-fix
repl: clear line after indenting when Vi mode is enabled
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | lib/pry/repl.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 415f676c..6fa9a86a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 + ([#2114](https://github.com/pry/pry/pull/2114)) ### [v0.12.2][v0.12.2] (November 12, 2018) diff --git a/lib/pry/repl.rb b/lib/pry/repl.rb index a6174d5d..ba032c7f 100644 --- a/lib/pry/repl.rb +++ b/lib/pry/repl.rb @@ -243,7 +243,7 @@ class Pry # 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. |