nushell / reedline

A feature-rich line editor - powering Nushell
https://docs.rs/reedline/
MIT License
549 stars 154 forks source link

Fix vi mode change not pastable #807

Closed adaschma closed 3 months ago

adaschma commented 4 months ago

While extending the tests for vi mode, I noticed that c$ (replace text until end of line with newly entered text) and cc (replace the entire line with newly entered text) don't actually cut the removed text. This fixed that. Verified with vim 9.1 that it should be cut a.k.a. pastable.

Test:

setup:

  1. $ cargo run --example demo -- --vi
  2. enter a text (optionally use + to enter multiple line)
  3. press to enter vi normal mode and use the arrow keys to navigate somewhere in the line

actual test:

both "cc p" and "c$ p" should now leave the text unchanged by cutting out text and pasting it back again (, but moving the cursor to the end).

fdncred commented 3 months ago

Thanks