diff --git a/src/reader.rs b/src/reader.rs index 59f8b8365..5a8653a2d 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -3204,7 +3204,15 @@ impl<'a> Reader<'a> { ); let (elt, el) = self.active_edit_line(); let mut replacement = WString::new(); - while pos < el.position() { + while pos + < if self.cursor_selection_mode == CursorSelectionMode::Inclusive + && self.is_at_end(el) + { + el.len() + } else { + el.position() + } + { let chr = el.text().as_char_slice()[pos]; // We always change the case; this decides whether we go uppercase (true) or diff --git a/tests/pexpects/bind.py b/tests/pexpects/bind.py index d1588464f..991325e33 100644 --- a/tests/pexpects/bind.py +++ b/tests/pexpects/bind.py @@ -241,6 +241,12 @@ expect_prompt("foo") # send("hh~~bbve~\r") # expect_prompt(TO_END + "SOME TeXT\r\n", unmatched="Couldn't find expected output 'SOME TeXT") +send("echo echo") +send("\033") +sleep(0.200) +send("bgU\r") +expect_prompt("echo ECHO") + send("echo 125") send("\033") sleep(0.200)